GitHub Advisoryadvisory · PyPI
GHSA-58cw-g322-p94v Mistune has XSS via unescaped figclass/figwidth in Figure directive
MEDIUM
Official page ↗
- Aliases
- CVE-2026-44896
- Ecosystem
- PyPI
- Packages
- mistune
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2026-05-08
Affected packages
• PyPI mistune: < 3.2.1 → fixed in 3.2.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.
Related
Alias · CVE (1)
- CVE-2026-44896 Mistune is a Python Markdown parser with renderers and plugins. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://github.com/lepture/mistune/security/advisories/GHSA-58cw-g322-p94v web
- https://nvd.nist.gov/vuln/detail/CVE-2026-44896 advisory
- https://github.com/lepture/mistune/commit/a3cb6e5655308797e8be021d6c7b5bab13cbace2 web
- https://github.com/lepture/mistune package
- https://github.com/pypa/advisory-database/tree/main/vulns/mistune/PYSEC-2026-168.yaml web