CVE-2026-44897
HTML Injection in Mistune Markdown Parser
Publication date: 2026-05-26
Last updated on: 2026-05-26
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| lepture | mistune | to 3.2.1 (inc) |
Helpful Resources
Exploitability
| 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.