Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify target exposing user-supplied Markdown with SmartPunct or Attributes extension
-
DeliveryCraft Markdown with thousands of unpaired apostrophes or contiguous attribute blocks
-
ExploitSubmit document via HTTP POST request
-
ExecutionTrigger O(n²) string-copy or sibling-scan loop in parser
-
PersistExhaust server CPU for tens of seconds per request
-
ImpactDeny service to legitimate users
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
|
| Exploitation Conditions | Exploitation requires that the target application explicitly instantiates and registers SmartPunctExtension or AttributesExtension (or both) on a league/commonmark Environment object - for example via Environment::addExtension(new SmartPunctExtension()) or new AttributesExtension(). Neither extension is enabled in CommonMarkConverter, GithubFlavoredMarkdownConverter, or GithubFlavoredMarkdownExtension; applications using only these standard converters are entirely unaffected and do not need to take action. Additionally, the attacker must be able to submit arbitrary Markdown input that reaches the parsing pipeline - such as a user-facing text editor, content submission API, or comment form. No authentication is required from the attacker's side (PR:N in the supplied CVSS 4.0 vector). Key limiting factors: the non-default extension registration requirement eliminates the majority of league/commonmark deployments; input submitted through channels that truncate content at a few kilobytes significantly raises the attacker's required effort. |
| Impact | The CVSS 4.0 base score of 8.7 (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N) accurately reflects a remotely exploitable, unauthenticated availability-only vulnerability with low attack complexity. However, the real-world risk is substantially conditional: both vulnerable code paths sit behind an explicit opt-in configuration step. Applications using CommonMarkConverter or GithubFlavoredMarkdownConverter - the library's most common integration patterns - are entirely unaffected. Only deployments that explicitly call Environment::addExtension(new SmartPunctExtension()) or AttributesExtension() are exposed. No EPSS score was provided in the input, and neither KEV listing nor public exploit code has been identified at time of analysis, so there is no confirmed active exploitation. The practical risk profile is therefore medium for the broader PHP ecosystem but high for the specific subset of applications that accept user-supplied Markdown and have opted into either extension - such as custom CMS renderers, documentation platforms, or comment systems built on league/commonmark with rich typography or attribute features enabled. The incomplete 2.9.0 fix for the AttributesExtension means any operator who upgraded specifically to address GHSA-g2gp-3wwq-f4ph (block-level issue) remains vulnerable and should treat this as a high-priority patch. |
| Exploit ScenarioDerived | An attacker targets a PHP application - such as a documentation platform or comment system - that uses league/commonmark with SmartPunctExtension enabled for typographic smart-quote rendering. The attacker submits a POST request containing a 1-2 MB Markdown document consisting of alternating plain text and apostrophes, requiring no account or authentication. The parser's ReplaceUnpairedQuotesListener fires repeatedly, each time re-copying the entire accumulated string buffer, consuming tens of seconds of CPU per request; a modest flood of such requests exhausts available CPU threads and renders the application unresponsive. No public exploit code or proof-of-concept tool has been identified, but the GHSA advisory provides sufficient reproduction detail for independent construction. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 07, 2026
Quadratic parsing complexity in league/commonmark (thephpleague/commonmark, versions ≥1.5.0 and <2.9.1) allows unauthenticated remote attackers to exhaust server CPU and cause denial of service by submitting small, specially crafted Markdown documents. Two non-default first-party extensions are affected: SmartPunctExtension, whose ReplaceUnpairedQuotesListener performs O(n²) string copying via AdjacentTextMerger on each unpaired quote node, and AttributesExtension, whose findTargetAndDirection() re-scans the entire sibling chain for every contiguous block-level Attributes node at O(n²/2) cost. Exploitation is conditional on the application explicitly registering either extension; all standard bundled converters are unaffected. Fixed in version 2.9.1, which also closes an incomplete AttributesExtension fix shipped in 2.9.0 for the related inline-variant issue GHSA-g2gp-3wwq-f4ph.
RemediationAI
Upgrade league/commonmark to version 2.9.1 or later, which contains fixes for both O(n²) code paths via commits 04a5d11ef6bf2d0b927310810d6a2a85d3c184b9 and 2f611b599c51661b005dc45c16ceaa547546e687. Operators who previously upgraded to 2.9.0 specifically to address GHSA-g2gp-3wwq-f4ph for the AttributesExtension block-level issue must upgrade again to 2.9.1, as the 2.9.0 fix was incomplete. If an immediate upgrade is not feasible, the most effective compensating control is to unregister or not register SmartPunctExtension and AttributesExtension from the Environment until the patch is applied; this fully eliminates the vulnerable code paths at the cost of losing smart-quote typography and HTML attribute injection features respectively. As a secondary control, impose input size limits on user-supplied Markdown before it reaches the parser - limiting input to a few kilobytes significantly increases the work required from an attacker, though this does not eliminate the vulnerability. Enabling max_delimiters_per_line for the SmartPunct case is specifically noted in the advisory to worsen rather than improve the issue and should not be relied upon as a mitigation. The full advisory is at https://github.com/thephpleague/commonmark/security/advisories/GHSA-jjv6-8j6v-6j52.
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 (composer package thephpleague/commonmark, CPE cpe:2.3:a:thephpleague:commonmark:*:*:*:*:*:*:*:*) is a widely used PHP Markdown parsing library implementing the CommonMark specification. The root cause is CWE-407 (Inefficient Algorithmic Complexity): two independent O(n²) code paths exist in opt-in extensions. In SmartPunctExtension (introduced in version 2.0.0), ReplaceUnpairedQuotesListener converts surviving unpaired Quote AST nodes back to Text nodes and calls AdjacentTextMerger, which reads, appends, and writes back the entire accumulated string literal on every merge iteration - causing the full buffer to be copied once per surviving quote node, yielding O(n²) memory traffic. A 1.2 MB alternating-apostrophe document takes 34.9 seconds versus 0.069 seconds without the extension. In AttributesExtension (introduced in version 1.5.0), AttributesListener::findTargetAndDirection() scans all remaining siblings for every block-level Attributes node targeting the following sibling; a contiguous run of k such nodes never triggers the early-exit guard (which checks for AttributesInline, not the block-level Attributes type), producing k(k-1)/2 comparisons. Sixteen thousand contiguous {#a} attribute blocks take 28.4 seconds and produce zero bytes of output. The GHSA advisory notes that max_delimiters_per_line hardening for SmartPunct makes exploitation worse by removing pairing work while leaving all nodes for the listener to process.
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
Attacker submits crafted HTTP input with no auth or interaction; only availability is impacted via CPU exhaustion, no C or I.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
The league/commonmark (thephpleague/commonmark) library in versions >= 1.5.0 and < 2.9.1 contains quadratic parsing complexity in its SmartPunctExtension and AttributesExtension. When either extension is explicitly registered on the Environment (they are not enabled by default and are excluded from the standard CommonMark and GitHub-Flavored Markdown converters), an unauthenticated attacker can submit small, specially crafted Markdown documents - such as text alternating with unpaired quotes, contiguous runs of block-level attribute blocks, or repeated class attributes - to trigger disproportionate CPU consumption and cause a denial of service. Fixed in 2.9.1.
Technical POC Analysis
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
Organizations relying on league/commonmark for user-generated Markdown content face service availability risk: specific optional extensions (SmartPunctExtension or AttributesExtension) create a denial-of-service vulnerability allowing unauthenticated remote attackers to crash web applications with minimal input. The vendor has released a patch, and immediate action is needed to prevent production incidents.
Apply vendor patch: upgrade to version 2.9.1 or later.
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 CPU exhaustion in league/commonmark 2.0.0-2.8.3 allows unauthenticated remote attackers to deny service by sub
Quadratic-time algorithmic complexity in league/commonmark's Attributes extension exposes PHP applications to remote den
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-72387
GHSA-7x8h-jg2x-pjm5
NVD
CVE.org
EPSS
Exploit-DB