---
id: "CVE-2026-121438"
kind: "vulnerability"
aliases: ["CVE-2026-121438"]
title: "Mistune: crafted Markdown with nested brackets exhausts CPU"
severity: "medium"
cvss: 6.9
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["markdown", "mistune", "package", "python"]
not_affected_if: ["mistune-not-used", "trusted-input-only"]
published_at: "2026-11-03T15:17:35+00:00"
first_seen_at: "2026-11-03T15:22:00+00:00"
updated_at: "2026-11-03T15:23:11+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-121438", "first_seen_at": "2026-11-03T15:22:00+00:00"}]
---

# Mistune: crafted Markdown with nested brackets exhausts CPU

Mistune, a Python Markdown parser, takes quadratic CPU time on Markdown containing thousands of balanced nested brackets that do not form a link. An attacker who can submit such text to an application that parses it can tie up CPU and cause denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Mistune version with `pip show mistune` or by reading the lockfile for `mistune`
- Look for applications that parse user-submitted Markdown with Mistune

## Fix

- Mistune `3.3.3`

## Timeline

- 2026-11-03T15:22:00+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-121438

## Documents

- [advisory] Vendor advisory: github.com https://github.com/lepture/mistune/security/advisories/GHSA-47p6-w2rc-5qf7
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/mistune-before-3.3.3-denial-of-service-via-balanced-bracket-link-parsing
- [fix] Patch: github.com https://github.com/lepture/mistune/commit/fe02f40faf091f86da9ed62c865f31e11da111d7

## From the sources

Mistune before 3.3.3 contains a denial of service vulnerability in InlineParser.parse_link that allows attackers to cause quadratic CPU growth by supplying balanced nested brackets. Attackers can submit crafted Markdown with thousands of nested bracket pairs not forming a valid link, triggering repeated _contains_nested_link scans that exhaust CPU in parsing applications.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
