CVE-2026-44896: Mistune: XSS via unescaped figclass/figwidth in Figure directive
Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and earlier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer. Version 3.2.1 contains a patch.
Security readout for executives and security teams
Plain-English summary
Mistune, a Python Markdown parser, had an XSS flaw in figure rendering. Applications that let users submit Markdown and render figure directives could output unsafe HTML despite using HTMLRenderer escape mode. The vendor patched this in version 3.2.1.
Executive priority
Treat as a moderate web application risk. Prioritize applications that render customer, partner, or public Markdown. Patch during the next normal security update cycle, faster for internet-facing or multi-tenant services that process untrusted content.
Technical view
In Mistune 3.2.0 and earlier, src/mistune/directives/image.py render_figure() concatenates figclass and figwidth directive options into HTML attributes without escaping. These values bypass the inline renderer, allowing attribute injection and cross-site scripting. The issue is tracked as CWE-79 with CVSS 4.0 score 5.3.
Likely exposure
Exposure is most likely in Python applications using Mistune below 3.2.1 to render untrusted or user-supplied Markdown with the image/figure directive enabled. Server compromise is not indicated; the primary risk is browser-side script execution affecting users who view rendered content.
Exploitation context
The CVSS vector indicates network attackability, low complexity, no privileges, and required user interaction. The source bundle does not report active exploitation, and KEV status is false. Practical impact depends on whether untrusted authors can influence figclass or figwidth and whether users view the rendered HTML.
Researcher notes
The vulnerable path is specifically figure directive option handling in image.py, not general Markdown escaping. HTMLRenderer(escape=True) is insufficient for the affected options because values bypass inline rendering. Evidence provided names versions before 3.2.1 as affected and 3.2.1 as patched.
Mitigation direction
Upgrade Mistune to version 3.2.1 or later.
Review vendor advisory and commit for patch details.
If immediate upgrade is not possible, check vendor guidance for supported mitigations.
Restrict rendering of untrusted Markdown until patched, where operationally feasible.
Validation and detection
Inventory Python applications and dependencies for Mistune versions below 3.2.1.
Identify code paths rendering user-supplied Markdown with Mistune directives enabled.
Confirm deployed environments use the patched Mistune release.
Review tests for figure directive rendering and HTML escaping behavior.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-79: User-session and phishing behavior lookup
Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-79 · source CWE mapping
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.