CVE-2026-97699: Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guards
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.4, inline image parsing sends nested ![ openers through precedencescan because the nolinkbefore and labelcontainslink linearization guards are gated by not isimage. In src/mistune/inlineparser.py, each outer image opener can therefore search the remaining image body, while maximagedepth does not apply because the failed scans do not produce image tokens. Rendering untrusted Markdown with the default HTML renderer and no plugins can perform quadratic CPU work and keep a worker at 100 percent utilization. This issue is fixed in version 3.3.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.3.4