Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
4.3

CVE-2026-59930: Mistune Markdown parser lets attackers spoof heading IDs

CVE-2026-59930 · published 3 months ago
Summary

The Mistune Markdown tool creates heading identifiers using simple numbers like toc_1, toc_2, etc., without checking the actual heading text. An attacker could insert their own element with the same identifier, causing the page to jump to the wrong place or interfere with styles and scripts. Upgrade Mistune to version 3.3.0 or later to get the corrected, safer identifier generation.

What to do
  • Update hsiaoming yang mistune to version 3.3.0.
  • Update mistune_project mistune to version 3.3.0 or later.
Affected software
Ecosystem VendorProductAffected versions
– lepture mistune < 3.3.0
Debian:11 debian mistune All versions
Debian:12 debian mistune All versions
Debian:13 debian mistune All versions
Debian:14 debian mistune All versions
Ubuntu:16.04:LTS canonical mistune All versions
Ubuntu:18.04:LTS canonical mistune All versions
Ubuntu:20.04:LTS canonical mistune All versions
Ubuntu:22.04:LTS canonical mistune All versions
Ubuntu:24.04:LTS canonical mistune All versions
Ubuntu:25.10 canonical mistune All versions
Ubuntu:26.04:LTS canonical mistune All versions
pip hsiaoming yang mistune < 3.3.0
Fix: upgrade to 3.3.0
– mistune_project mistune < 3.3.0
cpe:2.3:a:mistune_project:mistune:*:*:*:*:*:*:*:*
Original advisory text
Mistune toc / TableOfContents directive: heading IDs use predictable `toc_N` numbering with no slugification, allowing collision with attacker-controlled `id="toc_N"` content
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.
Fix within
Internet-facing 60 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit
  • Gives an attacker partial control
Severity
4.3 Medium
Exploitation
<1% chance of attack within 30 days
Type
CWE-345Insufficient Verification of Data Authenticity
CWE-1284Improper Validation of Specified Quantity in Input
Timeline
Published8 Jul 2026
Updated29 Oct 2026
First seen8 Jul 2026
Track software like this
Free during beta