CVE-2022-21670 Uncontrolled Resource Consumption in markdown-it
An attacker can cause significant performance degradation in markdown-it by submitting specially crafted long inputs, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-21670?
CVE-2022-21670 is a medium-severity denial of service vulnerability in markdown-it, published on 10 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
markdown-it is a Markdown parser. Prior to version 1.3.2, special patterns with length greater than 50 thousand characterss could slow down the parser significantly. Users should upgrade to version 12.3.2 to receive a patch. There are no known workarounds aside from upgrading.
Which versions are affected by CVE-2022-21670?
2 open source packages ship an affected version, including markdown-it. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
markdown-it npm | All versions | 12.3.2 |
markdown-it npm | All versions | 12.3.2 |
Products include Markdown-It Project Markdown-It.
How do I fix CVE-2022-21670?
Upgrade markdown-it to 12.3.2 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2022-21670 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-21670 exists.
Other vulnerabilities in markdown-it
- CVE-2026-2327 markdown-it is has a Regular Expression Denial of Service (ReDoS)
- CVE-2025-7969 Markdown-it 14.1.0 - Cross-site scripting (XSS)
- CVE-2026-48988 markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations
- CVE-2015-3295 Cross-site scripting in n/a
- CVE-2015-10005 markdown-it html_re.js redos
Sources
Also known as CLSA-2026-1773015255, CLSA-2026-1773620215, CLSA-2026-1789374715, CLSA-2026-1792369290, DEBIAN-CVE-2022-21670, GHSA-6vfc-qv3f-vr6c and 2 more.