PyPI
CVE-2026-97699
Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guards
- Severity
- High 7.5
- Published
- 19 Nov 2026
- Last changed
- 19 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 3.3.4
- Exploit chance
- 0.5% in the next 30 daysHigher than 46% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Also known as
- GHSA-ww7q-mxrj-5ffg
- Sources
- OSV.dev and GitHub
Description
The following report describes the issue before the fix.
mistune's inline image parsing reaches precedence_scan for ![ openers because the two guards that keep the link path linear are both gated behind not is_image. A small default-renderer document of the form "![" * N + "x" + "]" * N produces O(N²) CPU with no plugins.
For ![ openers, is_image is True, so both linearizing guards are skipped: if not is_image and pos <= state.no_link_before (inline_parser.py:141) and has_nested_link = not is_image and _label_contains_link(...) (:171). Execution reaches precedence_scan (:179) which runs sc.search(state.src, mark_pos, end_pos) over the whole image body — O(n) per outer opener, x O(n) openers -> O(n²). max_image_depth never fires because the failing scans never produce an image token (image_depth stays 0).
A single unauthenticated request pins a worker at 100% CPU. Measured on default mistune.html, no plugins: 6KB->0.28s, 12KB->1.07s, 24KB->4.20s, 48KB->15.8s (2x input -> ~3.8x time).
Affected software
| Software | Affected versions |
|---|---|
mistunePyPI · osv:PyPI:mistune |
|
About mistune
- Weekly downloads (PyPI)
- 17,178,849PyPI Stats, 24 Nov 2026
Vulnerabilities in mistune
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 3
- Known exploited
- 0
- CVE-2026-97698Mistune: Quadratic-time DoS in parse_link_href via unbounded parenthesis scan on empty-label linksHigh 7.5 19 Nov 2026
- CVE-2026-121438Mistune before 3.3.3 Denial of Service via Balanced Bracket Link ParsingMedium 6.9 3 Nov 2026
- CVE-2026-121437Mistune 3.3.0 before 3.3.4 Quadratic-Time DoS via _process_emphasis_delimitersHigh 8.7 3 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-97699
- GitHub Advisory Database https://github.com/advisories/GHSA-ww7q-mxrj-5ffg