CVE-2026-59926
JSON

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 packageVersionsReported by
lepture mistune< 3.2.1CVE List
mistune (PyPI)before 3.3.0GitHub Advisory Database, PyPA Advisory Database
mistune_project mistunebefore 3.3.0NVD

All scores

GitHub_M5.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
PyPA Advisory Database6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79

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

SourceRecordLicence
CVE ListCVE-2026-59926 changed 2026-07-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-g97x-gvcm-x72h changed 2026-07-20CC-BY-4.0
NVDCVE-2026-59926 changed 2026-10-25Public domain
PyPA Advisory DatabasePYSEC-2026-2214 changed 2026-07-13CC-BY-4.0