Skip to main content
VulnerabilityPublished

league/commonmark: Denial of service via deeply nested XML output

Affects league/commonmarkSource GCVE Database

0

CVSS 5.3 Medium : upgrade to 2.9.0 when convenient.

Data as of 7 Aug 2026, 07:00 UTC

CVSS 3.1 base score
5.3Medium
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 2.9.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

What to do

Upgrade league/commonmark to 2.9.0.

Affected software

ProductAffectedFixed in
Packagistleague/commonmarkAffected
  • >=2.0.0 <2.9.0
Fixed in
  • 2.9.0

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

AI-suggested

A patch is available for this vulnerability. Applications converting untrusted Markdown to XML should lower the max_nesting_level parser setting to a conservative value to limit tree depth, cap input size before conversion, and constrain XML consumers with memory or output size limits. Prefer HTML rendering for untrusted content when XML output is not strictly required, as the HTML renderer does not exhibit this amplification. Since the vulnerability affects programmatically built ASTs passed directly to XmlRenderer, additional input validation or limiting such usage is recommended.

Description

The league/commonmark library's XmlRenderer component can cause a denial of service via excessive memory and output size when rendering deeply nested XML. This occurs because indentation whitespace grows quadratically with the depth of the XML tree, which can be triggered by deeply nested Markdown blockquotes or attacker-influenced ASTs. The vulnerability affects all 2.x versions from 2.0.0 up to but not including 2.9.0. There is no impact on confidentiality or integrity, only availability due to resource exhaustion. Mitigations include lowering the parser's max_nesting_level, capping input size, constraining XML consumers, or preferring HTML rendering for untrusted content. A patch is available.

References

Community reviews

Loading reviews…