medium

CVE-2026-59926

PyPI · mistune

Summary

Mistune: XSS via unescaped class option in Admonition directive

Severity
medium
EPSS
0.3% (p26)
CWE
CWE-79
Also known as
GHSA-g97x-gvcm-x72h
Published
2026-07-20
Updated
2026-07-20

Advisory details

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

Related advisories

Is your project exposed to this? Stateward checks every dependency on every pull request and flags it only if your code actually reaches it.

Check my repo

Summarize with AI

ChatGPTClaudePerplexity

Sources: CISA KEV (public domain), OSV.dev & GitHub Advisory Database (CC-BY-4.0), FIRST EPSS, NVD/CWE (public domain). Served live from the Stateward advisory database.