GHSA-g97x-gvcm-x72h

Mistune: XSS via unescaped class option in Admonition directive

At a glance

Published
Updated
CVE
CVE-2026-59926
Aliases
PYSEC-2026-2214
CVSS_V4
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Description

In `src/mistune/directives/admonition.py`, the `render_admonition()` function concatenates the `:class:` option directly into the HTML class attribute without escaping (lines 63-68). This allows attribute injection and XSS even when `HTMLRenderer(escape=True)` is used. The directive name parameter is safe (validated against whitelist), but the class option comes from raw user input.

Affected packages

PackageVersions
PyPI · mistuneintroduced 0, fixed 3.3.0

References

Sources

SourceLicence
OSV.devCC-BY 4.0 — GitHub Advisory Database