CVE-2024-53382: Prismjs PrismJS DOM Clobbering Vulnerability Vulnerability
MODERATECVE-2024-53382 is a MODERATE (CVSS 4.9) prismjs dom clobbering vulnerability vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Prismjs libraries in the npm ecosystem. The issue involves prismjs dom clobbering vulnerability. Remediation is available by upgrading affected packages to version 1.30.0.
CVE-2024-53382 at a Glance
Security Impact
CVSS: 4.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2024-53382
To remediate this vulnerability, upgrade all affected Prismjs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install prismjs@1.30.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls prismjs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-53382, inspect your project dependencies using npm:
npm ls prismjs
Analyze the terminal output to locate any version of Prismjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.30.0), your application is affected.
Note: The npm ls prismjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Prismjs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-53382 Affected Prismjs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
prismjs
|
npm |
< 1.30.0
|
1.30.0
|
References
Frequently Asked Questions
What is CVE-2024-53382?
Which Prismjs versions are affected?
What version fixes CVE-2024-53382?
Is prismjs affected?
What is the CVSS score of CVE-2024-53382?
What CWE is associated with CVE-2024-53382?
How can I check npm dependencies for CVE-2024-53382?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x7hr-w5r2-h6wg",
"modified" : "2025-06-30T12:51:19Z",
"published" : "2025-03-03T09:30:34Z",
"aliases" : [ "CVE-2024-53382" ],
"summary" : "PrismJS DOM Clobbering vulnerability",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "prismjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.30.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-53382"
}, {
"type" : "WEB",
"url" : "https://github.com/PrismJS/prism/pull/3863"
}, {
"type" : "WEB",
"url" : "https://github.com/PrismJS/prism/commit/8e8b9352dac64457194dd9e51096b4772532e53d"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/jackfromeast/aeb128e44f05f95828a1a824708df660"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PrismJS/prism"
}, {
"type" : "WEB",
"url" : "https://github.com/PrismJS/prism/blob/59e5a3471377057de1f401ba38337aca27b80e03/prism.js#L226-L259"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-94" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-03T20:16:32Z",
"nvd_published_at" : "2025-03-03T07:15:33Z"
}
}