CVE-2022-23647: prismjs prism Cross-site Scripting
Vulnerability summary
CVE-2022-23647 is a high (CVSS 7.5) Cross-site Scripting vulnerability in prismjs prism. EPSS estimates a 1.43% chance of exploitation in the next 30 days, higher than 72.5% of scored vulnerabilities.
Timeline
- 18-02-2022PublishedVulnerability first disclosed.
- 23-04-2025Last modifiedVulnerability information updated.
Description
Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting 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. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.
CVSS metrics
6 scores · 5 sources · 2 versions- OSV · UbuntuEcosystem advisory · calculated6.1MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NDiffers
- OSV · DebianEcosystem advisory · calculated6.1MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NDiffers
- OSV · NpmEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
- NVDNIST6.1MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NDiffers
EPSS trend
Probability
1.43%
Chance of exploitation in the next 30 days
Percentile
73%
Versus all other CVEs
30-day change
-0.05 pp
From 1.48% on 19-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Debian1 product
- node-prismjs< 1.27.0+dfsg+~1.26.0-1
Npm1 product
- prismjs≥ 1.14.0, < 1.27.0
Prismjs1 product
- prism≥ 1.14.0, < 1.27.0
Ubuntu1 product
- node-prismjsAll versions (No fix recorded)
4 vendors · 4 products
References
9 links- github.com/PrismJS/prism/security/advisories/GHSA-3949-f494-cm99X Refsource CONFIRMREPORTWEBThird Party Advisory
- github.com/PrismJS/prism/commit/e002e78c343154e1c0ddf9d6a0bb85689e1a5c7cX Refsource MISCREPORTWEBPatchThird Party Advisory
- github.com/PrismJS/prismPACKAGE