Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. league/commonmark
  4. ›
  5. GHSA-mj63-m3rc-8ppr

GHSA-mj63-m3rc-8ppr: league/commonmark: Denial of service via deeply nested XML output

August 6, 2026

XmlRenderer pretty-prints XML by emitting depth-proportional indentation whitespace for every opening and closing tag. For a tree of depth n, the indentation alone sums to O(n²) bytes of output (and corresponding memory), reachable through MarkdownToXmlConverter — e.g. str_repeat('> ', $depth) . "x\n", a single line of nested blockquotes — or through a direct XmlRenderer::renderDocument() call on an attacker-influenced AST.

This affects applications that convert untrusted Markdown to XML, which is an opt-in output path. The parser’s max_nesting_level bounds the depth of parser-created trees, but its default is high enough to reach damaging sizes, can be raised by the host application, and does not constrain custom or programmatically built ASTs handed straight to the renderer. The result is a memory / output-size amplification rather than a hard crash, which is why this issue is rated Medium rather than High. No confidentiality or integrity impact. XML rendering was introduced in 2.0.0 (first shipped in 2.0.0-beta1, June 2021) and has emitted depth-proportional indentation ever since, so all 2.x releases are affected (verified against 2.8.x, clean upstream 1902f60f). 1.x has no XML renderer and is not affected.

References

  • github.com/advisories/GHSA-mj63-m3rc-8ppr
  • github.com/thephpleague/commonmark/commit/b5ac8c3947ca81844e85a09c7e0a5b4148bde2e1
  • github.com/thephpleague/commonmark/releases/tag/2.9.0
  • github.com/thephpleague/commonmark/security/advisories/GHSA-mj63-m3rc-8ppr

Code Behaviors & Features

Detect and mitigate GHSA-mj63-m3rc-8ppr 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.9.0

Fixed versions

  • 2.9.0

Solution

Upgrade to version 2.9.0 or above.

Impact 5.3 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-405: Asymmetric Resource Consumption (Amplification)

Source file

packagist/league/commonmark/GHSA-mj63-m3rc-8ppr.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 08 Aug 2026 00:19:02 +0000.