GHSA-h7ww-273w-6cm8: Path Traversal

Published Oct 23, 2026
·
Updated

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) - blockerror() in html.py (line 140) - renderhtmlinclude() (line 72)

The Include plugin must be explicitly enabled via the plugins parameter.

Affected Software

1 affected componentFixes available
pip/mistune<=3.2.0
3.3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/mistune to a version that resolves this vulnerability.

    Fixed in 3.3.0
  2. Configuration

    Only enable the Include plugin explicitly via the plugins parameter when it is required.

    Mistune Include plugin plugins = explicitly enabled
  3. Configuration

    HTML-escape error messages and included file contents, including when escape=True, before rendering them.

    Mistune HTML rendering HTML escaping = enabled
  4. Compensating control

    Validate that the resolved Include file path remains within the source directory before reading it, rejecting ../ path traversal sequences.

Event History

Oct 23, 2026
Advisory Published
via GitHub·08:46 PM
Data Sourced
via GitHub·08:46 PM
DescriptionWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203