{"id":"CVE-2022-23647","published":"2022-02-18T14:50:10Z","modified":"2025-04-23T19:02:44Z","title":"Cross-site Scripting in Prism","vendor":"PrismJS","product":"prism","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01425,"percentile":0.73574,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/PrismJS/prism/security/advisories/GHSA-3949-f494-cm99","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/PrismJS/prism/pull/3341","tags":["x_refsource_MISC"]},{"url":"https://github.com/PrismJS/prism/commit/e002e78c343154e1c0ddf9d6a0bb85689e1a5c7c","tags":["x_refsource_MISC"]}],"priority":{"score":20.0,"factors":[{"name":"EPSS percentile","points":14.71},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"prismjs","affectedVersions":[{"vendor":"PrismJS","product":"prism","versions":[">= 1.14.0, < 1.27.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-23T14:10:20.892889Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"prismjs","vulnerableRanges":[">=1.14.0, <1.27.0"],"patched":["1.27.0"],"from":["GHSA-3949-f494-cm99"],"provenance":"source"}],"summary":{"text":"A cross-site scripting flaw in the Command Line plugin of PrismJS's Prism syntax highlighting library, affecting versions from 1.14.0 up to but not including 1.27.0, where the plugin fails to escape its output so input text is inserted into the DOM as HTML. An attacker can execute script in a victim's browser by supplying crafted input that the plugin renders, which requires that the page use the Command Line plugin on untrusted input and that a user interact with the affected content; server-side use of Prism and sites not using the plugin are not affected.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:15:41Z"},"euvd":{"id":"EUVD-2022-0785","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-23341","published":"2021-02-18","fixed":"1.23.0","kev":false},{"cve":"CVE-2021-32723","published":"2021-06-28","fixed":"1.24.0","kev":false},{"cve":"CVE-2021-3801","published":"2021-09-15","fixed":"1.25.0","kev":false,"link":{"from":"CVE-2021-3801","to":"CVE-2022-23647","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:prismjs","fromFixed":"1.25.0","toFixed":"1.27.0","daysApart":156}]}},{"cve":"CVE-2022-23647","published":"2022-02-18","fixed":"1.27.0","kev":false},{"cve":"CVE-2024-53382","published":"2025-03-03","fixed":"1.30.0","kev":false}],"package":"npm:prismjs"}}