prismjs@1.15.0 vulnerabilities

Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.

  • latest version

    1.30.0

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    7 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the 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
    • L
    Arbitrary Code Injection

    prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Arbitrary Code Injection via the document.currentScript lookup process. An attacker can manipulate the web page content and execute unintended actions by injecting HTML elements that overshadow legitimate DOM elements.

    Note:

    This is only exploitable if the application accepts untrusted input containing HTML but not direct JavaScript.

    How to fix Arbitrary Code Injection?

    Upgrade prismjs to version 1.30.0 or higher.

    <1.30.0
    • M
    Cross-site Scripting (XSS)

    prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the command line plugin which does not properly escape its output, leading to the input text being inserted into the DOM as HTML code.

    How to fix Cross-site Scripting (XSS)?

    Upgrade prismjs to version 1.27.0 or higher.

    >=1.14.0 <1.27.0
    • H
    Regular Expression Denial of Service (ReDoS)

    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)?

    Upgrade prismjs to version 1.25.0 or higher.

    <1.25.0
    • H
    Regular Expression Denial of Service (ReDoS)

    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)?

    Upgrade prismjs to version 1.24.0 or higher.

    <1.24.0
    • H
    Regular Expression Denial of Service (ReDoS)

    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)?

    Upgrade prismjs to version 1.23.0 or higher.

    <1.23.0
    • H
    Cross-site Scripting (XSS)

    prismjs is a lightweight, robust, elegant syntax highlighting library.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the easing preview of the Previewers plugin. It allows attackers to execute arbitrary code in Safari and Internet Explorer.

    How to fix Cross-site Scripting (XSS)?

    Upgrade prismjs to version 1.21.0 or higher.

    >=1.1.0 <1.21.0