GHSA-58cw-g322-p94v
Mistune has XSS via unescaped figclass/figwidth in Figure directive
En bref
- Publiée
- Mise à jour
- CVE
- CVE-2026-44896
- Alias
- PYSEC-2026-168
- CVSS_V3
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CVSS_V4
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
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.
Paquets affectés
| Paquet | Versions |
|---|---|
| PyPI · mistune | introduced 0, fixed 3.2.1 |
Références
- 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
Sources
| Source | Licence |
|---|---|
| OSV.dev | CC-BY 4.0 — GitHub Advisory Database |