CVE-2022-23647: Cross-site Scripting in Prism
Vulnerability summary
CVE-2022-23647 is a high (CVSS 7.5) vulnerability in prismjs prism. EPSS estimates a 1.43% chance of exploitation in the next 30 days, higher than 73.8% of scored vulnerabilities.
Not severe (CVSS 7.5, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?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
74%
Versus all other CVEs
30-day change
No change 0.00 pp
From 1.43% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
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