/

CVE-2026-115353

Severity:

HIGH RISK

(8.6)

Path Traversal (CWE-22) in Mistune RST Include Directive

CVE-2026-115353

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Disclosure

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Mistune contains a path traversal vulnerability in its RST include directive that may allow attacker-controlled Markdown to reference files outside the intended content directory.

When such Markdown is rendered, sensitive local files such as credentials or environment data could be embedded in the generated HTML if the application exposes the rendered output.

Mistune contains a path traversal vulnerability in its RST include directive that may allow attacker-controlled Markdown to reference files outside the intended content directory.

When such Markdown is rendered, sensitive local files such as credentials or environment data could be embedded in the generated HTML if the application exposes the rendered output.

Affected context

The issue occurs in applications that use Mistune's RST include directive to render Markdown or reStructuredText content and allow untrusted users or external systems to supply that content. It becomes risky when the include mechanism resolves relative or absolute filesystem paths without adequately restricting them to an approved directory.

The issue occurs in applications that use Mistune's RST include directive to render Markdown or reStructuredText content and allow untrusted users or external systems to supply that content. It becomes risky when the include mechanism resolves relative or absolute filesystem paths without adequately restricting them to an approved directory.

Exploit preconditions

  • Attack surface: Markdown or RST content processed by Mistune
  • Required access: Ability to submit or influence content that is rendered by the application
  • Trigger point: Processing of an include directive during document rendering
  • Why exploitation is possible: File paths are resolved without sufficiently enforcing an allowed-root boundary, allowing references outside the intended content area
  • Attack surface: Markdown or RST content processed by Mistune
  • Required access: Ability to submit or influence content that is rendered by the application
  • Trigger point: Processing of an include directive during document rendering
  • Why exploitation is possible: File paths are resolved without sufficiently enforcing an allowed-root boundary, allowing references outside the intended content area

Why this happens

The vulnerability is caused by insufficient path validation in the RST include directive. The renderer treats attacker-influenced path values as filesystem locations without reliably canonicalizing them and enforcing containment within an approved directory.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where input can influence access to files beyond the intended filesystem boundary.

The vulnerability is caused by insufficient path validation in the RST include directive. The renderer treats attacker-influenced path values as filesystem locations without reliably canonicalizing them and enforcing containment within an approved directory.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where input can influence access to files beyond the intended filesystem boundary.

Potential impact

  • Sensitive files may be disclosed through rendered HTML
  • Credentials, tokens, or environment data could be exposed
  • Application configuration and source files may be revealed
  • Downstream users or systems can be affected if rendered output is trusted or redistributed
  • Sensitive files may be disclosed through rendered HTML
  • Credentials, tokens, or environment data could be exposed
  • Application configuration and source files may be revealed
  • Downstream users or systems can be affected if rendered output is trusted or redistributed

General mitigation guidance

Mitigation generally focuses on reducing trust in document-supplied paths and enforcing a strict filesystem boundary.

Common defensive patterns include:

  • Disable include processing for untrusted content when it is not required
  • Resolve paths canonically before access and require them to remain within an approved directory
  • Prefer allowlisted documents or identifiers over arbitrary filesystem paths
  • Apply strict input and content validation before rendering
  • Run rendering components with least-privilege filesystem access
  • Avoid exposing rendered output containing sensitive server-side content

These controls help limit disclosure risk even if an attacker can influence rendered documents.

Mitigation generally focuses on reducing trust in document-supplied paths and enforcing a strict filesystem boundary.

Common defensive patterns include:

  • Disable include processing for untrusted content when it is not required
  • Resolve paths canonically before access and require them to remain within an approved directory
  • Prefer allowlisted documents or identifiers over arbitrary filesystem paths
  • Apply strict input and content validation before rendering
  • Run rendering components with least-privilege filesystem access
  • Avoid exposing rendered output containing sensitive server-side content

These controls help limit disclosure risk even if an attacker can influence rendered documents.

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis and code review checks for filesystem access using document-controlled paths
  • Review of include and template features for canonicalization and allowed-root enforcement
  • Tests covering boundary paths, symbolic links, absolute paths, and normalization behavior
  • Runtime monitoring for unexpected reads outside designated content directories
  • Policy enforcement that disables filesystem-backed directives for untrusted document sources

Automated security review tools may help flag path construction and file access patterns that lack containment checks.

Organizations can identify this class of issue through:

  • Static analysis and code review checks for filesystem access using document-controlled paths
  • Review of include and template features for canonicalization and allowed-root enforcement
  • Tests covering boundary paths, symbolic links, absolute paths, and normalization behavior
  • Runtime monitoring for unexpected reads outside designated content directories
  • Policy enforcement that disables filesystem-backed directives for untrusted document sources

Automated security review tools may help flag path construction and file access patterns that lack containment checks.

Sources

SourceLink
github.comgithub.com/lepture/mistune/security/advisories/GHSA-9jjx-3hq3-hx4j
vulncheck.comvulncheck.com/advisories/mistune-before-3.3.0-path-traversal-via-include-directive

Frequently asked

questions

It can be exploitable through an application that accepts attacker-controlled Markdown or RST content and renders it on a server with access to sensitive files.

An attacker generally needs the ability to submit or influence content processed by the vulnerable include directive. The practical impact also depends on whether rendered output is returned or otherwise exposed.

Disable include processing for untrusted content, or enforce canonical path resolution and strict containment within an approved directory.

Treat document-supplied paths as untrusted, use allowlists instead of arbitrary paths, test filesystem boundary conditions, and apply least-privilege permissions to rendering processes.

It can be exploitable through an application that accepts attacker-controlled Markdown or RST content and renders it on a server with access to sensitive files.

An attacker generally needs the ability to submit or influence content processed by the vulnerable include directive. The practical impact also depends on whether rendered output is returned or otherwise exposed.

Disable include processing for untrusted content, or enforce canonical path resolution and strict containment within an approved directory.

Treat document-supplied paths as untrusted, use allowlists instead of arbitrary paths, test filesystem boundary conditions, and apply least-privilege permissions to rendering processes.

Find out what's already
exploitable in your codebase.