NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-59926: Mistune: XSS via unescaped class option in Admonition directive

mediumCVSS 4.0 5.3GHSA-g97x-gvcm-x72h

In src/mistune/directives/admonition.py, the renderadmonition() 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.

Published Jul 20, 2026

Affected packages

mistune

Ecosystem
PyPI
Affected
< 3.3.0
Fixed in
3.3.0
Check
pip show mistune

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to sergeykochanov.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More PyPI vulnerabilities

All PyPI entries