~ / search / GHSA-g97x-gvcm-x72h

GHSA-g97x-gvcm-x72h

Mistune: XSS via unescaped class option in Admonition directive

Source: GitHub Advisory Database (reviewed) Moderate CVE-2026-59926

Packages

EcosystemPackageAffectedFixed in
PyPI mistune < 3.3.0 3.3.0

Details

As written in the advisory (Markdown source, shown as plain text).

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.

References

External links from the advisory. They lead to third-party sites.