# CVE-2022-23647: Cross-site Scripting in Prism

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.48%, higher than 74% of CVEs (2026-11-30)
- Published: 2022-02-18T14:50:10.000Z
- Modified: 2026-06-17T04:30:33.493Z
- Also known as: GHSA-3949-f494-cm99
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- PrismJS prism: >= 1.14.0, < 1.27.0; from 1.14.0 before 1.27.0
- prismjs (npm): from 1.14.0 before 1.27.0

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://github.com/PrismJS/prism/security/advisories/GHSA-3949-f494-cm99> (third-party-advisory, web)
- <https://github.com/PrismJS/prism/pull/3341> (patch, third-party-advisory, web)
- <https://github.com/PrismJS/prism/commit/e002e78c343154e1c0ddf9d6a0bb85689e1a5c7c> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-23647> (advisory)
- <https://github.com/PrismJS/prism> (package)

## Sources

- CVE List: [CVE-2022-23647](https://www.cve.org/CVERecord?id=CVE-2022-23647), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-3949-f494-cm99](https://github.com/advisories/GHSA-3949-f494-cm99), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-23647](https://nvd.nist.gov/vuln/detail/CVE-2022-23647), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-23647 · Whole record: https://cve.day/CVE-2022-23647.json · Rebuilt by cve.day 2026-11-25T22:58:09.744Z
