5.3medium
Mistune: XSS via unescaped class option in Admonition directive
- Severity
- 5.3medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.19% (higher than 8% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-g97x-gvcm-x72hPYSEC-2026-2214
Description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| lepture mistune | < 3.2.1 | CVE List |
| mistune (PyPI) | before 3.3.0 | GitHub Advisory Database, PyPA Advisory Database |
| mistune_project mistune | before 3.3.0 | NVD |
All scores
| GitHub_M | 5.3medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| PyPA Advisory Database | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.
GitHub Advisory Database
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.
NVD (es)
Mistune es un analizador de Markdown de Python con renderizadores y complementos. Antes de la versión 3.2.1, render_admonition() en src/mistune/directives/admonition.py concatena la opción :class: de la directiva Admonition en el atributo de clase HTML sin escapar, permitiendo la inyección de atributos y cross-site scripting incluso cuando el modo de escape de HTMLRenderer está habilitado. Este problema se ha solucionado en la versión 3.2.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-59926 changed 2026-07-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g97x-gvcm-x72h changed 2026-07-20 | CC-BY-4.0 |
| NVD | CVE-2026-59926 changed 2026-10-25 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2214 changed 2026-07-13 | CC-BY-4.0 |