~ / search / GHSA-58cw-g322-p94v

GHSA-58cw-g322-p94v

Mistune has XSS via unescaped figclass/figwidth in Figure directive

Source: GitHub Advisory Database (reviewed) Moderate CVE-2026-44896

Packages

EcosystemPackageAffectedFixed in
PyPI mistune < 3.2.1 3.2.1

Details

As written in the advisory (Markdown source, shown as plain text).

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.

References

External links from the advisory. They lead to third-party sites.