ZeroHour

CVE-2026-86431

PoC large

XSS bypass in league/commonmark AttributesExtension via form-feed attribute prefix

CVSS 4.0
6.9 medium
EPSS
<1%p13
Published
()
Modified
AI analysis

CVE-2026-86431 is a cross-site scripting vulnerability in the PHP Markdown rendering library league/commonmark (versions 2.7.0 through 2.9.0) in which the AttributesExtension's event-handler and unsafe-link filtering can be bypassed by prefixing an attribute name with a single U+000C form feed byte, which PHP's trim() does not strip, so the attribute is written verbatim into the rendered HTML where browsers treat it as a genuine event handler. It is triggered whenever a server processes untrusted Markdown with the AttributesExtension enabled; the same trick also defeats the allow_unsafe_links check, letting javascript: URIs pass through href/src attributes. An attacker who can submit Markdown therefore gains arbitrary script execution in the browser of any user viewing the rendered page, which can lead to session theft or unauthorized actions in the hosting application. Anyone running a PHP application that renders user-supplied Markdown with league/commonmark versions 2.7.0 or newer but below 2.9.1 and the AttributesExtension enabled is affected. A public proof-of-concept and security advisory (GHSA-f8fg-pg57-v4j8) exist, but there is no confirmed in-the-wild exploitation: the flaw is not in CISA KEV and EPSS estimates only about a 0.2% chance of exploitation within 30 days.

What to do: Upgrade league/commonmark to version 2.9.1 or later, which restores correct attribute filtering. Until patched, disable the AttributesExtension for untrusted Markdown, or strip control characters (notably U+000C form feed) from user-supplied Markdown attribute names and validate href/src values to block javascript: URIs; audit whether your application registers AttributesExtension on user-provided input.

Affected
thephpleague commonmark (league/commonmark PHP Markdown library)>= 2.7.0 and < 2.9.1 (fixed in 2.9.1)
Estimated exposure
largeroughly 10,000 to 100,000 exposed PHP applications/sites (very large library install base, but the vulnerable path requires the optional AttributesExtension to… — league/commonmark is one of the most-installed PHP packages on Packagist with hundreds of millions of total downloads and use as a framework dependency, but only deployments that enable the optional AttributesExtension and render…

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

Description

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.

Vendors
thephpleague
Products
commonmark
Weakness
CWE-79
Vector
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/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.