VDB
Sign up
MEDIUM6.1

PYSEC-2026-2207

Quick fix

PYSEC-2026-2207 — mistune: upgrade to the fixed version with the command below.

pip install --upgrade 'mistune>=3.2.1'

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/mistune
Introduced in: 0Fixed in: 3.2.1
Fixpip install --upgrade 'mistune>=3.2.1'

References