CVE-2026-30838

league/commonmark: DisallowedRawHtml extension bypass via whitespace in HTML tag names

Published Mar 7, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
league/commonmark is a PHP Markdown parser. Prior to version 2.8.1, the DisallowedRawHtml extension can be bypassed by inserting a newline, tab, or other ASCII whitespace character between a disallowed HTML tag name and the closing >. For example, <script\n> would pass through unfiltered and be rendered as a valid HTML tag by browsers. This is a cross-site scripting (XSS) vector for any application that relies on this extension to sanitize untrusted user input. All applications using the DisallowedRawHtml extension to process untrusted markdown are affected. Applications that use a dedicated HTML sanitizer (such as HTML Purifier) on the rendered output are not affected. This issue has been patched in version 2.8.1.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4v6x-c7xx-hw9f CommonMark has DisallowedRawHtml extension bypass via whitespace in HTML tag names
Ubuntu USN Ubuntu USN USN-8194-1 league/commonmark vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:thephpleague:commonmark:*:*:*:*:*:*:*:*
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Thephpleague
Thephpleague commonmark
Vendors & Products Thephpleague
Thephpleague commonmark
Type Values Removed Values Added
Description league/commonmark is a PHP Markdown parser. Prior to version 2.8.1, the DisallowedRawHtml extension can be bypassed by inserting a newline, tab, or other ASCII whitespace character between a disallowed HTML tag name and the closing >. For example, <script\n> would pass through unfiltered and be rendered as a valid HTML tag by browsers. This is a cross-site scripting (XSS) vector for any application that relies on this extension to sanitize untrusted user input. All applications using the DisallowedRawHtml extension to process untrusted markdown are affected. Applications that use a dedicated HTML sanitizer (such as HTML Purifier) on the rendered output are not affected. This issue has been patched in version 2.8.1.
Title league/commonmark: DisallowedRawHtml extension bypass via whitespace in HTML tag names
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 9, 2026, 6:26 PM
Reserved
Mar 5, 2026, 9:06 PM
Status
Analyzed
Published
Mar 7, 2026, 4:15 PM
Modified
Jun 17, 2026, 10:33 AM