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

PaquetVersions
PyPI · mistuneintroduced 0, fixed 3.2.1

Références

Sources

SourceLicence
OSV.devCC-BY 4.0 — GitHub Advisory Database