CVE-2026-59927·Python vulnerability
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the Include directive in src/mistune/directives/include.py detects only direct self-includes and not indirect cycles, allowing two markdown files that include each other to trigger unbounded recursion, raise RecursionError, and crash the rendering request. This issue is fixed in version 3.3.0.
- Severity
- medium
- Software
- Python
- Fixed in
- 3.3.0
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.35% — higher than 28% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 3.3.0
Fixed in: 3.3.0
How to fix this CVE
Update Python's Mistune markdown parser library to version 3.3.0 or later to resolve a circular include vulnerability that can cause denial of service. Applications using Mistune to render untrusted markdown files should prioritize this update immediately, as the vulnerability allows attackers to craft malicious markdown that triggers unbounded recursion and crashes the rendering process.
sudo dnf update python3-mistuneDefensia detects this vulnerability
How to check if you are affected
- Step 1: Verify Mistune installation and version: python3 -m pip show mistune | grep Version
- Step 2: Check if your application imports Mistune directives: grep -r 'from mistune.directives import' /path/to/app /var/www
- Step 3: Search application logs for RecursionError messages paired with markdown rendering: grep -i 'RecursionError\|recursion limit' /var/log/app*.log
- Step 4: Confirm the fix by reinstalling and verifying: python3 -m pip install --upgrade mistune && python3 -c 'import mistune; print(mistune.__version__)' to ensure version >= 3.3.0
FAQ
What is CVE-2026-59927?
This vulnerability exists in Mistune's Include directive, which fails to detect indirect circular references between markdown files. Two markdown files that include each other will cause unbounded recursion during rendering, crashing the application with a RecursionError and resulting in denial of service.
Is CVE-2026-59927 being actively exploited?
No, this vulnerability is not currently listed in the CISA KEV catalog and has no known public exploits, though the low barrier to exploitation means organizations should still remediate promptly.
What versions of Mistune are affected by CVE-2026-59927?
All versions prior to 3.3.0 are vulnerable. The Include directive's cycle detection logic was insufficient in these releases.
How do I check if my server is vulnerable to CVE-2026-59927?
Run 'python3 -m pip show mistune' and check if the Version field shows any version below 3.3.0. If Mistune is not installed, the vulnerability does not apply to your environment.
Does Defensia detect CVE-2026-59927?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Mistune is installed on a monitored server, CVE-2026-59927 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-59927. Free for 1 server.
Get started free