CVE-2026-30838
league/commonmark: DisallowedRawHtml extension bypass via whitespace in HTML tag names
Reported by github_m · Published March 7, 2026
league/commonmark is fixed in 2.8.1 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| league/commonmark | Packagist | 2.8.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| thephpleague | commonmark | < 2.8.1 |
| thephpleague | commonmark | 0 |
| league | commonmark | 2.0.0 |
Timeline
- Mar 6, 2026 CVE Published
- Mar 7, 2026 PoC Published (2 in total, the first dated here)
- Mar 8, 2026 EPSS Score (30 in total, the first dated here)
- Mar 9, 2026 CVE Updated
- Mar 17, 2026 Coalition ESS Score (2 in total, the first dated here)
- Mar 23, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-30838
vulnetix vdb fixes CVE-2026-30838
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-30838/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/thephpleague/commonmark/security/advisories/GHSA-4v6x-c7xx-hw9f x_refsource_CONFIRM
- https://nvd.nist.gov/vuln/detail/CVE-2026-30838 advisory
- https://github.com/advisories/GHSA-4v6x-c7xx-hw9f advisory
- https://commonmark.thephpleague.com/extensions/disallowed-raw-html url
- https://github.com/thephpleague/commonmark url