CVE-2026-115355: Mistune: Path Traversal and XSS in Include directive
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.
Published Oct 23, 2026
Affected packages
mistune
- Ecosystem
- PyPI
- Affected
- <= 3.2.0
- Fixed in
- 3.3.0
- Check
pip show mistune
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to sergeykochanov.
References
- https://github.com/lepture/mistune/security/advisories/GHSA-h7ww-273w-6cm8
- https://nvd.nist.gov/vuln/detail/CVE-2026-115355
- https://github.com/lepture/mistune/commit/1bef343ade163fc3bb95572b15be720084cdb993
- https://github.com/lepture/mistune/releases/tag/v3.3.0
- https://www.vulncheck.com/advisories/mistune-before-3.3.0-path-traversal-and-xss-via-include-directive
- https://github.com/advisories/GHSA-h7ww-273w-6cm8
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-97698
Mistune: Quadratic-time DoS in parse_link_href via unbounded parenthesis scan on empty-label links
high7.5Nov 19, 2026CVE-2026-97699
Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guards
high7.5Nov 19, 2026CVE-2026-76098
Mistune: Denial of Service — RecursionError via Excessive Emphasis Markers in Markdown
high7.5Sep 2, 2026CVE-2026-59922
Mistune plugins/formatting: quadratic-time parsing on long runs of `~~x~~`, `==x==`, and `^^x^^` markers (strikethrough / mark / insert)
high7.5Jul 20, 2026CVE-2026-59923
Mistune: XSS via percent-encoded javascript URI bypass in safe_url()
medium6.1Jul 20, 2026CVE-2026-59924
Mistune: Arbitrary File Read via Include directive path traversal
medium5.9Jul 20, 2026
