NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guardsGHSA-ww7q-mxrj-5ffg

HIGHFix: lepture/mistune@b4dd328

GHSA-ww7q-mxrj-5ffg is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in mistune. A fix is available for mistune — see the affected versions and patch details below.

Also known asCVE-2026-97699
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 20, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-ww7q-mxrj-5ffg.

EPSS Exploitation Probability

via FIRST.org ↗
0.7%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs53th percentile — riskier than 53% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
🐍mistune

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Resolution

Fixed in Mistune 3.3.4. Upgrade to 3.3.4 or later.

The reported payload was reproduced against the 3.3.3 release tag and verified to scale approximately linearly against the 3.3.4 release tag.

Original report

The following report describes the issue before the fix.

Summary

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.

Root Cause

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).

Impact

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).

Proof of Concept

import mistune
md = mistune.create_markdown()   # default, no plugins
md("![" * 16000 + "x" + "]" * 16000)

Attack Chain

  1. Entry: rendered markdown -> "!["*N + "x" + "]"*N (no plugins). Guard: none on input size. Bypass proof: no global cap.
  2. Check: not is_image guards at inline_parser.py:141 (no_link_before) and :171 (_label_contains_link). Guard: high-water mark + nested-link short-circuit. Bypass proof: is_image is True for ![, so BOTH guards are gated out; max_image_depth (:checked after) measured flat across all values because no image token is produced.
  3. Processing: reaches precedence_scan (:179) -> sc.search(state.src, mark_pos, end_pos) over the full body per opener.
  4. Sink: O(N) openers x O(N) scan -> O(N²) CPU.
  5. Impact: 48KB -> ~16s single-threaded worker stall.

Bypass Evidence

  • The LINK payload "["*n+"x"+"]"*n is LINEAR on HEAD (0.076s @ 16k, ~2x per 2x) because links get the _label_contains_link short-circuit; the IMAGE payload "!["*n+"x"+"]"*n is O(n²) (0.27->1.05->3.92s, ~3.8x). Same HEAD, only is_image differs — proves the guard asymmetry, not incidental input growth.
  • max_image_depth set across 0..100 leaves runtime flat (no image token produced by failing scans).

Affected Versions

<= 3.3.3 (present on latest release tag v3.3.3 and HEAD).

Suggested Fix

Generalize the no_link_before high-water mark (and/or the _label_contains_link short-circuit) to cover the image path, so failed ![ scans do not each re-traverse the document.


Reported by zx (Jace) — GitHub: @manus-use

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPImistuneall versions3.3.4pip install --upgrade 'mistune==3.3.4'

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mistune, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mistune to 3.3.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-ww7q-mxrj-5ffg is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Frequently Asked Questions

## Resolution **Fixed in Mistune 3.3.4.** Upgrade to 3.3.4 or later. - Affected versions: `< 3.3.4` - First patched version: `3.3.4` - Fix: https://github.com/lepture/mistune/compare/v3.3.3...v3.3.4 The reported payload was reproduced against the 3.3.3 release tag and verified to scale approximately linearly against the 3.3.4 release tag. ## Original report The following report describes the issue before the fix. ## Summary 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`.
O3 Security · Impact-Aware SCA

Is GHSA-ww7q-mxrj-5ffg in your dependencies?

Find it across PyPI, including transitive dependencies.

Mistune: Quadratic-time DoS in inline image parsing…