Skip to content
Laskyr

league/commonmark security advisory

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

CVE-2026-30838 is a medium-severity XSS vulnerability in the PHP package league/commonmark (CVSS 6.1), published 7 March 2026. The advisory does not name a fixed version. It can be exploited without an account.

medium 6.1 published 2026-03-07 · updated 2026-06-17

The advisory does not name a fixed version

This XSS issue affects league/commonmark versions >= 2.0.0, <= 2.8.0. The newest release (2.10.7) is outside the affected range.

Affected versions
>= 2.0.0, <= 2.8.0
Fixed in
not stated
Newest release
2.10.7
Severity
Medium · CVSS 6.1
Type
Cross-site scripting (XSS)
CWE-79
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-04

Is your league/commonmark version affected?

Run composer show league/commonmark in your project, then enter the version. We check it against this and every other known league/commonmark advisory.

Who can exploit CVE-2026-30838

CVSS vector (scored by NVD): CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Your app is only exposed if it uses the affected part of league/commonmark. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-30838 in league/commonmark

  1. Find the installed version: composer show league/commonmark. If you never required it yourself, composer why league/commonmark shows which package pulls it in.
  2. Update it: composer update league/commonmark --with-all-dependencies.
  3. If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example "league/commonmark": "^2.10.7" if you can take that version), or upgrade the package that requires it.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-30838.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for XSS issues while the upgrade waits. None of it replaces the fix.

The CVE-2026-30838 advisory

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.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-30838. Advisory title: “CommonMark has DisallowedRawHtml extension bypass via whitespace in HTML tag names”.

References

Other league/commonmark advisories

Related

Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.

Ask about a fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit