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 in the AttributesExtension. This flaw allows an attacker to bypass attribute filtering by prefixing attribute names with a form feed character, leading to unsafe event handlers and javascript: URIs being rendered in HTML. The vulnerability 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. The issue arises because prefixing an attribute name with a U+000C form feed byte bypasses the AttributesHelper::filterAttributes() 'on*' event-handler filter due to PHP's trim() function not removing this character. This allows malicious attributes such as event handlers (e.g., onclick) to be injected verbatim into the output HTML. Additionally, this prefix bypasses the allow_unsafe_links check, permitting javascript: URIs through href/src attributes even when unsafe links are disallowed. Exploitation requires processing untrusted Markdown with the AttributesExtension enabled, and the injected script executes when the rendered HTML is viewed. The vulnerability is fixed in version 2.9.1.
Potential Impact
Successful exploitation can lead to cross-site scripting attacks, allowing an attacker to execute arbitrary scripts in the context of the victim's browser when viewing rendered Markdown content. This can result in session hijacking, defacement, or other malicious actions depending on the script payload. The vulnerability affects unauthenticated users processing untrusted Markdown with the vulnerable versions and AttributesExtension enabled.
Mitigation Recommendations
Upgrade thephpleague/commonmark to version 2.9.1 or later, where this vulnerability is fixed. Until upgraded, avoid processing untrusted Markdown with the AttributesExtension enabled. Patch status is confirmed fixed in 2.9.1.
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: 09/15/2026, 01:10:13 UTC
Last updated: 10/07/2026, 06:48:19 UTC
Views: 80
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.