Restrict Markdown Inputs to Prevent CPU Exhaustion in Mistune Library
Attackers can trigger quadratic parsing complexity in vulnerable Mistune versions, consuming server resources with small, crafted requests.

Key points
- Mistune versions before 3.3.0 contain an algorithmic complexity denial of service flaw.
- The vulnerability exists in the parse_link_text function within src/mistune/helpers.py.
- Deeply nested square brackets in markdown trigger excessive CPU usage during parsing.
Application servers running vulnerable versions of the Mistune library face immediate resource exhaustion risks. The flaw allows unauthenticated attackers to submit small, crafted markdown payloads that trigger quadratic parsing time. This specific behavior exhausts server CPU capacity, leading to service degradation or complete denial of service for legitimate users.
The risk
The vulnerability is tracked as CVE-2026-115349 and carries a CVSS score of 8.7, categorized as high severity. According to the National Vulnerability Database, the root cause is an algorithmic complexity issue in the parse_link_text function. Attackers exploit this by submitting markdown content containing deeply nested square brackets. The parser processes these structures inefficiently, causing quadratic parsing time relative to input size.
Who is exposed
Any application using the Mistune library from version 3.0.0 up to but not including 3.3.0 is affected. The library is maintained by lepture. Systems that accept user-generated markdown input without strict length or complexity validation are particularly vulnerable. This includes documentation platforms, issue trackers, and content management systems that rely on Mistune for rendering user-submitted text.
Cost and compliance
The source material does not provide specific financial impact figures or compliance mandates. However, the high CVSS score indicates significant potential for service disruption. Organizations relying on affected services may face operational downtime if attackers successfully exploit the quadratic parsing behavior. No specific regulatory citations are mentioned in the advisory records provided.
Our take on the response
Teams should prioritize identifying all instances of the Mistune library in their infrastructure. Since the flaw is triggered by input complexity rather than payload size, standard size limits may not prevent exploitation. Immediate validation of library versions is essential to determine exposure scope before mitigation efforts begin.
What defenders should look for
Security operations teams should monitor for sudden spikes in CPU utilization on servers handling markdown rendering. Look for patterns where small requests correlate with disproportionate processing delays. Check application logs for repeated parsing errors or timeouts associated with link text processing. Implement rate limiting on endpoints accepting markdown input to mitigate impact while investigating. Verify that input validation rules reject excessively nested structures.
Background: Input validation
Implement strict allowlists for all external data, enforce type and length constraints, and decode inputs before validation. Reject anything that does not match the exact expected format. This prevents injection attacks and buffer overflows by ensuring only safe, predictable data enters your processing logic.
Read the full guide: Input Validation Best Practices to Stop Exploits at the Edge
What to do and how to stay safe: Mistune
- Audit application dependencies to identify any use of Mistune versions prior to 3.3.0.
- Implement strict input validation to reject markdown with excessive nesting depth.
- Monitor server CPU metrics for anomalous spikes during markdown rendering operations.
- Apply rate limiting to public-facing endpoints that accept user-generated markdown content.
Step-by-step guide: Unpatched Software Response: Containment, Recovery, and Prevention Steps
General security guidance from the BlueTeam Herald newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
Which specific function contains the vulnerability?
The vulnerability is located in the parse_link_text function within the src/mistune/helpers.py file.
What is the CVSS score for this vulnerability?
The National Vulnerability Database rates CVE-2026-115349 with a CVSS score of 8.7.
Which versions of Mistune are affected?
Versions of Mistune from 3.0.0 up to, but not including, 3.3.0 are affected by this flaw.



