Sceawere
Vulnerability Detail
CVE-2026-61632UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
PyMdown Extensions b64 Path Traversal
Vulnerability Metadata
- Severity
- Medium
- Score / CVSS
- 5.3
- Creation Date
- 1d ago
- Vendor
- facelessuser
- Product
- pymdown-extensions
- Attack Type
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- Vector String
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack Complexity
- LOW
Narrative and Response
Description
PyMdown Extensions is a set of extensions for the Python-Markdown markdown project. In versions up to and including 10.21.3, the b64 extension is vulnerable to a path traversal that discloses arbitrary files: it inlines images referenced by <img src="..."> by joining the src onto the configured base_path with os.path.normpath and opening the result directly, without verifying that the resolved path stays inside base_path. As a result, an src containing ../ sequences or an absolute path reads a file outside base_path as long as it has an allowed image extension (.png, .jpg, .jpeg, .gif, .svg), and the file's contents are then base64-encoded into the rendered output, disclosing them. An application that renders untrusted Markdown with pymdownx.b64 enabled can therefore leak the contents of image-extension files readable by the process to whoever controls the Markdown or views the output, a targeted file-read bounded by the extension check. This issue has been fixed in version 11.0.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "5.3",
"pubDate": "2026-08-06T22:18:11.410Z",
"pubdate": "2026-08-06T22:18:11.410Z",
"executiveSummary": "PyMdown Extensions contains a path traversal vulnerability in the b64 extension affecting versions up to and including 10.21.3. This vulnerability allows an attacker to achieve arbitrary file disclosure of readable files possessing allowed image extensions (.png, .jpg, .jpeg, .gif, .svg). The flaw impacts applications rendering untrusted Markdown content with the pymdownx.b64 extension enabled, exposing sensitive data to users who control or view the rendered Markdown output. Exploitation requires the ability to supply or influence the Markdown input processed by the vulnerable application, leveraging malicious img src attributes containing directory traversal sequences or absolute paths to bypass intended base_path restrictions.",
"technicalDetails": "The vulnerability resides in the b64 extension of PyMdown Extensions, specifically within the routine responsible for inlining images referenced by HTML img src attributes. The root cause is the insecure handling of file paths during resolution, where the provided src attribute is joined onto the configured base_path using os.path.normpath and opened directly without performing boundary validation checks to ensure the resolved path remains confined within the intended base_path directory. Because the application fails to verify that traversal sequences such as ../ or absolute paths do not escape the designated root directory, an attacker can construct a crafted Markdown payload referencing arbitrary files on the underlying filesystem. To successfully exploit this behavior, the target file must possess an allowed image extension (.png, .jpg, .jpeg, .gif, .svg) due to the extension check enforced by the component. The attack flow proceeds as follows: 1. The attacker crafts a malicious Markdown input containing an img tag with a traversal path or absolute path pointing to a sensitive file on the server. 2. The vulnerable application processes the Markdown using pymdownx.b64. 3. The extension resolves the path outside the base_path directory via os.path.normpath and opens the targeted file. 4. The contents of the accessed file are read, base64-encoded, and embedded directly into the rendered HTML output. 5. The attacker views the rendered output and decodes the base64 payload to retrieve the file contents. This targeted file-read vulnerability requires no authentication or special privileges beyond the ability to submit untrusted Markdown to the rendering engine, and the impact is bounded by file system read permissions of the process and the image extension restriction."
}