{"id":"CVE-2026-59930","published":"2026-07-08T16:13:21Z","modified":"2026-07-09T13:54:33Z","title":"Mistune toc / TableOfContents directive: heading IDs use predictable `toc_N` numbering with no slugification, allowing…","vendor":"lepture","product":"mistune","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00192,"percentile":0.09001,"provenance":"source"},"cwes":[{"id":"CWE-345","name":"Insufficient Verification of Data Authenticity"},{"id":"CWE-1284","name":"Improper Validation of Specified Quantity in Input"}],"references":[{"url":"https://github.com/lepture/mistune/security/advisories/GHSA-2hm2-hc3v-44h9","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/lepture/mistune/commit/c4093c4742ed0d10d9332fb8edb455869b7b581b","tags":["x_refsource_MISC"]},{"url":"https://github.com/lepture/mistune/releases/tag/v3.3.0","tags":["x_refsource_MISC"]}],"priority":{"score":4.8,"factors":[{"name":"EPSS percentile","points":1.8},{"name":"CVSS severity","points":3.01}]},"vendorSlug":"lepture","affectedVersions":[{"vendor":"lepture","product":"mistune","versions":["< 3.3.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-09T13:53:53.247241Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"mistune","vulnerableRanges":["<3.3.0"],"patched":["3.3.0"],"from":["GHSA-2hm2-hc3v-44h9","PYSEC-2026-2218"],"provenance":"source"}],"summary":{"text":"The flaw lies in the toc plugin and TableOfContents directive of lepture's mistune, a Python Markdown parser, where heading IDs are generated as predictable toc_N values without slugifying the heading text. An attacker who can supply Markdown content that is rendered can use this to inject attacker-controlled id=\"toc_N\" values that collide with generated anchors, potentially redirecting same-page navigation, CSS selectors, or JavaScript handlers, and this requires user interaction with the rendered page.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:21:23Z"},"euvd":{"id":"EUVD-2026-42330","exploited":false,"provenance":"source"}}