Vulnerability · Published Jul 8, 2026 · Assigned by GitHub_M

CVE-2026-59930Mistune toc / TableOfContents directive: heading IDs use predictable `toc_N` numbering with no slugification, allowing collision with attacker-controlled `id="toc_N"` content

Medium 4.3

In plain English

A medium-severity insufficient verification of data authenticity in mistune from lepture. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 9% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)4.3Medium
Exploit odds (30 days)0.2%top 91.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the toc plugin and TableOfContents directive generate heading IDs as predictable toc_N values without slugifying the heading text, allowing attacker-controlled id="toc_N" content to collide with generated anchors and redirect same-page navigation, CSS selectors, or JavaScript handlers. This issue is fixed in version 3.3.0.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12mistuneno fix listedDEBIAN-CVE-2026-59930
Debian:13mistuneno fix listedDEBIAN-CVE-2026-59930
Debian:14mistuneno fix listedDEBIAN-CVE-2026-59930
PyPImistune3.3.0GHSA-2hm2-hc3v-44h9
PyPImistune3.3.0PYSEC-2026-2218
Ubuntu:22.04:LTSmistuneno fix listedUBUNTU-CVE-2026-59930
Ubuntu:24.04:LTSmistuneno fix listedUBUNTU-CVE-2026-59930
Ubuntu:25.10mistuneno fix listedUBUNTU-CVE-2026-59930
Ubuntu:26.04:LTSmistuneno fix listedUBUNTU-CVE-2026-59930
Ubuntu:26.10mistuneno fix listedUBUNTU-CVE-2026-59930

Affected products (as reported)

VendorProductVersions
lepture mistune < 3.3.0

Weakness: CWE-345, CWE-1284 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

References