PT-2026-41146 · Debian+4 · Mistune+1
Across-Verticals-Malaysia
+1
·
Published
2026-05-14
·
Updated
2026-05-26
·
CVE-2026-44898
CVSS v3.1
6.1
Medium
| Vector | AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Name of the Vulnerable Software and Affected Versions
Mistune versions prior to 3.2.1
Description
The
render toc ul() function builds a table-of-contents tree from a list of tuples. The id value, used for the href attribute, and the text value, used as the link label, are inserted into <a> tags using a plain Python format string without HTML escaping. When heading IDs are derived from user-supplied text, an attacker can craft a heading that breaks out of the href attribute context to inject arbitrary HTML tags, such as <script> blocks, directly into the rendered table of contents. This occurs specifically within the render toc ul() function located in src/mistune/toc.py.Recommendations
Update to version 3.2.1.
As a temporary workaround, restrict the use of custom
heading id callbacks that return raw user-supplied text as the ID.Exploit
Fix
XSS
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Mistune
Mistune0