{"id":"CVE-2022-23647","aliases":["CLSA-2026-1793304056","DEBIAN-CVE-2022-23647","EUVD-2022-0785","GHSA-3949-f494-cm99","ROOT-APP-NPM-CVE-2022-23647","UBUNTU-CVE-2022-23647"],"status":"published","title":"Cross-site Scripting in Prism","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.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.01425,"percentile":0.73138,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2022-02-18T14:50:10Z","modified":"2026-11-03T08:02:12Z","fixes":[{"ecosystem":"npm","package":"prismjs","fixed_in":["1.27.0"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"node-prismjs","fixed_in":["1.27.0+dfsg+~1.26.0-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"node-prismjs","fixed_in":["1.27.0+dfsg+~1.26.0-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"node-prismjs","fixed_in":["1.27.0+dfsg+~1.26.0-1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"prismjs","fixed_in":["1.17.1-aikido.1","1.27.0-aikido.2"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/prismjs","fixed_in":["1.17.1-root.io.1","1.27.0-root.io.2","1.27.0-root.io.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.14.0"},{"fixed":"1.27.0"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.17.1-tuxcare.0"},{"fixed":"1.17.1-tuxcare.1"}]}],"versions":["1.17.1"],"bundled":6},{"source":"osv","ecosystem":"Debian:12","package":"node-prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.27.0+dfsg+~1.26.0-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"node-prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.27.0+dfsg+~1.26.0-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"node-prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.27.0+dfsg+~1.26.0-1"}]}]},{"source":"osv","ecosystem":"npm","package":"prismjs","ranges":[{"type":"SEMVER","events":[{"introduced":"1.14.0"},{"fixed":"1.27.0"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.17.1-aikido.1"},{"fixed":"1.27.0-aikido.2"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.17.1-root.io.1"},{"fixed":"1.27.0-root.io.2"},{"fixed":"1.27.0-root.io.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"node-prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.11.0+dfsg-2","1.11.0+dfsg-3"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"node-prismjs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.23.0+dfsg-1","1.25.0+dfsg-1","1.27.0+dfsg+~1.26.0-1"]}],"products":[{"vendor":"prismjs","product":"prism"}],"references":[{"url":"https://github.com/PrismJS/prism/security/advisories/GHSA-3949-f494-cm99","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://github.com/PrismJS/prism/pull/3341","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://github.com/PrismJS/prism/commit/e002e78c343154e1c0ddf9d6a0bb85689e1a5c7c","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23647","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-3949-f494-cm99"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/23xxx/CVE-2022-23647.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-23647","tags":["advisory"]},{"url":"https://github.com/PrismJS/prism","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2022-23647","tags":["report"]},{"url":"https://github.com/PrismJS/prism/issues/3340","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-23647","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2022-23647","title":"Cross-site Scripting in Prism","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.","status":"published","published":"2022-02-18T14:50:10Z","modified":"2025-04-23T19:02:44.473Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:34:29.842547Z"}],"euvd":[{"id":"EUVD-2022-0785","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.","status":"published","published":"2022-02-18T14:50:10Z","modified":"2025-04-23T19:02:44Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T20:52:07.453218Z"}],"ghsa":[{"id":"GHSA-3949-f494-cm99","title":"Cross-site Scripting in Prism","description":"### Impact\nPrism's [Command line plugin](https://prismjs.com/plugins/command-line/) 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.\n\nServer-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted.\n\n### Patches\nThis bug has been fixed in v1.27.0.\n\n### Workarounds\nDo 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.\n\n### References\n- https://github.com/PrismJS/prism/pull/3341","status":"published","published":"2022-02-22T19:32:18Z","modified":"2023-02-03T05:06:26Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:36:43.439065Z"}],"nvd":[{"id":"CVE-2022-23647","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.","status":"published","published":"2022-02-18T15:15:07.74Z","modified":"2026-06-17T04:30:33.493Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high","assessor":"secondary"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:07:12.155838Z"}],"osv":[{"id":"CVE-2022-23647","title":"Cross-site Scripting in Prism","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.","status":"published","published":"2022-02-18T14:50:10Z","modified":"2026-10-28T02:30:43.403704306Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:24.061177Z"},{"id":"DEBIAN-CVE-2022-23647","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.","status":"published","published":"2022-02-18T15:15:07.74Z","modified":"2026-11-03T08:02:12.435564854Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T08:24:50.542442Z"},{"id":"GHSA-3949-f494-cm99","title":"Cross-site Scripting in Prism","description":"### Impact\nPrism's [Command line plugin](https://prismjs.com/plugins/command-line/) 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.\n\nServer-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted.\n\n### Patches\nThis bug has been fixed in v1.27.0.\n\n### Workarounds\nDo 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.\n\n### References\n- https://github.com/PrismJS/prism/pull/3341","status":"published","published":"2022-02-22T19:32:18Z","modified":"2023-11-08T04:08:26.360065Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:35.406455Z"},{"id":"UBUNTU-CVE-2022-23647","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.","status":"published","published":"2022-02-18T15:15:00Z","modified":"2025-10-24T04:53:29Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L","level":"high"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T16:53:53.13624Z"},{"id":"CLSA-2026-1793304056","title":"TuxCare security update for prismjs (6 CVEs)","description":"TuxCare rebuilt prismjs to address 6 CVEs. Fixed in 1.17.1-tuxcare.1.","status":"published","published":"2026-10-29T21:00:57Z","modified":"2026-10-30T02:15:07.694579967Z","updated_at":"2026-11-02T15:43:55.669514Z"},{"id":"ROOT-APP-NPM-CVE-2022-23647","title":"CVE-2022-23647 in prismjs - Patched by Root","description":"Root has patched CVE-2022-23647 in the prismjs package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-08-27T18:52:03Z","modified":"2026-08-27T19:30:04.027881283Z","updated_at":"2026-11-02T15:53:27.362922Z"}]}}
