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.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)2.7%top 14.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12node-marked4.0.12+ds+~4.0.1-1DEBIAN-CVE-2022-21681
Debian:13node-marked4.0.12+ds+~4.0.1-1DEBIAN-CVE-2022-21681
Debian:14node-marked4.0.12+ds+~4.0.1-1DEBIAN-CVE-2022-21681
Ubuntu:22.04:LTSnode-markedno fix listedUBUNTU-CVE-2022-21681
Ubuntu:24.04:LTSnode-markedno fix listedUBUNTU-CVE-2022-21681
Ubuntu:25.10node-markedno fix listedUBUNTU-CVE-2022-21681
Ubuntu:26.04:LTSnode-markedno fix listedUBUNTU-CVE-2022-21681
Ubuntu:26.10node-markedno fix listedUBUNTU-CVE-2022-21681
npmmarked4.0.10GHSA-5v2h-r2cx-5xgj

Affected products (as reported)

VendorProductVersions
markedjs marked < 4.0.10

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

References