NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

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

mediumCVSS 4.0 5.3 · 3.1 6.1GHSA-58cw-g322-p94v

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.

Published May 8, 2026 · Updated Jun 8, 2026

Affected packages

mistune

Ecosystem
PyPI
Affected
<= 3.2.0
Fixed in
3.2.1
Check
pip show mistune

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

In src/mistune/directives/image.py, the render_figure() 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.

Credited to sergeykochanov.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More PyPI vulnerabilities

All PyPI entries