Skip to content

highlight-9.11.0.min.js: 2 vulnerabilities (highest severity is: 5.8) [master] #47

@renovate

Description

@renovate
📂 Vulnerable Library - highlight-9.11.0.min.js

Syntax highlighting with language auto-detection.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js

Path to dependency file: /backend/build/public/index.html

Path to vulnerable library: /backend/build/public/index.html

Findings

Finding Severity 🎯 CVSS Exploit Maturity EPSS Library Type Fixed in Remediation Available Reachability
CVE-2020-26237 🟠 Medium 5.8 Not Defined < 1% highlight-9.11.0.min.js Direct 9.18.2, 10.1.2
WS-2020-0208 🟠 Medium 5.3 N/A N/A highlight-9.11.0.min.js Direct 10.4.1

Details

🟠CVE-2020-26237

Vulnerable Library - highlight-9.11.0.min.js

Syntax highlighting with language auto-detection.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js

Path to dependency file: /backend/build/public/index.html

Path to vulnerable library: /backend/build/public/index.html

Dependency Hierarchy:

  • highlight-9.11.0.min.js (Vulnerable Library)

Vulnerability Details

Highlight.js is a syntax highlighter written in JavaScript. Highlight.js versions before 9.18.2 and 10.1.2 are vulnerable to Prototype Pollution. A malicious HTML code block can be crafted that will result in prototype pollution of the base object's prototype during highlighting. If you allow users to insert custom HTML code blocks into your page/app via parsing Markdown code blocks (or similar) and do not filter the language names the user can provide you may be vulnerable. The pollution should just be harmless data but this can cause problems for applications not expecting these properties to exist and can result in strange behavior or application crashes, i.e. a potential DOS vector. If your website or application does not render user provided data it should be unaffected. Versions 9.18.2 and 10.1.2 and newer include fixes for this vulnerability. If you are using version 7 or 8 you are encouraged to upgrade to a newer release.

Publish Date: Nov 24, 2020 11:00 PM

URL: CVE-2020-26237

Threat Assessment

Exploit Maturity:Not Defined

EPSS:< 1%

Score: 5.8


Suggested Fix

Type: Upgrade version

Origin: GHSA-vfrc-7r7c-w9mx

Release Date: Nov 24, 2020 11:00 PM

Fix Resolution : 9.18.2, 10.1.2

🟠WS-2020-0208

Vulnerable Library - highlight-9.11.0.min.js

Syntax highlighting with language auto-detection.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js

Path to dependency file: /backend/build/public/index.html

Path to vulnerable library: /backend/build/public/index.html

Dependency Hierarchy:

  • highlight-9.11.0.min.js (Vulnerable Library)

Vulnerability Details

Impact: Potential ReDOS vulnerabilities (exponential and polynomial RegEx backtracking) "oswasp" (https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS): «The Regular expression Denial of Service (ReDoS) is a Denial of Service attack, that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). An attacker can then cause a program using a Regular Expression to enter these extreme situations and then hang for a very long time.» If are you are using Highlight.js to highlight user-provided data you are possibly vulnerable. On the client-side (in a browser or Electron environment) risks could include lengthy freezes or crashes... On the server-side infinite freezes could occur... effectively preventing users from accessing your app or service (ie, Denial of Service). This is an issue with grammars shipped with the parser (and potentially 3rd party grammars also), not the parser itself. If you are using Highlight.js with any of the following grammars you are vulnerable. If you are using "highlightAuto" to detect the language (and have any of these grammars registered) you are vulnerable. Exponential grammars (C, Perl, JavaScript) are auto-registered when using the common grammar subset/library "require('highlight.js/lib/common')" as of 10.4.0 - see https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.4.0/build/highlight.js All versions prior to 10.4.1 are vulnerable, including version 9.18.5. Grammars with exponential backtracking issues: - c-like (c, cpp, arduino) - handlebars (htmlbars) - gams - perl - jboss-cli - r - erlang-repl - powershell - routeros - livescript (10.4.0 and 9.18.5 included this fix) - javascript & typescript (10.4.0 included partial fixes) And of course any aliases of those languages have the same issue. ie: "hpp" is no safer than "cpp". Grammars with polynomial backtracking issues: - kotlin - gcode - d - aspectj - moonscript - coffeescript/livescript - csharp - scilab - crystal - elixir - basic - ebnf - ruby - fortran/irpf90 - livecodeserver - yaml - x86asm - dsconfig - markdown - ruleslanguage - xquery - sqf And again: any aliases of those languages have the same issue. ie: "ruby" and "rb" share the same ruby issues. Patches - Version 10.4.1 resolves these vulnerabilities. Please upgrade. Workarounds / Mitigations - Discontinue use the affected grammars. (or perhaps use only those with poly vs exponential issues) - Attempt cherry-picking the grammar fixes into older versions... - Attempt using newer CDN versions of any affected languages. (ie using an older CDN version of the library with newer CDN grammars). Your mileage may vary. References - https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS For more information If you have any questions or comments about this advisory: * Open an issue: https://github.com/highlightjs/highlight.js/issues * Email us at "security@highlightjs.com" (mailto:security@highlightjs.com)

Publish Date: May 19, 2026 10:39 PM

URL: WS-2020-0208

Threat Assessment

Exploit Maturity:N/A

EPSS:N/A

Score: 5.3


Suggested Fix

Type: Upgrade version

Origin: https://github.com/highlightjs/highlight.js/tree/10.4.1

Release Date: Nov 03, 2024 10:02 AM

Fix Resolution : 10.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions