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.
{
"github_reviewed": true,
"github_reviewed_at": "2026-05-08T23:43:12Z",
"cwe_ids": [
"CWE-79"
],
"severity": "MODERATE",
"nvd_published_at": null
}