CVE-2026-59930CWE-1284CWE-345

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

Medium · published July 8, 2026

CVSS v3.1
4.3
EPSS
0%
Percentile
8.4
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
4.3 · MEDIUM
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
CVSS v4.0
Not supplied
EPSS
0.00192 · 8.4th percentile
Weaknesses
CWE-1284 · Improper Validation of Specified Quantity in Input; CWE-345 · Insufficient Verification of Data Authenticity
Published
2026-07-08T16:13Z
EPSS history
Timeline
  • 08 JUL 16:13Z
    Mistune toc / TableOfContents directive: heading IDs use predictable `toc_N` numbering with no slugification, allowing collision with attacker-controlled `id="toc_N"` content
    cvelistv5