org.mvnpm:highlight.js@11.11.0

  • latest version

    11.12.0

  • first published

    3 years ago

  • latest version published

    3 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:highlight.js package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Regular Expression Denial of Service (ReDoS)

    org.mvnpm:highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework, and has automatic language detection.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in multiple language grammars, including the bash, livescript, scilab, stan, csharp, and perl definitions in src/languages/, whose patterns pair an unbounded quantified run with an optional or rarely matched tail and so backtrack quadratically. Because hljs.highlight() and highlightAuto() are synchronous and single-threaded, an input of tens of kilobytes crafted for an affected grammar stalls the calling thread for seconds, superlinearly in input size, and roughly a megabyte can block it for far longer. An application that highlights attacker-controlled input with one of these grammars can be driven into a denial of service, blocking a browser tab or, for server-side highlighting, the Node event loop. The behavior is polynomial rather than exponential, so capping input length is an effective mitigation.

    How to fix Regular Expression Denial of Service (ReDoS)?

    There is no fixed version for org.mvnpm:highlight.js.

    [0,)