CVE-2026-59926 — mistune
Fix: lepture/mistune@a3cb6e5CVE-2026-59926 is a Cross-site Scripting (XSS) vulnerability in mistune. A fix is available for mistune — see the affected versions and patch details below.
Mistune: XSS via unescaped class option in Admonition directive
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-59926.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
mistuneReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | mistune | all versions | 3.3.0pip install --upgrade 'mistune==3.3.0' |
Affected Products
mistunemistune_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mistune, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update mistune to 3.3.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-59926 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This Moderate flaw in the Mistune Markdown parser allows for Cross-Site Scripting (XSS) due to improper sanitization of user-controlled input within the Admonition directive's class attribute. An attacker could exploit this by providing specially crafted Markdown content, leading to the execution of arbitrary script…
To mitigate this issue, avoid processing untrusted or unvalidated Markdown content with affected versions of the Mistune library. Implement robust input validation and sanitization for any user-provided Markdown before rendering to prevent the injection of malicious attributes or scripts.Source: Red Hat security advisory for CVE-2026-59926 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-59926 in your dependencies?
Find it across PyPI, including transitive dependencies.