Mistune: Path Traversal and XSS in Include directive
GHSA-h7ww-273w-6cm8 · CVE-2026-115355
Published · Modified
AI SAST
Find this class of vulnerability in your own code
Corgea's AI-native static analysis detects vulnerabilities like this one across your repositories, ranks them by exploitability, and returns review-ready fixes.
Description
The Include directive in src/mistune/directives/include.py does not validate that the resolved file path stays within the source directory, allowing path traversal via ../ sequences to read arbitrary files.
Additionally, error messages and included file contents are rendered without HTML escaping, leading to XSS even when escape=True.
Affected functions:
- Path resolution (lines 27-31)
block_error()in html.py (line 140)render_html_include()(line 72)
The Include plugin must be explicitly enabled via the plugins parameter.
References
- WEB https://github.com/lepture/mistune/security/advisories/GHSA-h7ww-273w-6cm8
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-115355
- WEB https://github.com/lepture/mistune/commit/1bef343ade163fc3bb95572b15be720084cdb993
- PACKAGE https://github.com/lepture/mistune
- WEB https://github.com/lepture/mistune/releases/tag/v3.3.0
- WEB https://www.vulncheck.com/advisories/mistune-before-3.3.0-path-traversal-and-xss-via-include-directive
Ready to move
Start Securing
Free, no credit card | First findings in minutes