CVE-2022-21670 Uncontrolled Resource Consumption in markdown-it

Medium 5.3 Published Updated

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.

Weakness: CWE-1333, CWE-400

Which versions are affected by CVE-2022-21670?

2 open source packages ship an affected version, including markdown-it. It affects 1 product.

PackageAffectedFixed in
markdown-it npmAll versions12.3.2
markdown-it npmAll versions12.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.

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.

Is CVE-2022-21670 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free