Junglewise Threat Intelligence

CVE-2026-76098: Mistune uncontrolled recursion in HTML rendering

CVE-2026-76098 · Severity: high · CVSS 7.5 · Published 2026-09-02

Executive brief

Mistune is a Markdown parser library used in web applications to convert user-submitted Markdown into HTML. A flaw in its HTML rendering engine causes it to recursively process nested text formatting (emphasis/strong) markers without depth limits. An attacker can craft a simple Markdown message with consecutive asterisks that triggers excessive recursion, crashing the Python process and denying service to all users on that server. This is particularly dangerous in forums, comment systems, and any application that accepts user-generated Markdown content.

Technical details

The vulnerability is an uncontrolled recursion issue (CWE-674) in Mistune's HTMLRenderer.render_token() method (src/mistune/renderers/html.py). The InlineParser creates deeply-nested token structures from consecutive emphasis markers (asterisks and underscores), with every 2 markers adding one nesting level. The recursive render_tokens() method processes these nested tokens without depth validation, and each nesting level consumes approximately 2 stack frames. A payload of ~1,000 consecutive asterisks generates ~500 nesting levels, consuming ~1,000 stack frames and exceeding Python's default recursion limit (1000), triggering RecursionError. The vulnerability affects all mistune APIs (markdown(), html()) and is network-reachable without authentication—an unauthenticated attacker can trigger it via any web form accepting Markdown input. The vendor released a fix in version 3.3.3.

Affected products

  • lepture mistune >= 3.3.0, < 3.3.3

Timeline

  • 2026-08-21: disclosed: GitHub Security Advisory GHSA-6m44-fpc8-c3rq published
  • 2026-08-24: advisory: CVE-2026-76098 published to NVD
  • 2026-09-02: patched: mistune v3.3.3 released with fix

References

Related threats