Vulnerability · Published Mar 7, 2026 · Assigned by GitHub_M
CVE-2026-30838league/commonmark: DisallowedRawHtml extension bypass via whitespace in HTML tag names
Medium 5.1
In plain English
A medium-severity cross-site scripting in commonmark from thephpleague. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 16% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | php-league-commonmark | 2.3.9-1+deb12u1 | DEBIAN-CVE-2026-30838 |
| Debian:13 | php-league-commonmark | 2.7.0-1+deb13u1 | DEBIAN-CVE-2026-30838 |
| Debian:14 | php-league-commonmark | 2.8.1-1 | DEBIAN-CVE-2026-30838 |
| Packagist | league/commonmark | 2.8.1 | GHSA-4v6x-c7xx-hw9f |
| Ubuntu:25.10 | php-league-commonmark | no fix listed | UBUNTU-CVE-2026-30838 |
| Ubuntu:26.04:LTS | php-league-commonmark | no fix listed | UBUNTU-CVE-2026-30838 |
| Ubuntu:26.10 | php-league-commonmark | no fix listed | UBUNTU-CVE-2026-30838 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| thephpleague | commonmark | < 2.8.1 |
Weakness: CWE-79 · 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