ZeroHour

CVE-2024-58382

mass

Polynomial-time parsing DoS in league/commonmark PHP Markdown library

CVSS 4.0
8.7 high
EPSS
<1%p20
Published
()
Modified
AI analysis

league/commonmark, a widely used PHP Markdown parsing library, contains polynomial time complexity flaws (CWE-407) in its Markdown parser that let crafted input drive parsing cost toward worst-case performance. An attacker who can submit Markdown that the application then parses — via comment forms, CMS content fields, or APIs that render user Markdown — can trigger this with unauthenticated network requests (CVSS 4.0: AV:N/PR:N/UI:N, availability-only impact). By sending multiple crafted requests in parallel, the attacker can exhaust CPU resources and the PHP-FPM worker pool, causing denial of service for the host application. All applications bundling any league/commonmark release before 2.6.0 that parse attacker-controlled Markdown are affected, including where the library is a transitive dependency. There is no CISA KEV entry and no known public proof-of-concept, and exploitation has not been observed in the wild.

What to do: Upgrade league/commonmark to 2.6.0 or later, checking composer.lock and the full dependency tree since it is frequently pulled in transitively rather than declared directly. Until patched, length-limit or restrict untrusted Markdown input and rate-limit or cap concurrent parse-heavy requests to protect the PHP-FPM worker pool. Prioritize reviewing internet-facing endpoints that render user-supplied Markdown, as no in-the-wild exploitation has yet been reported.

Affected
league commonmarkall versions before 2.6.0
Estimated exposure
massmillions of PHP deployments bundle the library (tens of millions of Packagist downloads; the directly internet-exposed subset is unknown) — league/commonmark is a ubiquitous PHP Markdown library pulled in by major frameworks and CMS packages (e.g., Laravel bundles it for Markdown mail rendering), giving tens of millions of cumulative installs, though only internet-facing…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

league/commonmark versions before 2.6.0 contain polynomial time complexity vulnerabilities in Markdown parsing that allow attackers to cause denial of service. Attackers can submit carefully crafted Markdown inputs designed to trigger worst-case performance, and sending multiple requests in parallel exhausts CPU resources and PHP-FPM processes.

Weakness
CWE-407
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.