Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

Skip to content
Check your stack
CVE-2026-97698

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

Products / packages lepture mistune · mistune

Published

Share

Severity and exploitation

Not in CISA KEVSource: HIGH

KEV coverage does not rule out exploitation.

KEV checked 22/11/2026, 11:50:32 UTC
GitHub_M · CVSS:3.1 · 7.5
Assessment vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
OSV · CVSS:3.1 · 7.5
Assessment vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
The headline uses the highest imported catalog score. Assessments can differ by source and CVSS version.

Severity

high7.5

CVSS measures technical severity, not the likelihood of an attack.

Known exploitation

Not listed in the checked CISA KEV catalog

Absence from CISA KEV does not rule out attacks.

Public exploit

Exploit reference published

Source-linked evidence; not proof of attacks in the wild or independent validation.

Remediation

Package fixes recorded

Fix versions are recorded for 1 of 1 mapped packages. Check each release branch and any separate product guidance.

What this means

Fixed in Mistune 3.3.4. Upgrade to 3.3.4 or later.

Source excerpt · OSV

Attack conditions

No attack-condition excerpt has been identified here. Review the full source description and references for authentication, network access, and configuration requirements.

Review supporting sources →

Affected versions

Check the exact model, release, and any platform requirements against your installation.

lepture · GitHub_M

mistune

1 range

Compare with this publisher’s ranges. This does not inspect your installation.

affected

< 3.3.4

unaffected

unknown

Other versions: unknown

Packages

Compare each installed version with the publisher’s affected ranges. Where a fix is recorded, choose the appropriate release branch and test compatibility before upgrading.

Affected range Recorded fix
Earlier releases before 3.3.4Ecosystem versions3.3.4

Version evidence: OSV · GHSA-phmp-hrw4-r36r

View original version evidence (55 explicit versions)

What to do

Compare your installed product and version with the affected versions above. A matching product name alone does not confirm exposure.

Use the recorded fix for your release branch. Review the publisher’s instructions and test compatibility before upgrading.

cve.new guidance unless attributed to a publisher. This page does not inspect your installation.

Public exploit evidence

The sources identify public exploit references. We have not independently tested them; their availability does not establish exploitation in the wild.

lepture/mistune · security/advisories/GHSA-phmp-hrw4-r36r ↗Attributed to CISA-ADP

Original source description

Read the full publisher 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

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.

Root Cause

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 [](. The no_close_bracket_before high-water mark that keeps the balanced-bracket link path linear is never entered because the empty label matches before that branch; _mark_no_link_before only advances past the 2-char label, not the href region.

Impact

A single unauthenticated request rendering untrusted markdown pins a worker at 100% CPU for tens of seconds. Measured on default mistune.html, no plugins: 6KB->0.80s, 12KB->3.15s, 24KB->12.5s, 48KB->49.8s (2x input -> ~3.9x time, clean O(n²)). This is the most severe of the mistune quadratic-DoS findings.

Proof of Concept

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

Attack Chain

  1. Entry: rendered markdown body -> "[](" * N (3 bytes/unit, no plugins). Guard: none on input size (grep of markdown.py/core.py = no size/time cap). Bypass proof: no global guard exists.
  2. Check: parse_link guards at inline_parser.py:141 (no_link_before), :150 (no_close_bracket_before). Guard: high-water marks that linearize balanced-bracket links. Bypass proof: empty label matches (label != None) so the :150 branch is skipped entirely; no_link_before only crawls +2/opener because parse_link_label returns ('',2).
  3. Processing: parse_link_href (helpers.py:143) scans to EOF per ( (unbalanced parens), returns None.
  4. Sink: O(N) openers x O(N) scan each -> O(N²) CPU.
  5. Impact: single ~48KB request stalls a worker ~50s (single-threaded); ~200KB approx minutes.

Bypass Evidence

  • parse_link_label("[](",1) returns ('', 2) — the empty label matches, so the balanced-bracket branch owning no_close_bracket_before is never entered.
  • git log -S "if c == \"(\":" -- helpers.py returns only refactor 5de41fb; parse_link_href has NEVER received a DoS fix (all helpers.py DoS fixes targeted parse_link_text).
  • Empirical: the [*n unbalanced-bracket payload is LINEAR on HEAD (0.03->0.12s) while [](*n is O(n²) (3.99x per 2x) — proving the fix does not cover this branch.

Affected Versions

<= 3.3.3 (present on latest release tag v3.3.3 and HEAD 719107f; no fix on HEAD).

Suggested Fix

Add a high-water mark for parse_link_href failed scans (mirroring no_link_before/no_close_bracket_before), or bound the parenthesis scan to a maximum length, so repeated failed href scans cannot each traverse the remaining document.


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

References

5 sources

Inside the record

Evidence available

Package identity
Version evidence
Remediation guidance · not supplied
Weakness classification
Additional publishers

Describes the evidence in this view, not whether the product is safe.

Original records

CVE-2026-97698

View the latest unmodified CVE JSON from the official source. It may be newer than this imported page.

cve.new JSON →

Underlying weaknesses

The source’s classification of what caused the vulnerability.

CWE-400 ↗

CWE-400: Uncontrolled Resource Consumption

GitHub_M

Related →
CWE-407 ↗

CWE-407: Inefficient Algorithmic Complexity

GitHub_M

Related →
Contributing organizations · 2
GitHub_M

Assigning organization

2026-11-17
CISA-ADP

Additional data publisher

2026-11-17

Timeline

All times UTC
  1. Advisory published

    Publication date supplied by the source.

  2. Source updated

    Latest modification date supplied by the source.

  3. Last imported by cve.new

    Latest catalog import, not the date we first saw this advisory.

What changed

Follow changes
  1. CVE · CVE-2026-97698

    Observed 2026-11-17T19:49:58.569Z · upstream updated 2026-11-17T19:33:19.308Z

    Prioritization updated

    before

    []

    after

    [
      {
        "source": "CISA-ADP",
        "type": "SSVC",
        "role": "CISA Coordinator",
        "timestamp": "2026-11-17T19:32:55.649728Z",
        "decisions": [
          {
            "name": "Exploitation",
            "value": "poc"
          },
          {
            "name": "Automatable",
            "value": "yes"
          },
          {
            "name": "Technical Impact",
            "value": "partial"
          }
        ]
      }
    ]

Large field values are marked as truncated previews. Original source snapshots remain retained.

Showing up to 50 most recent observed changes.