CVE-2026-59930

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

State
Published
Severity
4.3 Medium
Published
Jul 8, 2026
Updated
Jul 9, 2026
Reserved
Jul 7, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.14.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:NGitHub_M

Weaknesses

  • CWE-345 Insufficient Verification of Data Authenticity
  • CWE-1284 Improper Validation of Specified Quantity in Input

Affected Products

ProductVersions
mistunelepture
  • < 3.3.0Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.