All vulnerabilities

PyPI

CVE-2026-97698

Mistune: Quadratic-time DoS in parse_link_href via unbounded parenthesis scan on empty-label links

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
Weakness
Uncontrolled resource consumption (CWE-400)Inefficient algorithmic complexity (CWE-407)
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-phmp-hrw4-r36r
Sources
OSV.dev and GitHub

Description

The following report describes the issue before the fix.

parse_link_href in mistune performs an unbounded parenthesis-balancing scan that runs to end-of-document on each unmatched (. Because the empty label [] bypasses the no_close_bracket_before high-water-mark guard, a single small document of the form "[](" * N causes O(N) openers to each drive an O(N) scan, producing O(N²) CPU on the default mistune.html() renderer with no plugins.

parse_link matches the empty label [] (parse_link_label("[](",1) returns ('', 2)), so it reaches the ( branch and calls parse_link_href. That function's scan loop (helpers.py:143-159) advances past characters and increments level on each (, never finding an unescaped ) at level==0, so it runs to EOF and returns None. The cursor then advances only ~2 chars to the next [](.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
mistunePyPI · osv:PyPI:mistune
  • Every version before 3.3.4

About mistune

Weekly downloads (PyPI)
17,178,849PyPI Stats, 24 Nov 2026

References