CVE-2026-86431: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in thephpleague commonmark
Description
A cross-site scripting (XSS) vulnerability exists in thephpleague/commonmark versions 2.7.0 up to but not including 2.9.1. The flaw occurs in the AttributesExtension where a form feed character prefix in attribute names bypasses filtering, allowing malicious event handlers and javascript: URIs to be injected. This can lead to script execution when untrusted Markdown is rendered with the AttributesExtension enabled. The issue is fixed in version 2.9.1.
CVSS v4.0
Score 6.9medium
Affected software
thephpleague
commonmark
pkg:composer/thephpleague/commonmarkRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Thephpleague/commonmark versions >=2.7.0 and <2.9.1 contain a cross-site scripting vulnerability in the AttributesExtension. Specifically, prefixing an attribute name with a U+000C form feed character bypasses the AttributesHelper::filterAttributes() 'on*' event-handler filter because PHP's trim() function does not remove this character. This allows an attacker to inject event handlers (e.g., onclick) that execute arbitrary scripts. Additionally, the same prefix bypasses the allow_unsafe_links check, permitting javascript: URIs in href/src attributes even when unsafe links are disallowed. Exploitation requires processing untrusted Markdown with the AttributesExtension enabled, and the injected script executes upon rendering the HTML. The vulnerability is fixed in version 2.9.1.
Potential Impact
Successful exploitation allows an attacker to inject and execute arbitrary JavaScript in the context of the victim's browser when viewing rendered Markdown content. This can lead to typical XSS impacts such as session hijacking, defacement, or redirection. The vulnerability affects applications that process untrusted Markdown with the AttributesExtension enabled and do not sanitize input beyond the flawed filtering.
Mitigation Recommendations
Upgrade thephpleague/commonmark to version 2.9.1 or later, where this vulnerability is fixed. Until upgrading, avoid processing untrusted Markdown with the AttributesExtension enabled or implement additional input sanitization to block form feed characters in attribute names. No other official fixes or temporary mitigations are documented.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-09-07T12:34:31.457Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a9eb72cacd9273b49a9cf78
Added to database: 09/07/2026, 13:07:56 UTC
Last enriched: 10/09/2026, 21:25:24 UTC
Last updated: 10/22/2026, 13:15:24 UTC
Views: 87
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.