Skip to main content
VulnerabilityPublished Updated

CVE-2026-30838: thephpleague commonmark · Cross-site Scripting

Affects thephpleague commonmarkSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 5.1 Medium : upgrade to 2.8.1 when convenient.

Data as of 30 Oct 2026, 11:52 UTC

CVSS 4.0 base score
5.1Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.2% chance of exploitation in 30 days – higher than 13% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 2.8.1
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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 7 Mar 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade commonmark and thephpleague/commonmark to 2.8.1.

Affected software

ProductAffectedFixed in
thephpleaguecommonmarkAffected
  • <2.8.1
Fixed in
  • 2.8.1
Packagistthephpleague/commonmarkpkg:composer/thephpleague/commonmarkOther threatsAffected
  • <2.8.1
Fixed in
  • 2.8.1

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

  1. Upgrade thephpleague commonmark library to version 2.8.1 or later, where the vulnerability is patched.
  2. If immediate upgrade is not feasible, implement additional HTML sanitization on the rendered output using robust libraries such as HTML Purifier to neutralize any malicious tags or scripts.
  3. Review and audit all markdown processing workflows to identify usage of the DisallowedRawHtml extension and ensure untrusted input is properly sanitized.
  4. Employ Content Security Policy (CSP) headers to restrict script execution and reduce the impact of potential XSS attacks.
  5. Educate developers and content contributors about safe markdown usage and the risks of embedding raw HTML.
  6. Monitor application logs and user reports for suspicious activity indicative of attempted XSS exploitation.
  7. Conduct security testing, including fuzzing and penetration testing, focused on markdown input handling to detect similar bypasses. These steps provide layered defense beyond the vulnerable extension and reduce the attack surface.

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.

References

Community reviews

Loading reviews…