CVE-2026-136615 in Commonmark
Summary
by MITRE • 11/25/2026
league/commonmark 2.6.0 before 2.10.8 contains a denial of service vulnerability in DelimiterStack::push() that miscounts delimiter runs against the max_delimiters_per_line budget. Attackers submitting Markdown with two long emphasis character runs can produce deeply nested strong elements, causing quadratic rendering time and CPU exhaustion.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/25/2026
The league/commonmark library is a widely adopted PHP implementation of the CommonMark specification, serving as the foundation for many content management systems and documentation platforms that process user-generated markdown text. A critical security flaw exists in versions prior to 2.10.8 within the DelimiterStack::push() method, which manages the parsing stack for inline elements such as emphasis and strong formatting. This vulnerability stems from an incorrect accounting mechanism when evaluating delimiter runs against a predefined budget of max_delimiters_per_line. The logic fails to accurately count or limit the number of delimiters processed in specific edge cases involving consecutive long sequences of emphasis characters, allowing attackers to bypass intended resource constraints during the parsing phase.
The technical exploitation of this flaw relies on submitting specially crafted markdown input containing two distinct runs of long emphasis characters, such as multiple asterisks or underscores. When the parser encounters these inputs, the miscounting in DelimiterStack::push() leads to an uncontrolled expansion of nested strong elements within the document object model. Instead of terminating early due to budget exhaustion, the parser continues to process and nest these delimiters deeply. This results in a quadratic increase in rendering time relative to the length of the input string. The computational complexity escalates rapidly as the depth of nesting increases, consuming excessive CPU cycles and memory resources on the server side during the parsing operation.
From an operational perspective, this vulnerability constitutes a significant denial-of-service risk for any application that processes untrusted markdown content without strict sanitization or rate limiting prior to rendering. An attacker can trigger resource exhaustion by sending relatively small but structurally complex payloads designed to exploit the quadratic time complexity. This can lead to service degradation, timeouts, or complete unavailability of the affected web services if multiple concurrent requests are launched against vulnerable instances. The impact is particularly severe in high-traffic environments where parsing performance is critical for user experience and system stability.
This issue aligns with CWE-400, which describes Uncontrolled Resource Consumption, as the application fails to properly limit the resources consumed by a single input string. In terms of attack patterns, it relates to ATT&CK technique T1496, Resource Hijacking, where an attacker uses limited computing resources to cause performance degradation or denial of service against targeted systems. To mitigate this vulnerability, organizations must immediately upgrade league/commonmark to version 2.10.8 or later, which contains the corrected logic for delimiter counting and budget enforcement. Additionally, implementing input validation layers that limit the length or complexity of incoming markdown content can provide an additional defense-in-depth measure against such parsing-based attacks until all systems are patched.