CVE-2022-23647Cross-site Scripting in Prism
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.
What to do
Fixed builds are available from Debian, npm: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | node-prismjs | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | node-prismjs | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | node-prismjs | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | node-prismjs | Under investigation | UBUNTU-CVE-2022-23647 | |
| Ubuntu 20.04 | node-prismjs | Fix pending | UBUNTU-CVE-2022-23647 | |
| Debian 14 | node-prismjs | Fixed | 1.27.0+dfsg+~1.26.0-1 | DEBIAN-CVE-2022-23647 |
| Debian 13 | node-prismjs | Fixed | 1.27.0+dfsg+~1.26.0-1 | DEBIAN-CVE-2022-23647 |
| Debian 12 | node-prismjs | Fixed | 1.27.0+dfsg+~1.26.0-1 | DEBIAN-CVE-2022-23647 |
| Red Hat Enterprise Linux 9 | grafana | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-azure-monitor | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-cloudwatch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-elasticsearch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-graphite | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-influxdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-loki | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mssql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mysql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-opentsdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-postgres | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-prometheus | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-stackdriver | Not affected | ||
| npm library | prismjs | Fixed | 1.27.0 | GHSA-3949-f494-cm99 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- PrismJS prism: affected: >= 1.14.0, < 1.27.0
References
- https://github.com/PrismJS/prism/security/advisories/GHSA-3949-f494-cm99
- https://github.com/PrismJS/prism/pull/3341
- https://github.com/PrismJS/prism/commit/e002e78c343154e1c0ddf9d6a0bb85689e1a5c7c
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.