CVE-2026-61632
Python vulnerability analysis and mitigation

Overview

CVE-2026-61632 is a path traversal vulnerability in the pymdownx.b64 extension of PyMdown Extensions, a set of extensions for the Python-Markdown project. The flaw allows an attacker who controls Markdown content to read arbitrary files outside the configured base_path by crafting <img src> tags with ../ sequences or absolute paths. It affects all versions up to and including 10.21.3 and was fixed in version 11.0. The vulnerability was published on July 10, 2026, and carries a CVSS v3.1 base score of 5.3 (Medium) (Github Advisory, Red Hat Bugzilla).

Technical details

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). In pymdownx/b64.py, the repl_path function resolves image src attributes by joining them onto base_path using os.path.normpath, then opens the resulting file directly — with no check that the resolved path remains within base_path. For absolute src values, base_path is bypassed entirely via os.path.normpath(path). The file is read and its contents are base64-encoded into the rendered HTML output, disclosing them to anyone who views the page. Exploitation requires no authentication or user interaction, and a public proof-of-concept script was included in the advisory (Github Advisory).

Impact

Successful exploitation results in information disclosure: an attacker who can submit untrusted Markdown to an application rendering it with pymdownx.b64 enabled can exfiltrate the contents of any file readable by the server process, provided the file has an allowed image extension (.png, .jpg, .jpeg, .gif, .svg). While the extension check limits the scope to image-extension files, sensitive data stored in such files (e.g., configuration files renamed or disguised with image extensions, or actual image assets containing embedded metadata) can be leaked. There is no integrity or availability impact, but the confidentiality risk is real in multi-tenant or user-generated-content platforms (Github Advisory, Red Hat Bugzilla).

Exploitability

A proof-of-concept script was publicly disclosed as part of the GitHub Security Advisory, confirmed against pymdown-extensions 10.21.3 from PyPI. The vulnerability is network-exploitable with no privileges required and no user interaction needed, making it automatable. The EPSS score is approximately 0.40% (34th percentile), indicating a relatively low but non-negligible probability of exploitation in the wild. NVD SSVC data classifies exploitation status as "poc" and automatable as "yes." There is no current evidence of active in-the-wild exploitation or CISA KEV catalog listing (Github Advisory, Feedly).

Exploitation steps

  1. Identify a vulnerable target: Find a web application that renders user-supplied or attacker-controlled Markdown using PyMdown Extensions ≤ 10.21.3 with the pymdownx.b64 extension enabled.
  2. Craft a malicious Markdown payload: Construct an <img> tag with a src attribute containing path traversal sequences or an absolute path pointing to a target file with an image extension, e.g., <img src="../../../etc/passwd.png"> or <img src="/var/app/data/secret.png">.
  3. Submit the payload: Inject the crafted Markdown into the application (e.g., via a comment field, document editor, or API endpoint that processes Markdown).
  4. Retrieve the rendered output: View the rendered HTML output. The pymdownx.b64 extension will have read the target file, base64-encoded its contents, and embedded them as a data URI in the <img src> attribute.
  5. Decode the exfiltrated data: Extract the base64-encoded string from the rendered <img src="data:image/...;base64,..."> tag and decode it to recover the file's contents (Github Advisory).

Indicators of compromise

  • Network: HTTP requests to Markdown-rendering endpoints containing <img src> tags with ../ sequences or absolute paths in the src attribute; responses containing unusually large base64-encoded data URIs in <img> tags.
  • Logs: Application or web server logs showing Markdown submission requests with encoded or raw path traversal strings (e.g., ..%2F, ../, or absolute paths) in request bodies targeting Markdown rendering endpoints.
  • File System: Unexpected file access events (via auditd or similar) on files with .png, .jpg, .jpeg, .gif, or .svg extensions located outside the configured base_path directory, initiated by the Python/Markdown rendering process.
  • Process: Python process opening files outside the expected base_path directory, particularly files with image extensions in sensitive directories (Github Advisory).

Mitigation and workarounds

Upgrade to PyMdown Extensions version 11.0 or later, which introduces path containment checks using os.path.realpath and rejects any resolved path outside base_path. Version 11.0 also adds a new restrict_path option (default: True) and a root_path configuration parameter for more flexible path restriction (Release 11.0). As an immediate workaround for applications that cannot upgrade, disable the pymdownx.b64 extension entirely when rendering untrusted Markdown. Additionally, ensure the process rendering Markdown runs with the least privilege necessary to limit the scope of any file reads.

Community reactions

Red Hat tracked the vulnerability via Bugzilla (Bug 2512227) and assigned it medium priority and severity, with multiple product security team members added to the CC list, indicating active triage across Red Hat products that may bundle PyMdown Extensions (Red Hat Bugzilla). The vulnerability was credited to reporter aqilFauzi121 in the GitHub Security Advisory. Tenable added detection support via Nessus plugin 333365 and a container security plugin shortly after disclosure (Github Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-63003MEDIUM6.5
  • Python logoPython
  • django-cms
NoYesAug 20, 2026
CVE-2026-54624MEDIUM6.5
  • Python logoPython
  • django-cms
NoYesAug 20, 2026
CVE-2026-54622MEDIUM6.5
  • Python logoPython
  • django-cms
NoYesAug 20, 2026
CVE-2026-75526MEDIUM4.4
  • Python logoPython
  • django-cms
NoYesAug 20, 2026
CVE-2026-61663MEDIUM4.3
  • Python logoPython
  • django-cms
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management