Junglewise Threat Intelligence

CVE-2026-59922: lepture Mistune denial of service in formatting plugins

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

Technologies: Lepture Mistune. Vendors: PyPI.

Executive brief

Mistune is a Python library used to convert Markdown text into HTML. A vulnerability in its formatting plugins (strikethrough, mark, and insert) 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 where the application becomes unresponsive to legitimate users.

Technical details

The vulnerability is an algorithmic complexity flaw (CWE-407) in `src/mistune/plugins/formatting.py`. When the strikethrough, mark, or insert plugins are enabled, the parser performs a forward scan for matching closing delimiters (`~~`, `==`, or `^^`) for every opening delimiter encountered. In inputs with many repeated markers, this results in O(N²) complexity. An attacker can exploit this by sending a relatively small payload (e.g., 8-16 KB) that exhausts CPU resources. The issue is resolved in version 3.3.0 by implementing a cap on tracked markers or using a more efficient delimiter-stack algorithm.

Affected products

  • lepture mistune < 3.3.0

Timeline

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

References

Related threats