Skip to content
OpenAdvisories
Medium · 5.1 CVE-2026-30838 EUVD-2026-10168GHSA-4v6x-c7xx-hw9f

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

Published Mar 7, 2026 · Updated Mar 9, 2026 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
thephpleague commonmark < 2.8.1 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 php-league-commonmark 2.8.1-1 —
Debian 13 php-league-commonmark 2.7.0-1+deb13u1 —
Debian 12 php-league-commonmark 2.3.9-1+deb12u1 —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 php-league-commonmark No fix yet —
Ubuntu 26.04 LTS php-league-commonmark No fix yet —
Ubuntu 25.10 php-league-commonmark No fix yet —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS php-league-commonmark 2.4.2-2ubuntu0.1~esm1 USN-8194-1
Ubuntu Pro 22.04 LTS php-league-commonmark 1.6.7-1ubuntu0.1~esm1 USN-8194-1
Ubuntu Pro 20.04 LTS php-league-commonmark 1.3.1-1ubuntu2+esm1 USN-8194-1

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist league/commonmark >= 2.0.0, < 2.8.1 2.8.1 GHSA-4v6x-c7xx-hw9f

Advisories 2

References