CVE-2026-44897
Received Received - Intake
HTML Injection in Mistune Markdown Parser

Publication date: 2026-05-26

Last updated on: 2026-05-26

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-26
Last Modified
2026-05-26
Generated
2026-05-27
AI Q&A
2026-05-27
EPSS Evaluated
N/A
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
lepture mistune to 3.2.1 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability exists in Mistune, a Python Markdown parser. Before version 3.2.1, the HTMLRenderer.heading() function constructs the opening <hN> tag by directly concatenating the id attribute value into the HTML without any sanitisation or escaping.

If the id value contains a double-quote character (") it prematurely ends the id attribute, allowing an attacker to inject arbitrary additional attributes such as event handlers, src=, href=, and others into the heading element.

This can lead to injection of malicious code into the rendered HTML.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability in Mistune prior to version 3.2.1 allows an attacker to inject arbitrary additional attributes into HTML heading elements due to improper sanitization of the id attribute. This can lead to cross-site scripting (XSS) attacks, which may result in unauthorized access or manipulation of data.

Such security weaknesses can impact compliance with standards like GDPR and HIPAA, which require protection of personal and sensitive data against unauthorized access and ensure data integrity and confidentiality.

Therefore, if exploited, this vulnerability could lead to violations of these regulations by exposing or compromising protected data through malicious script injection.


How can this vulnerability impact me? :

The vulnerability allows an attacker to inject arbitrary attributes into HTML heading elements, potentially enabling cross-site scripting (XSS) attacks or other malicious behaviors.

This can compromise the integrity and security of web applications using Mistune for Markdown rendering, leading to information disclosure, user session hijacking, or execution of unauthorized scripts.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, you should upgrade Mistune to version 3.2.1 or later, where the issue with HTMLRenderer.heading() has been fixed.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart