GHSA-g97x-gvcm-x72hMedium

Mistune: XSS via unescaped class option in Admonition directive

Published
July 20, 2026
Last Modified
July 20, 2026

🔗 CVE IDs covered (1)

📋 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 products1

  • pip/mistune:< 3.3.0

🔗 References (6)