Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. league/commonmark
  4. ›
  5. CVE-2026-30838

CVE-2026-30838: CommonMark has DisallowedRawHtml extension bypass via whitespace in HTML tag names

March 6, 2026 (updated March 20, 2026)

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.

References

  • commonmark.thephpleague.com/extensions/disallowed-raw-html
  • github.com/advisories/GHSA-4v6x-c7xx-hw9f
  • github.com/thephpleague/commonmark
  • github.com/thephpleague/commonmark/security/advisories/GHSA-4v6x-c7xx-hw9f
  • nvd.nist.gov/vuln/detail/CVE-2026-30838

Code Behaviors & Features

Detect and mitigate CVE-2026-30838 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0.0 before 2.8.1

Fixed versions

  • 2.8.1

Solution

Upgrade to version 2.8.1 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

packagist/league/commonmark/CVE-2026-30838.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 24 Mar 2026 12:17:18 +0000.