CVE-2026-115353 in Mistune
Summary
by MITRE • 10/22/2026
Mistune before 3.3.0 contains a path traversal vulnerability in the RST include directive that allows attackers to read arbitrary files by supplying relative or absolute paths. Attackers can submit markdown containing include directives referencing ../ sequences or absolute paths to embed sensitive files like credentials or environment data in rendered HTML.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 10/22/2026
The vulnerability identified in Mistune versions prior to 3.3.0 represents a critical security flaw within the reStructuredText (RST) extension, specifically affecting the handling of include directives. This issue stems from an insufficient validation mechanism when processing file paths provided by users during the markdown rendering process. When the parser encounters an include directive that references external files, it fails to adequately sanitize or restrict the path components supplied in the input data. Consequently, this lack of rigorous boundary checking allows for a classic path traversal attack vector, where attackers can manipulate relative and absolute paths to escape the intended directory structure and access arbitrary locations on the host file system.
From a technical perspective, the core flaw lies in the absence of proper canonicalization or strict allow-listing of permitted directories before attempting to read files referenced by include statements. By injecting sequences such as ../ into the path argument, an attacker can traverse upwards through the directory hierarchy until reaching sensitive areas of the operating system. This capability is particularly dangerous because it enables the reading of arbitrary files regardless of their location on the disk, provided that the user account running the application has read permissions for those files. The vulnerability affects both relative and absolute paths, making exploitation straightforward and reliable across different server configurations.
The operational impact of this vulnerability is severe, primarily due to its potential for unauthorized data disclosure. Attackers can leverage this flaw to extract sensitive information such as configuration files containing database credentials, API keys, environment variables, or private cryptographic materials. In a web application context where Mistune is used to render user-supplied content into HTML, an attacker could craft malicious markdown input that triggers the inclusion of these sensitive files directly into the rendered output. This results in a direct compromise of confidentiality for critical system data, potentially leading to further exploitation stages such as privilege escalation or full system takeover if additional vulnerabilities are present.
This vulnerability aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, which describes scenarios where software does not properly neutralize special elements within file paths that can cause the path to resolve outside of the intended directory. Furthermore, in terms of offensive security frameworks, this behavior corresponds to ATT&CK technique T1083: File and Directory Discovery, as it facilitates the enumeration and retrieval of sensitive files from the target system. The exploitation method also reflects aspects of CWE-94: Improper Control of Generation of Code (Code Injection) if the included content is subsequently executed or interpreted by downstream processes, although in this specific case, the primary risk remains data exfiltration through inclusion.
To mitigate this vulnerability, organizations must immediately upgrade Mistune to version 3.3.0 or later, where the issue has been addressed with improved path validation logic. For systems that cannot be updated instantly, a temporary mitigation involves implementing strict input filtering on any user-supplied paths before they are passed to the RST include directive parser. This should involve rejecting inputs containing relative traversal sequences like ../ and restricting file access exclusively to predefined safe directories using absolute path comparisons rather than string matching alone. Additionally, applying the principle of least privilege by running application processes with minimal filesystem permissions can limit the scope of files an attacker might successfully read even if they manage to exploit this flaw.