Skip to content

← Public intelligence

npm package

prismjs

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

6 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 4.9npmAmendedPublished

    PrismJS DOM Clobbering vulnerability

    CVE-2024-53382 · GHSA-x7hr-w5r2-h6wg

    Affected
    • npm prismjs < 1.30.0
    Fixed in
    1.30.0· Vendor fix available
    Issue
    Prism (aka PrismJS) through 1.29.0 allows DOM Clobbering (with resultant XSS for untrusted input that contains HTML but does not directly contain JavaScript), because document.currentScript lookup can be shadowed by attacker-injected HTML elements.

    Recommended action: Upgrade to 1.30.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. High, CVSS 7.5npmAmendedPublished

    Cross-site Scripting in Prism

    CVE-2022-23647 · GHSA-3949-f494-cm99

    Affected
    • npm prismjs >= 1.14.0, < 1.27.0
    Fixed in
    1.27.0· Vendor fix available
    Issue
    Impact Prism's Command line plugin can be used by attackers to achieve an XSS attack. The Command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. Patches This bug has been fixed in v1.27.0. Workarounds Do not use the Command line plugin on untrusted inputs, or sanitized all code blocks (remove all HTML code text) from all code blocks that use the Command line plugin. References - https://github.com/PrismJS/prism/pull/3341

    Recommended action: Upgrade to 1.27.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. Medium, CVSS 6.5npmAmendedPublished

    prismjs Regular Expression Denial of Service vulnerability

    CVE-2021-3801 · GHSA-hqhp-5p83-hx96

    Affected
    • npm prismjs < 1.25.0
    Fixed in
    1.25.0· Vendor fix available
    Issue
    Prism is a syntax highlighting library. The prismjs package is vulnerable to ReDoS (regular expression denial of service). An attacker that is able to provide a crafted HTML comment as input may cause an application to consume an excessive amount of CPU.

    Recommended action: Upgrade to 1.25.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 7.4npmAmendedPublished

    Regular Expression Denial of Service (ReDoS) in Prism

    CVE-2021-32723 · GHSA-gj77-59wh-66hg

    Affected
    • npm prismjs < 1.24.0
    Fixed in
    1.24.0· Vendor fix available
    Issue
    Some languages before 1.24.0 are vulnerable to Regular Expression Denial of Service (ReDoS). Impact 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. Do not use the following languages to highlight untrusted text. - ASCIIDoc - ERB Other languages are not affected and can be used to highlight untrusted text. Patches This problem has been fixed in Prism v1.24. References - PrismJS/prism#2774 - PrismJS/prism#2688

    Recommended action: Upgrade to 1.24.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. UnratednpmAmendedPublished

    Denial of service in prismjs

    CVE-2021-23341 · GHSA-h4hr-7fg3-h35w

    Affected
    • npm prismjs < 1.23.0
    Fixed in
    1.23.0· Vendor fix available
    Issue
    The package prismjs before 1.23.0 are vulnerable to Regular Expression Denial of Service (ReDoS) via the prism-asciidoc, prism-rest, prism-tap and prism-eiffel components.

    Recommended action: Upgrade to 1.23.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. High, CVSS 7.1npmAmendedPublished

    Cross-Site Scripting in Prism

    CVE-2020-15138 · GHSA-wvhm-4hhf-97x9

    Affected
    • npm prismjs >= 1.1.0, < 1.21.0
    Fixed in
    1.21.0· Vendor fix available
    Issue
    Impact The easing preview of the Previewers plugin has an XSS vulnerability that allows attackers to execute arbitrary code in Safari and Internet Explorer. This impacts all Safari and Internet Explorer users of Prism =v1.1.0 that use the Previewers plugin (=v1.10.0) or the Previewer: Easing plugin (v1.1.0 to v1.9.0). Patches This problem is patched in v1.21.0. Workarounds To workaround the issue without upgrading, disable the easing preview on all impacted code blocks. You need Prism v1.10.0 or newer to apply this workaround. References The vulnerability was introduced by this commit on Sep 29, 2015 and fixed by Masato Kinugawa (#2506). For more information If you have any questions or comments about this advisory, please open an issue.

    Recommended action: Upgrade to 1.21.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →