org.webjars:prismjs@1.0.0 vulnerabilities

  • latest version

    1.16.0

  • first published

    9 years ago

  • latest version published

    5 years ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars:prismjs package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

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

    org.webjars:prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the Prism.languages.markup.comment regex.

    PoC

    var comment = /<!--[\s\S]*?-->/
    for(var i = 1; i <= 50000; i++) {
      var time = Date.now();
      var attack_str = ""+"<!--".repeat(i*10000)+"-"
      comment.test(attack_str)
      var time_taken = Date.now() - time;
      console.log("attack_str.length: " + attack_str.length + ": " + time_taken+" ms")
    }
    

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

    A fix was pushed into the master branch but not yet published.

    [0,)
    • H
    Regular Expression Denial of Service (ReDoS)

    org.webjars:prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the prism-asciidoc and prism-erb components. When Prism is used to highlight untrusted (user-given) text, an attacker can craft a string that will take a very very long time to highlight.

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

    There is no fixed version for org.webjars:prismjs.

    [0,)
    • H
    Regular Expression Denial of Service (ReDoS)

    org.webjars:prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the prism-asciidoc, prism-rest, prism-tap and prism-eiffel components.

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

    There is no fixed version for org.webjars:prismjs.

    [0,)
    • H
    Regular Expression Denial of Service (ReDoS)

    org.webjars:prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). The 'template-string'-Regexp is supposed to match a multiline string, meaning that if it doesn't find a match it will scan to the end of the file and then backtrack. Every backslash doubles the number of steps needed causing exponential growth and memory usage.

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

    Upgrade org.webjars:prismjs to version 1.5.0 or higher.

    [,1.5.0)