Python Markdown Parser Vulnerability in Mistune Affects Multiple Versions
CVE-2026-44897
6.1MEDIUM
What is CVE-2026-44897?
Mistune, a popular Python Markdown parser, is susceptible to an HTML injection vulnerability due to improper handling of id attributes in heading elements. In versions prior to 3.2.1, the method HTMLRenderer.heading() concatenates the id attribute value directly into the generated HTML without appropriate sanitization. This opens a doorway for attackers to inject arbitrary attributes into headings, potentially including event handlers or malicious links. Users are encouraged to update to Mistune version 3.2.1 or later to mitigate this risk.
Affected Version(s)
mistune < 3.2.1
