GHSA-4V6X-C7XX-HW9F
Vulnerability from github – Published: 2026-03-06 23:27 – Updated: 2026-03-09 15:50Impact
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.
Patches
Fixed in 2.8.1. The regex character class [ \/>] was changed to [\s\/>] to match all whitespace characters that browsers accept as valid tag name terminators.
Workarounds
- Set the
html_inputconfiguration option to'escape'or'strip'to disable all raw HTML, though this is a broader restriction than theDisallowedRawHtmlextension provides. - Pass the rendered HTML through a dedicated HTML sanitizer before serving it to users (always recommended)
Resources
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.8.0"
},
"package": {
"ecosystem": "Packagist",
"name": "league/commonmark"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.8.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-30838"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-06T23:27:03Z",
"nvd_published_at": "2026-03-07T16:15:56Z",
"severity": "MODERATE"
},
"details": "### Impact\n\nThe `DisallowedRawHtml` extension can be bypassed by inserting a newline, tab, or other ASCII whitespace character between a disallowed HTML tag name and the closing `\u003e`. For example, `\u003cscript\\n\u003e` 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.\n\nAll 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.\n\n### Patches\n\nFixed in 2.8.1. The regex character class `[ \\/\u003e]` was changed to `[\\s\\/\u003e]` to match all whitespace characters that browsers accept as valid tag name terminators.\n\n### Workarounds\n\n- Set the `html_input` configuration option to `\u0027escape\u0027` or `\u0027strip\u0027` to disable all raw HTML, though this is a broader restriction than the `DisallowedRawHtml` extension provides.\n- Pass the rendered HTML through a dedicated HTML sanitizer before serving it to users ([always recommended](https://commonmark.thephpleague.com/2.x/security/#additional-filtering))\n\n### Resources\n\n- [CommonMark DisallowedRawHtml documentation](https://commonmark.thephpleague.com/extensions/disallowed-raw-html/)\n- [CWE-79: Improper Neutralization of Input During Web Page Generation](https://cwe.mitre.org/data/definitions/79.html)\n- [CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)](https://cwe.mitre.org/data/definitions/80.html)",
"id": "GHSA-4v6x-c7xx-hw9f",
"modified": "2026-03-09T15:50:47Z",
"published": "2026-03-06T23:27:03Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/thephpleague/commonmark/security/advisories/GHSA-4v6x-c7xx-hw9f"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-30838"
},
{
"type": "WEB",
"url": "https://commonmark.thephpleague.com/extensions/disallowed-raw-html"
},
{
"type": "PACKAGE",
"url": "https://github.com/thephpleague/commonmark"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "CommonMark has DisallowedRawHtml extension bypass via whitespace in HTML tag names"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.