CVE-2026-61632: PyMdown Extensions path traversal in b64 extension

CVE-2026-61632 · Severity: medium · CVSS 5.3 · Published 2026-08-06

PyMdown Extensions is a collection of extensions for the Python Markdown library. A vulnerability in its 'b64' extension allows an attacker to read sensitive files from the server's file system by including specially crafted image tags in Markdown content. This could lead to the unauthorized disclosure of internal files that have image-related file extensions.

Technologies: pymdown-extensions (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-61632 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-61632 being exploited in the wild.
How severe is CVE-2026-61632?
Medium severity, with a CVSS score of 5.3, published 6 August 2026.
Which products and versions are affected?
pymdown-extensions (PyPI) <= 10.21.3, ECOSYSTEM:introduced=0,fixed=11.0.0.
Is there a fix for CVE-2026-61632?
Yes. pymdown-extensions (PyPI): upgrade to 11.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-61632 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-61632?
Check whether you run pymdown-extensions (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pymdown-extensions (PyPI): upgrade to 11.0.0 or later
    pip install "pymdown-extensions>=11.0.0"

Technical details

A path traversal vulnerability exists in the 'b64' extension of PyMdown Extensions due to improper validation of the 'src' attribute in <img> tags. The 'repl_path' function in 'pymdownx/b64.py' uses 'os.path.normpath' to resolve image paths without verifying if the resulting path remains within the configured 'base_path'. An attacker can use '../' sequences or absolute paths to reference files outside the intended directory. If the target file has a permitted image extension (.png, .jpg, .jpeg, .gif, .svg), the extension will read the file and embed its base64-encoded contents into the rendered HTML output. This issue is fixed in version 11.0.0.

Affected products

  • facelessuser pymdown-extensions <= 10.21.3

Identifiers

  • CVE-2026-61632
  • GHSA-9xwg-3r6f-jcx2
  • PYSEC-2026-3609

Timeline

  • 2026-07-10: disclosed
  • 2026-07-24: advisory
  • 2026-07-24: patched: Fixed in version 11.0.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.