CVE-2026-44897: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in lepture mistune
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.
AI Analysis
Technical Summary
Mistune versions before 3.2.1 have an XSS vulnerability (CWE-79) in the HTMLRenderer.heading() function. The function builds the opening heading tag by concatenating the id attribute value directly into the HTML output without escaping or sanitizing special characters. If the id contains a double-quote character, it breaks out of the attribute context, enabling injection of arbitrary additional attributes such as event handlers or malicious URLs. This can lead to cross-site scripting attacks when untrusted input is rendered. The issue is resolved in version 3.2.1.
Potential Impact
An attacker can exploit this vulnerability by crafting a malicious id value containing a double-quote character to inject arbitrary HTML attributes into heading elements. This can result in cross-site scripting, potentially allowing execution of attacker-controlled scripts in the context of users viewing the rendered Markdown. The impact includes limited confidentiality and integrity loss, with no availability impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
Upgrade Mistune to version 3.2.1 or later, where this vulnerability is fixed by properly escaping the id attribute in HTMLRenderer.heading(). Since this is a library vulnerability, applying the official fix by updating the package is the recommended remediation. Patch status is confirmed fixed in version 3.2.1. No alternative mitigations are indicated.
CVE-2026-44897: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in lepture mistune
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 v3.1
Score 6.1medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Mistune versions before 3.2.1 have an XSS vulnerability (CWE-79) in the HTMLRenderer.heading() function. The function builds the opening heading tag by concatenating the id attribute value directly into the HTML output without escaping or sanitizing special characters. If the id contains a double-quote character, it breaks out of the attribute context, enabling injection of arbitrary additional attributes such as event handlers or malicious URLs. This can lead to cross-site scripting attacks when untrusted input is rendered. The issue is resolved in version 3.2.1.
Potential Impact
An attacker can exploit this vulnerability by crafting a malicious id value containing a double-quote character to inject arbitrary HTML attributes into heading elements. This can result in cross-site scripting, potentially allowing execution of attacker-controlled scripts in the context of users viewing the rendered Markdown. The impact includes limited confidentiality and integrity loss, with no availability impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
Upgrade Mistune to version 3.2.1 or later, where this vulnerability is fixed by properly escaping the id attribute in HTMLRenderer.heading(). Since this is a library vulnerability, applying the official fix by updating the package is the recommended remediation. Patch status is confirmed fixed in version 3.2.1. No alternative mitigations are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-07T21:50:33.546Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a174b8ce29bf47b50e4a24b
Added to database: 05/27/2026, 19:52:44 UTC
Last enriched: 06/03/2026, 20:28:26 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 57
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.