# CVE-2026-49851: lepture Mistune CPU exhaustion DoS in parse_link_text

Source: https://junglewise.ai/threats/cve-2026-49851-lepture-mistune-cpu-exhaustion-dos-in-parse-link-text  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-24. Updated: 2026-07-10  
License: CC BY 4.0 with a link back

CVE-2026-49851 · Severity: high · CVSS 7.5 · Published 2026-06-24

Mistune, a popular Python library for parsing Markdown text, is vulnerable to a denial-of-service (DoS) flaw. An attacker can provide a specially crafted Markdown snippet—such as a long string of opening brackets—that causes the library to consume excessive CPU resources. This can lead to application slowdowns or complete service outages for web platforms that process user-generated content like comments or documentation.

Technologies: [mistune (PyPI)](https://junglewise.ai/threats/technologies/mistune). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-49851 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-49851 being exploited in the wild.

**How severe is CVE-2026-49851?** High severity, with a CVSS score of 7.5, published 24 June 2026.

**Which products and versions are affected?** mistune (PyPI) < 3.3.0, ECOSYSTEM:introduced=0,fixed=3.3.0.

**Is there a fix for CVE-2026-49851?** Yes. mistune (PyPI): upgrade to 3.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-49851 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-49851?** Check whether you run mistune (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- mistune (PyPI): upgrade to 3.3.0 or later

  ```sh
  pip install "mistune>=3.3.0"
  ```


## Technical details

A denial-of-service vulnerability exists in Mistune's inline parser due to inefficient handling of link text. The root cause is a nested loop interaction between `InlineParser.parse()` and `parse_link_text()`: the outer loop advances only one character at a time when a link match fails, while the inner loop performs a full linear scan for a closing bracket. When processing a string with many consecutive '[' characters, this results in O(n²) quadratic-time complexity. An unauthenticated remote attacker can exploit this by submitting a small (~6 KB) Markdown payload to trigger high CPU utilization. The issue is fixed in version 3.3.0 by ensuring the parser skips ahead to the furthest scanned position after a failed match.

## Affected products

- lepture mistune < 3.3.0

## Identifiers

- CVE-2026-49851
- GHSA-qcq2-496w-v96p
- PYSEC-2026-2652

## Timeline

- 2026-06-21: disclosed
- 2026-06-24: advisory: NVD publication
- 2026-07-09: patched: GitHub Advisory reviewed and updated with patch version 3.3.0

## References

- [https://api.github.com/users/bhanugoudm041](https://api.github.com/users/bhanugoudm041)
- [https://github.com/bhanugoudm041](https://github.com/bhanugoudm041)
- [https://api.github.com/users/bhanugoudm041/gists%7B/gist_id%7D](https://api.github.com/users/bhanugoudm041/gists%7B/gist_id%7D)
- [https://api.github.com/users/bhanugoudm041/repos](https://api.github.com/users/bhanugoudm041/repos)
- [https://avatars.githubusercontent.com/u/92798414?v=4](https://avatars.githubusercontent.com/u/92798414?v=4)
- [https://api.github.com/users/bhanugoudm041/events%7B/privacy%7D](https://api.github.com/users/bhanugoudm041/events%7B/privacy%7D)

## Related threats

- [Mistune path traversal and XSS in Include directive](https://junglewise.ai/threats/duplicate-advisory-mistune-path-traversal-and-xss-in-include-directive-bf25c187)
- [Mistune path traversal and XSS in Include directive](https://junglewise.ai/threats/cve-2026-115355-mistune-before-3-3-0-contains-a-path-traversal-vulnerability-in)
- [Mistune uncontrolled recursion in HTML rendering](https://junglewise.ai/threats/cve-2026-76098-mistune-uncontrolled-recursion-in-html-rendering)
- [lepture Mistune predictable ID generation in TOC plugin](https://junglewise.ai/threats/cve-2026-59930-lepture-mistune-predictable-id-generation-in-toc-plugin)
- [lepture mistune XSS via incomplete URL scheme filtering in HTML renderer](https://junglewise.ai/threats/cve-2026-59929-lepture-mistune-xss-via-incomplete-url-scheme-filtering-in-html)
