Vulnerability · Published Jan 14, 2022 · Assigned by GitHub_M
CVE-2022-21681Exponential catastrophic backtracking (ReDoS) in marked
High 7.5
In plain English
A high-severity uncontrolled resource consumption in marked from markedjs. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 2.7% (higher than 86% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-marked | 4.0.12+ds+~4.0.1-1 | DEBIAN-CVE-2022-21681 |
| Debian:13 | node-marked | 4.0.12+ds+~4.0.1-1 | DEBIAN-CVE-2022-21681 |
| Debian:14 | node-marked | 4.0.12+ds+~4.0.1-1 | DEBIAN-CVE-2022-21681 |
| Ubuntu:22.04:LTS | node-marked | no fix listed | UBUNTU-CVE-2022-21681 |
| Ubuntu:24.04:LTS | node-marked | no fix listed | UBUNTU-CVE-2022-21681 |
| Ubuntu:25.10 | node-marked | no fix listed | UBUNTU-CVE-2022-21681 |
| Ubuntu:26.04:LTS | node-marked | no fix listed | UBUNTU-CVE-2022-21681 |
| Ubuntu:26.10 | node-marked | no fix listed | UBUNTU-CVE-2022-21681 |
| npm | marked | 4.0.10 | GHSA-5v2h-r2cx-5xgj |
Affected products (as reported)
Weakness: CWE-400, CWE-1333 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H