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.

Severity (CVSS 4.0)5.1Medium
Exploit odds (30 days)0.2%top 84.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12php-league-commonmark2.3.9-1+deb12u1DEBIAN-CVE-2026-30838
Debian:13php-league-commonmark2.7.0-1+deb13u1DEBIAN-CVE-2026-30838
Debian:14php-league-commonmark2.8.1-1DEBIAN-CVE-2026-30838
Packagistleague/commonmark2.8.1GHSA-4v6x-c7xx-hw9f
Ubuntu:25.10php-league-commonmarkno fix listedUBUNTU-CVE-2026-30838
Ubuntu:26.04:LTSphp-league-commonmarkno fix listedUBUNTU-CVE-2026-30838
Ubuntu:26.10php-league-commonmarkno fix listedUBUNTU-CVE-2026-30838

Affected products (as reported)

VendorProductVersions
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

References