CVE-2026-44896: Mistune: XSS via unescaped figclass/figwidth in Figure directive
In src/mistune/directives/image.py, the renderfigure() function concatenates figclass and figwidth options directly into HTML attributes without escaping (lines 152-168).
This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer.
Other attributes in the same file (src, alt, style) are properly escaped; figclass/figwidth were missed.
Other sources
Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and earlier, in src/mistune/directives/image.py, the renderfigure() 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.
— MITRE
Mistune: XSS via unescaped figclass/figwidth in Figure directive
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mistuneto a version that resolves this vulnerability.Fixed in 3.2.1
Event History
Frequently Asked Questions
What is the severity of CVE-2026-44896?
CVE-2026-44896 has a high severity due to its potential for attribute injection and XSS vulnerabilities.
How do I fix CVE-2026-44896?
To fix CVE-2026-44896, update the mistune package to a version higher than 3.2.0 that addresses this vulnerability.
Which versions of mistune are affected by CVE-2026-44896?
CVE-2026-44896 affects all mistune versions up to and including 3.2.0.
What are the risks associated with CVE-2026-44896?
The risks associated with CVE-2026-44896 include the potential for unauthorized JavaScript execution through XSS attacks.
Is CVE-2026-44896 relevant for applications using mistune?
Yes, CVE-2026-44896 is highly relevant for applications that utilize the mistune package for rendering HTML content.