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

Published Jul 8, 2026
·
Updated

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.

Other sources

Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, renderadmonition() 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.

MITRE

Affected Software

3 affected componentsFixes available
Mistune Mistune<3.2.1
Mistune Project Mistune<3.3.0
pip/mistune<3.3.0
3.3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/mistune to a version that resolves this vulnerability.

    Fixed in 3.3.0
  2. Upgrade

    Upgrade mistune to a version that resolves this vulnerability.

    Fixed in 3.2.1

Event History

Jul 8, 2026
CVE Published
via MITRE·04:16 PM
Data Sourced
via MITRE·04:16 PM
DescriptionWeakness
Data Sourced
via NVD·05:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 20, 2026
Advisory Published
via GitHub·09:34 PM
Data Sourced
via GitHub·09:34 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-59926?

CVE-2026-59926 has a medium severity rating of 5.3 based on the CVSS scoring system.

2

How do I fix CVE-2026-59926?

To fix CVE-2026-59926, upgrade to Mistune version 3.2.1 or later where the vulnerability has been addressed.

3

What type of vulnerability is CVE-2026-59926?

CVE-2026-59926 is an XSS (Cross-Site Scripting) vulnerability due to unescaped class option handling.

4

What can happen if CVE-2026-59926 is exploited?

Exploitation of CVE-2026-59926 can lead to attribute injection and cross-site scripting attacks, compromising user data.

5

Which software is affected by CVE-2026-59926?

CVE-2026-59926 affects the Mistune Markdown parser prior to version 3.2.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203