Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted HTTP request with Markdown body
-
DeliveryDocument contains K empty or identical ATX headings
-
ExploitRegistered HeadingPermalinkExtension or FootnoteExtension invokes UniqueSlugNormalizer on each heading
-
ExecutionNormalizer performs O(K²) array lookups due to restart-from-1 collision logic
-
PersistPHP worker process CPU exhausted
-
ImpactService denied to legitimate users
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
|
| Exploitation Conditions | Exploitation requires that at least one of three extensions is registered in the target's league/commonmark environment: HeadingPermalinkExtension (direct), FootnoteExtension (via anonymous footnote ^[label] syntax), or TableOfContentsExtension (which implicitly requires HeadingPermalinkExtension). These extensions are not registered by default - integrators must explicitly add them to the environment. The attacker must additionally control Markdown content that reaches the parser, such as through a user-facing editor, documentation site, forum, or API accepting untrusted Markdown input. Exploitation is limited to availability impact only; no confidentiality or integrity breach is possible through this vector. Installations that process only trusted Markdown authored by developers or administrators, or that do not register any of the three affected extensions, are not at risk. |
| Impact | CVSS 4.0 scores this 8.7 (AV:N/AC:L/AT:N/PR:N/UI:N/VA:H), reflecting unauthenticated network exploitation with high availability impact; the vendor's AT:N choice implies they regard the required extension configuration as sufficiently common to warrant no attack-requirement modifier, though an argument for AT:P exists given the extensions are explicitly opt-in. No KEV listing and no confirmed public exploit code exist; however, the GHSA advisory provides sufficient technical detail that the attack is trivially reproducible using empty ATX headings alone, making 'no public exploit' a thin distinction in practice. EPSS data is not provided in the source intelligence. The O(K²) complexity makes exploitation efficiently automatable - doubling heading count quadruples CPU cost - meaning even a mid-sized municipal IT team in boleslawiec operating a documentation or CMS platform with heading-permalink or TOC features enabled should treat this as urgent given how little attacker effort is required. The impact is strictly availability; no confidentiality or integrity risk exists through this vector, which bounds the worst-case outcome to service disruption rather than data breach. |
| Exploit ScenarioDerived | An attacker submits an HTTP request containing a Markdown body composed of hundreds or thousands of empty ATX heading lines (lines consisting solely of '#' characters) to a documentation platform, CMS, or API endpoint that renders untrusted Markdown using league/commonmark with HeadingPermalinkExtension or FootnoteExtension registered. Every empty heading normalizes to the same base slug, causing UniqueSlugNormalizer to perform O(K²) comparisons - a 1,000-heading document triggers approximately 500,000 array lookups, consuming significant CPU time and hanging or crashing the rendering worker. No exploit tooling beyond a crafted text file is required. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 07, 2026
Quadratic CPU exhaustion in league/commonmark 2.0.0-2.8.3 allows unauthenticated remote attackers to deny service by submitting Markdown documents that force many headings onto the same base slug. UniqueSlugNormalizer::normalize() restarts its numeric-suffix search from 1 on every slug collision, producing O(K²) comparisons for K colliding slugs - enabling a small, crafted document to consume seconds of CPU time. No public exploit code has been confirmed, but the attack is trivially constructible from the GHSA advisory description alone, and no authentication is required against any endpoint that renders attacker-controlled Markdown.
RemediationAI
Upgrade league/commonmark to version 2.9.0 or later via Composer (composer require league/commonmark:^2.9); this release removes the quadratic behavior entirely while preserving unique heading anchor IDs and producing identical rendered output, per the GHSA advisory at https://github.com/thephpleague/commonmark/security/advisories/GHSA-mh25-x5hq-wrqp. For integrators who cannot upgrade immediately, three workarounds are available, each with trade-offs: (1) set configuration key slug_normalizer/unique to false or UniqueSlugNormalizerInterface::DISABLED to disable de-duplication scanning entirely - this eliminates the quadratic path but means colliding headings will share the same anchor ID, breaking in-page navigation; (2) disable HeadingPermalinkExtension, TableOfContentsExtension (which depends on it), and FootnoteExtension for any pipeline that accepts untrusted Markdown input - this removes the affected functionality entirely; or (3) enforce an upstream cap on document size or heading count before the document reaches the parser, preventing K from growing large enough to reach the quadratic danger zone, though this requires tuning to balance usability against safety. Upgrading to 2.9.0 is the only option that avoids functional regression.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in composer, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
league/commonmark (CPE: cpe:2.3:a:thephpleague:commonmark) is a specification-compliant PHP Markdown parser maintained by The PHP League and distributed via Composer. The root cause is CWE-407 (Inefficient Algorithmic Complexity): UniqueSlugNormalizer::normalize() - introduced in 2.0.0-beta1, May 2021 - ensures heading anchor IDs are document-unique by appending an incrementing numeric suffix on collision. However, the implementation restarts its search counter from 1 on each collision attempt rather than advancing from the previously established maximum, producing Σ(k−1) = O(K²) array lookups for K headings sharing the same base slug. The vulnerable code path is activated whenever HeadingPermalinkExtension (which runs HeadingPermalinkProcessor over every heading), FootnoteExtension (whose AnonymousFootnoteRefParser normalizes every anonymous ^[label] reference), or TableOfContentsExtension (which co-requires HeadingPermalinkExtension) is registered. The default slug_normalizer/unique setting of PER_DOCUMENT accumulates collisions across the entire document. The 1.x branch used a simpler slug generator without de-duplication and is not affected.
Know when Commonmark gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-accessible unauthenticated DoS via CPU exhaustion; AC:L because required extensions are commonly enabled and attack imposes no timing constraint; availability-only impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
league/commonmark versions >= 2.0.0 and < 2.8.4 (patched in 2.9.0) contain a denial of service vulnerability in UniqueSlugNormalizer::normalize(), which restarts its numeric-suffix search from 1 on every slug collision, resulting in O(K^2) time complexity for K headings that collapse to the same base slug. The vulnerable path is reached when HeadingPermalinkExtension, FootnoteExtension, or TableOfContentsExtension is registered. An unauthenticated attacker can force many headings onto a single base slug (e.g., via empty ATX headings, identical heading text, or punctuation-only headings) in a small Markdown document, consuming excessive CPU and denying service.
Technical POC Analysis
The flaw is CWE-407, inefficient algorithmic complexity.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
The PHP Markdown rendering library league/commonmark (versions 2.0.0-2.8.3) contains a computational complexity vulnerability allowing unauthenticated attackers to trigger severe denial-of-service conditions against applications that render user-supplied Markdown content. A single crafted Markdown document can consume seconds of CPU time, risking platform unavailability. Organizations using league/commonmark for public-facing Markdown rendering face immediate operational risk.
Implement input validation: enforce 10 KB document size maximum and 50-heading-per-document limit on all Markdown rendering endpoints. Deploy per-IP rate limiting (10 requests per minute maximum) and CPU monitoring with alerting on rendering threads. Isolate Markdown processing to resource-constrained containers with CPU throttling to 20-30% of available cores. For high-value content, prefer static Markdown or pre-compiled rendering over runtime processing of user input. Maintain logging of all Markdown rendering requests with document complexity metrics for incident investigation.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
More in Commonmark
View allCross-site scripting (XSS) vulnerability in the PHP League CommonMark library before 0.18.3 allows remote attackers to i
Cross-site scripting (XSS) vulnerability in the PHP League CommonMark library versions 0.15.6 through 0.18.x before 0.18
Quadratic-time algorithmic complexity in league/commonmark's Attributes extension exposes PHP applications to remote den
Quadratic parsing complexity in league/commonmark (thephpleague/commonmark, versions ≥1.5.0 and <2.9.1) allows unauthent
Three independent super-linear parsing paths in league/commonmark before 2.9.1 allow unauthenticated remote attackers to
Quadratic-blowup denial of service in league/commonmark's Footnote extension allows remote unauthenticated attackers to
Quadratic CPU exhaustion in league/commonmark's optional AttributesExtension (versions 1.5.0 through 2.9.2) allows unaut
Quadratic-time denial of service in league/commonmark 2.0.0 through 2.10.1 lets unauthenticated remote attackers exhaust
Quadratic memory and output amplification in league/commonmark's XmlRenderer affects all 2.x releases from 2.0.0 through
Cross-site scripting in league/commonmark 2.7.0-2.9.0 allows unauthenticated attackers to inject arbitrary JavaScript in
The DisallowedRawHtml extension in PHP Commonmark (league/commonmark) versions prior to 2.8.1 can be bypassed by injecti
Stored cross-site scripting in league/commonmark from 1.3.0 through 2.10.1 lets any user who can post Markdown bypass th
EUVD-2026-72392
GHSA-jcmh-chhq-rh2x
NVD
CVE.org
EPSS
VulDB
Exploit-DB