Skip to content
Heist/ feed
Back to feed
Medium

PyMdown Extensions: Path traversal in the b64 extension lets read files outside base_path

Type: advisorySources: OSV

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 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-61632
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 08:38 UTC · Revision 1

Source evidence

PyMdown Extensions: Path traversal in the b64 extension lets read files outside base_path

core-osv · Original source

Published 6 Aug 2026, 20:59 UTC

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 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.

osv:CVE-2026-61632
Complete source record
{
  "id": "96d002bb19cb46afa5a093a3fcbfec5d5c22f1d58ee9a45ab77c3a8e7c776cb7",
  "url": "https://osv.dev/vulnerability/CVE-2026-61632",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "PyMdown Extensions: Path traversal in the b64 extension lets read files outside base_path",
    "summary": "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 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.",
    "evidence": "osv:CVE-2026-61632",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-61632",
      "aliases": [
        "CVE-2026-61632",
        "GHSA-9xwg-3r6f-jcx2",
        "PYSEC-2026-3609"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/facelessuser/pymdown-extensions",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "6d0097b85a52468e7cd8eaceaa192ff3348c41e0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "11.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "6d0097b85a52468e7cd8eaceaa192ff3348c41e0"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "11.0"
                  }
                ]
              }
            }
          ],
          "versions": [
            "10.21.3",
            "10.21.2",
            "10.21",
            "10.21.1",
            "10.20",
            "10.19.1",
            "10.19",
            "10.18",
            "10.17.2",
            "10.17.1",
            "10.17",
            "10.16.1",
            "10.16",
            "10.15",
            "10.14.3",
            "10.14.2",
            "10.14.1",
            "10.14",
            "10.13",
            "10.12",
            "10.11.2",
            "10.11.1",
            "10.11",
            "10.10.2",
            "10.10.1",
            "10.10",
            "10.9",
            "10.8.1",
            "10.8",
            "10.7.1",
            "10.7",
            "10.6",
            "10.5",
            "10.4",
            "10.3.1",
            "10.3",
            "10.2.1",
            "10.2",
            "10.1.0",
            "10.0.1",
            "10.0",
            "9.11",
            "9.10",
            "9.10b5",
            "9.10b4",
            "9.10b3",
            "9.10b2",
            "9.9.2",
            "9.9.1",
            "9.9",
            "9.8",
            "9.7",
            "9.6",
            "9.5",
            "9.4",
            "9.3",
            "9.2",
            "9.1",
            "9.0",
            "8.2",
            "8.1.1",
            "8.1",
            "8.0.1",
            "8.0",
            "7.1",
            "7.0.0",
            "7.0.0rc2",
            "7.0.0rc1",
            "7.0.0b2",
            "6.3.0",
            "6.2.1",
            "6.2.0",
            "6.1.0",
            "6.0.0",
            "5.0.0",
            "4.12.0",
            "4.11.0",
            "4.10.2",
            "4.10.1",
            "4.10.0",
            "4.9.2",
            "4.9.1",
            "4.9.0",
            "4.8.0",
            "4.7.0",
            "4.6.0",
            "4.5.1",
            "4.5.0",
            "4.4.0",
            "4.3.0",
            "4.2.0",
            "4.1.0",
            "4.0.0",
            "3.5.0",
            "3.4.0",
            "3.3.0",
            "3.2.1",
            "3.2",
            "3.1",
            "3.0",
            "2.0",
            "1.8.0",
            "1.7.0",
            "1.6.1",
            "1.6.0",
            "1.5.0",
            "1.4.0",
            "1.3.0",
            "1.2.0",
            "1.1.0",
            "1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-61632.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:27.091584744Z",
      "provider": "osv",
      "references": [
        "https://github.com/facelessuser/pymdown-extensions/releases/tag/11.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/61xxx/CVE-2026-61632.json",
        "https://github.com/facelessuser/pymdown-extensions/security/advisories/GHSA-9xwg-3r6f-jcx2",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-61632"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-22"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/61xxx/CVE-2026-61632.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-61632",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 493922,
  "published_at": "2026-08-06T20:59:20.177+00:00"
}