Advisory

PYSEC-2026-2218

Also known as: CVE-2026-59930, GHSA-2hm2-hc3v-44h9

Summary

The record has no summary.

Details

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.

Severity

Medium Basis: CVSS v3 score 4.3, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

Dates

Published
2026-07-08 17:17 UTC
Modified
2026-07-13 07:15 UTC

Affected packages and fixes

mistune

PyPI · All systems

Affected

  • introduced 0, fixed 3.3.0 (ecosystem)

Fixed versions

3.3.0

Fix

  • Fixed version 3.3.0
    pip install --upgrade mistune==3.3.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences