Inefficient Algorithmic Complexity Affecting mistune package, versions [,3.3.4)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.55% (47th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-MISTUNE-22606119
  • published19 Nov 2026
  • disclosed17 Nov 2026
  • creditzx (Jace), manus-use

Introduced: 17 Nov 2026

NewCVE-2026-97698  (opens in a new tab)
CWE-407  (opens in a new tab)

How to fix?

Upgrade mistune to version 3.3.4 or higher.

Overview

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via parse_link_href in src/mistune/helpers.py, which performs an unbounded parenthesis-balancing scan to the end of the document for each unmatched opening parenthesis encountered through an empty [] link label. The empty label bypasses the no_close_bracket_before high-water-mark guard in src/mistune/inline_parser.py, and no_link_before advances only past the two-character label rather than the href region, so successive []( candidates each trigger an O(N) scan of the remaining document. An attacker can submit a document consisting of repeated []( units to produce O(N²) CPU work, pinning a worker at 100% utilization for tens of seconds on inputs of tens of kilobytes.

PoC

import mistune
md = mistune.create_markdown()   # default HTML renderer, no plugins
md("[](" * 16000)                # ~48KB input stalls a worker ~50s

CVSS Base Scores

version 4.0
version 3.1