Categories
CVE-2026-61632 medium CVSS 5.3

Path Traversal in pymdown-extensions (CVE-2026-61632)

Summary

Path traversal in pymdown-extensions (CVE-2026-61632). Risk of unauthorized operations or information disclosure. Exploitable via b64. Mitigation: upgrade to 11.0.0 or later.

Original description

The description as published by the source.

Summary

The b64 extension inlines images referenced by `` as base64 data URIs. When resolving the src path it joins it onto the configured base_path with os.path.normpath and opens the result directly, with no check that the resolved path stays inside base_path. A src containing ../ sequences, or an absolute path, therefore reads a file outside base_path as long as that file has an allowed image extension (.png, .jpg, .jpeg, .gif, .svg). The base64 of that file is then embedded in the rendered output, disclosing its contents.

This is a separate code path from the snippets traversal issues (GHSA-jh85-wwv9-24hv, GHSA-62q4-447f-wv8h). It lives in pymdownx/b64.py and has no path restriction of any kind. Confirmed on 10.21.3 installed from PyPI.

Details

In pymdownx/b64.py, function repl_path (around lines 68 to 90 on main):

if is_absolute:
    file_name = os.path.normpath(path)                          # absolute src: base_path ignored entirely
else:
    file_name = os.path.normpath(os.path.join(base_path, path)) # relative src: '../' escapes base_path
if os.path.exists(file_name):
    ext = os.path.splitext(file_name)[1].lower()
    for b64_ext in file_types:
        if ext in b64_ext:
            with open(file_name, "rb") as f:                    # opened with no containment check
                ...

There is no startswith(base_path), no os.path.realpath comparison, and no rejection of ... Both branches are…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-61632 has been found in pymdown-extensions.
Attackers can target a specific entry point like b64 over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 5.3/10.
What to do: upgrade pymdown-extensions to 11.0.0 or later.
If unsure, ask your IT team or search "pymdown-extensions CVE-2026-61632" on the vendor's site.

CVE-2026-61632 (pymdown-extensions) — CWE-22 / CVSS v3 5.3
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: b64 / src / base_path / os.path.normpath
Patched: 11.0.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

Path traversal (CWE-22) exists in pymdown-extensions. Attackers reach the vulnerable code path via b64 without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of pymdown-extensions. Attack surface: b64 / src / base_path / os.path.normpath.

🔥 Severity

Severity: Medium (CVSS 5.3/10). Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to 11.0.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'pymdown-extensions' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'pymdown-extensions' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で pymdown-extensions を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade pymdown-extensions to 11.0.0

    ステージング環境で 11.0.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

pip pymdown-extensions
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"11.0.0"}]}]
PyPI pymdown-extensions
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"11.0.0"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details