Description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, HTMLRenderer.heading() builds the opening <hN> tag by string-concatenating the id attribute value directly into the HTML — with no call to escape(), safe_entity(), or any other sanitisation function. A double-quote character " in the id value terminates the attribute, allowing an attacker to inject arbitrary additional attributes (event handlers, src=, href=, etc.) into the heading element. This vulnerability is fixed in 3.2.1.
References (2)
Core 2
Core References
X_Refsource_Confirm x_refsource_confirm
https://github.com/lepture/mistune/security/advisories/GHSA-v87v-83h2-53w7
X_Refsource_Misc x_refsource_misc
https://github.com/lepture/mistune/releases/tag/v3.2.1
Scores
CVSS v3
6.1
EPSS
0.0019
EPSS Percentile
9.2%
Attack Vector
NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Details
CWE
CWE-79
Status
published
Products (3)
lepture/mistune
< 3.2.1
mistune_project/mistune
< 3.2.1
pypi/mistune
0 - 3.2.1PyPI
Published
May 26, 2026
Tracked Since
May 27, 2026