CVE-2026-44896: Mistune: XSS via unescaped figclass/figwidth in Figure directive

Published May 8, 2026
·
Updated

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

3 affected componentsFixes available
pip/mistune<=3.2.0
Mistune Project Mistune<=3.2.0
Microsoft azl3 python-mistune 3.0.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade mistune to a version that resolves this vulnerability.

    Fixed in 3.2.1

Event History

May 8, 2026
Advisory Published
via GitHub·11:43 PM
Data Sourced
via GitHub·11:43 PM
DescriptionWeaknessAffected Software
May 26, 2026
CVE Published
via MITRE·08:33 PM
Data Sourced
via MITRE·08:33 PM
DescriptionWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeaknessAffected Software
May 28, 2026
Data Sourced
via Microsoft·08:06 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:06 AM
DescriptionSeverity

Frequently Asked Questions

1

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.

2

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.

3

Which versions of mistune are affected by CVE-2026-44896?

CVE-2026-44896 affects all mistune versions up to and including 3.2.0.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203