# CVE-2026-49851: Mistune: Potential DoS via quadratic-time parsing in parse_link_text

> An attacker can cause CPU exhaustion and denial of service in Mistune by submitting crafted Markdown input with many consecutive brackets.

- **Severity:** High 8.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Jun 2026
- **Updated:** 28 Aug 2026
- **Also known as:** AZL-91047, DEBIAN-CVE-2026-49851, ECHO-2259-d6c1-3019, GHSA-qcq2-496w-v96p, PYSEC-2026-2652, SUSE-SU-2026:22495-1, UBUNTU-CVE-2026-49851, openSUSE-SU-2026:11180-1, openSUSE-SU-2026:21191-1

## What is CVE-2026-49851?

CVE-2026-49851 is a high-severity denial of service vulnerability in lepture mistune, published on 24 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, Mistune is vulnerable to a CPU exhaustion DoS due to superlinear (approximately O(n²)) behavior in parse_link_text. When parsing Markdown containing many consecutive [ characters, parse_link_text repeatedly scans the input using a regex search inside a loop. Each iteration re-scans a large portion of the remaining string, resulting in quadratic-time behavior. An attacker-controlled Markdown input can therefore trigger excessive CPU usage with a very small payload. This vulnerability is fixed in 3.3.0.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity), CWE-770 (Allocation of Resources Without Limits or Throttling), CWE-407 (Inefficient Algorithmic Complexity), CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2026-49851?

3 open source packages ship an affected version, including mistune.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mistune` | PyPI | All versions | 3.3.0 |
| `mistune` | PyPI | All versions | 3.3.0 |
| `mistune` | PyPI | All versions | 3.3.0 |
| `python-mistune` | SUSE:Linux Enterprise Server 16.0 | All versions | 3.1.3-160000.4.1 |
| `python-mistune` | SUSE:Linux Enterprise Server for SAP applications 16.0 | All versions | 3.1.3-160000.4.1 |
| `python-mistune` | openSUSE:Leap 16.0 | All versions | 3.1.3-160000.4.1 |
| `python-mistune` | openSUSE:Tumbleweed | All versions | 3.3.2-1.1 |

## How do I fix CVE-2026-49851?

Upgrade mistune to 3.3.0 or later.

## Is CVE-2026-49851 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49851 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-49851 and fix it if it is affected.

What it is: CVE-2026-49851 is a high-severity denial of service vulnerability in lepture mistune, published on 24 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49851 exists.

Affected packages and fixed versions:
- mistune (PyPI): affected all versions; fixed in 3.3.0
- mistune (PyPI): affected all versions; fixed in 3.3.0
- mistune (PyPI): affected all versions; fixed in 3.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-49851/ (Markdown: https://insights.sbomify.com/CVE-2026-49851/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-49851
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-49851
- OSV: https://osv.dev/vulnerability/CVE-2026-49851

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-49851/
Summaries are generated and may contain mistakes; the official description above is the record.
