GHSA-58cw-g322-p94vMediumCVSS 6.1

Mistune has XSS via unescaped figclass/figwidth in Figure directive

Published
May 8, 2026
Last Modified
June 8, 2026

🔗 CVE IDs covered (1)

📋 Description

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.

🎯 Affected products1

  • pip/mistune:<= 3.2.0

🔗 References (5)