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

High 7.5 Published Updated

Attackers can cause denial of service in applications using the marked library by submitting crafted markdown strings that trigger catastrophic backtracking.

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-21681?

CVE-2022-21681 is a high-severity denial of service vulnerability in Fedoraproject Fedora, published on 14 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-400, CWE-1333

Which versions are affected by CVE-2022-21681?

2 open source packages ship an affected version, including marked. It affects 2 products.

PackageAffectedFixed in
marked npmAll versions4.0.10
marked npmAll versions4.0.10

Products include Fedoraproject Fedora, Marked Project Marked.

How do I fix CVE-2022-21681?

Upgrade marked to 4.0.10 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-21681 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-21681 exists.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as CLSA-2026-1791584939, DEBIAN-CVE-2022-21681, GHSA-5v2h-r2cx-5xgj, ROOT-APP-NPM-CVE-2022-21681, UBUNTU-CVE-2022-21681.

Is CVE-2022-21681 in your software?

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

Check your SBOMs for free