Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. mistune
  4. ›
  5. CVE-2026-115355

CVE-2026-115355: Mistune: Path Traversal and XSS in Include directive

October 23, 2026

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

  • github.com/advisories/GHSA-h7ww-273w-6cm8
  • github.com/lepture/mistune/commit/1bef343ade163fc3bb95572b15be720084cdb993
  • github.com/lepture/mistune/releases/tag/v3.3.0
  • github.com/lepture/mistune/security/advisories/GHSA-h7ww-273w-6cm8
  • nvd.nist.gov/vuln/detail/CVE-2026-115355
  • www.vulncheck.com/advisories/mistune-before-3.3.0-path-traversal-and-xss-via-include-directive

Code Behaviors & Features

Detect and mitigate CVE-2026-115355 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.3.0

Fixed versions

  • 3.3.0

Solution

Upgrade to version 3.3.0 or above.

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

pypi/mistune/CVE-2026-115355.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:47 +0000.