Intel

AIKIDO-2026-261475

league/commonmark is vulnerable to Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS)GHSA-97jj-33gv-5xf9 Published 2 days ago

61

Medium Risk

This Affects:

PHPleague/commonmark
1.3.0 - 2.10.1
Fixed in 2.10.2
Are you affected? Scan for Free

TL;DR

The DisallowedRawHtmlRenderer filter uses a regex that requires a character after a disallowed tag name, so a raw HTML line containing only a bare tag name such as <script passes through unescaped. The GFM block parser opens an HTML block on that bare tag name with no trailing newline for the regex to match, and the next block's raw HTML is then interpreted by the browser as that tag's attributes. Anyone who can submit Markdown rendered with the shipped GFM defaults can use this to achieve stored XSS. The fix widens the regex to also match a disallowed tag name at the end of the string.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you use the DisallowedRawHtml extension, enabled by default in GithubFlavoredMarkdownConverter, to render Markdown from untrusted sources.

Background info

league/commonmark is vulnerable to Cross-Site Scripting (XSS) in versions 1.3.0 - 2.10.1.

How to fix this

Upgrade the league/commonmark library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform