Summary
league/commonmark: Denial of service via deeply nested XML output
Workarounds
Applications converting untrusted Markdown to XML should:
- Lower
max_nesting_levelto a conservative value appropriate to expected content, so the parser refuses to build extremely deep trees. This is the most direct lever for parser-produced ASTs, but does not protect trees built programmatically and passed straight toXmlRenderer. - Cap input size before conversion, since the amplification is driven by input-proportional depth.
- Constrain XML consumers with memory / output-size limits (and streaming or size caps on any downstream XML parser or storage) so one request cannot allocate unbounded output.
- Prefer HTML rendering for untrusted content where XML is not strictly required, the HTML renderer does not emit depth-proportional indentation and is not subject to this amplification.
Impact
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.
GHSA-MJ63-M3RC-8PPR has a CVSS score of 5.3 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.9.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-MJ63-M3RC-8PPR? GHSA-MJ63-M3RC-8PPR is a medium-severity security vulnerability in league/commonmark (composer), affecting versions >= 2.0.0, < 2.9.0. It is fixed in 2.9.0.
- How severe is GHSA-MJ63-M3RC-8PPR? GHSA-MJ63-M3RC-8PPR has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of league/commonmark are affected by GHSA-MJ63-M3RC-8PPR? league/commonmark (composer) versions >= 2.0.0, < 2.9.0 is affected.
- Is there a fix for GHSA-MJ63-M3RC-8PPR? Yes. GHSA-MJ63-M3RC-8PPR is fixed in 2.9.0. Upgrade to this version or later.
- Is GHSA-MJ63-M3RC-8PPR exploitable, and should I be worried? Whether GHSA-MJ63-M3RC-8PPR is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-MJ63-M3RC-8PPR is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-MJ63-M3RC-8PPR? Upgrade
league/commonmarkto 2.9.0 or later.