# CVE-2026-59925: Mistune denial of service via quadratic emphasis parsing

Source: https://junglewise.ai/threats/cve-2026-59925-mistune-denial-of-service-via-quadratic-emphasis-parsing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-08. Updated: 2026-07-20  
License: CC BY 4.0 with a link back

CVE-2026-59925 · Severity: high · CVSS 7.5 · Published 2026-07-08

Mistune is a popular Python library used to convert Markdown text into HTML. A vulnerability in its parsing engine allows an attacker to submit specially crafted text that causes the server to consume excessive CPU resources. This can lead to a denial-of-service (DoS) condition, making the application or website unresponsive to legitimate users.

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

## Quick answers

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

**How severe is CVE-2026-59925?** High severity, with a CVSS score of 7.5, published 8 July 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-59925?** 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-59925 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59925?** 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

The vulnerability is an algorithmic complexity DoS (CWE-407) located in `src/mistune/inline_parser.py`. The parser uses a quadratic-time O(N²) approach for emphasis parsing where it retries a forward scan for a matching closing marker from every potential opening position. An attacker can exploit this by providing a payload with thousands of well-formed emphasis pairs (e.g., `**x**` repeated 8,000 times), causing the CPU to peg for several seconds per request. This affects the default configuration of Mistune without requiring any plugins. The issue is resolved in version 3.3.0 by implementing a more efficient parsing strategy or capping the number of tracked markers.

## Affected products

- lepture mistune < 3.3.0

## Identifiers

- CVE-2026-59925
- GHSA-4j32-57v6-6g45
- PYSEC-2026-2213

## Timeline

- 2026-06-21: disclosed
- 2026-07-08: advisory: NVD publication date
- 2026-07-20: patched: GitHub Advisory reviewed and updated

## References

- [https://api.github.com/users/offset](https://api.github.com/users/offset)
- [https://github.com/offset](https://github.com/offset)
- [https://api.github.com/users/offset/gists%7B/gist_id%7D](https://api.github.com/users/offset/gists%7B/gist_id%7D)
- [https://api.github.com/users/offset/repos](https://api.github.com/users/offset/repos)
- [https://avatars.githubusercontent.com/u/114768995?v=4](https://avatars.githubusercontent.com/u/114768995?v=4)
- [https://api.github.com/users/offset/events%7B/privacy%7D](https://api.github.com/users/offset/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)
