GitHub Advisoryadvisory · PyPI
GHSA-h7ww-273w-6cm8 Mistune: Path Traversal and XSS in Include directive
HIGH
Official page ↗
- Aliases
- CVE-2026-115355
- Ecosystem
- PyPI
- Packages
- mistune
- Severity
- High
- Weaknesses
- CWE-22
- Reviewed
- 2026-10-23
Affected packages
• PyPI mistune: < 3.3.0 → fixed in 3.3.0
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.
Related
Alias · CVE (1)
- CVE-2026-115355 Mistune before 3.3.0 contains a path traversal vulnerability in the Include directive that allows attackers to read arbitrary files by… vulnerability
Weakness · CWE (1)
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness
References
- https://github.com/lepture/mistune/security/advisories/GHSA-h7ww-273w-6cm8 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-115355 advisory
- https://github.com/lepture/mistune/commit/1bef343ade163fc3bb95572b15be720084cdb993 web
- https://github.com/lepture/mistune package
- 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 web