Threat Advisory

PyMdown Extensions Path Traversal Lets Attackers Read Arbitrary Files

Threat: Vulnerability
Targeted Region: Global
Targeted Sector: Technology & IT
Criticality: Medium
[subscribe_to_unlock_form]

EXECUTIVE SUMMARY:

CVE-2026-61632 with a CVSS score of 5.3 is a path traversal vulnerability affecting pymdown-extensions versions <= 10.21.3 in the b64 extension of PyMdown Extensions that lets attackers read arbitrary files outside the base_path, exposing their contents to whoever controls the Markdown and views the output. This flaw type occurs when resolving the src path of an image referenced by <img src> as base64 data URIs, joining it onto the configured base_path with os.path.normpath, and opening the result directly without checking that the resolved path stays inside base_path. An attacker-controlled src containing../ sequences or an absolute path reads a file outside base_path as long as that file has an allowed image extension, disclosing its contents in the rendered output. The absolute-path branch behaves the same way, bypassing base_path entirely via os.path.normpath(path). Both were confirmed leaking. This targeted file read rather than full arbitrary read still discloses file contents not meant to be exposed. An application rendering untrusted Markdown with pymdownx.b64 enabled exposes its server or process-readable files to attackers controlling the Markdown and viewers of the output, posing a business impact on confidentiality.

RECOMMENDATION:

We recommend you to update pymdown-extensions to version 11.0.0.[/subscribe_to_unlock_form]

EXECUTIVE SUMMARY:

CVE-2026-61632 with a CVSS score of 5.3 is a path traversal vulnerability affecting pymdown-extensions versions <= 10.21.3 in the b64 extension of PyMdown Extensions that lets attackers read arbitrary files outside the base_path, exposing their contents to whoever controls the Markdown and views the output. This flaw type occurs when resolving the src path of an image referenced by <img src> as base64 data URIs, joining it onto the configured base_path with os.path.normpath, and opening the result directly without checking that the resolved path stays inside base_path. An attacker-controlled src containing../ sequences or an absolute path reads a file outside base_path as long as that file has an allowed image extension, disclosing its contents in the rendered output. The absolute-path branch behaves the same way, bypassing base_path entirely via os.path.normpath(path). Both were confirmed leaking. This targeted file read rather than full arbitrary read still discloses file contents not meant to be exposed. An application rendering untrusted Markdown with pymdownx.b64 enabled exposes its server or process-readable files to attackers controlling the Markdown and viewers of the output, posing a business impact on confidentiality.

RECOMMENDATION:

We recommend you to update pymdown-extensions to version 11.0.0.[emaillocker id="1283"]

REFERENCES:

The following reports contain further technical details:

[/emaillocker]
crossmenu