CVE-2026-46338

PyMdown Extensions: Regression in pymdownx.snippets reintroduces sibling-prefix path traversal bypass despite restrict_base_path

Published Jul 16, 2026 CVSS 3.1 · 4.3 Medium EPSS < 1% KEV · Not listed
Description
PyMdown Extensions is a set of extensions for the Python-Markdown markdown project. From 10.0.1 until 10.21.3, pymdownx.snippets uses a string-prefix containment check in SnippetPreprocessor.get_snippet_path() in pymdownx/snippets.py when `restrict_base_path: True`, allowing markdown snippet directives to read files from sibling paths that share the same base_path prefix, such as docs and docs_internal. This is a regression of CVE-2023-32309. This issue is fixed in version 10.21.3.

Analysis

AI-generated

Technical impact

PyMdown Extensions is a set of extensions for the Python‑Markdown markdown project. From releases 10.0.1 through 10.21.3, the snippet extension (pymdownx.snippets) uses a string‑prefix containment check in SnippetPreprocessor.get_snippet_path() when restrict_base_path is True, allowing markdown snippet directives to read files from sibling paths that share the same base_path prefix, such as docs and docs_internal. This regression of CVE‑2023‑32309 introduces a path‑traversal bypass that can lead to disclosure of arbitrary files within these sibling directories. The issue is fixed by upgrading to version 10.21.3 or newer.

Affected Systems

The vulnerability affects the Python package facelessuser:pymdown-extensions, specifically the snippet extension component pymdownx.snippets. All installations within the affected version range (10.0.1–10.21.3) are impacted. Deployments using version 10.21.3 or newer are no longer vulnerable.

Risk and Exploitability

Based on the description, it is inferred that the attacker must supply malicious markdown content that the application processes to exploit this path traversal. The risk is moderate: the flaw permits local file disclosure rather than remote code execution and requires the attacker to supply markdown content that the application processes. The CVSS score of 4.3 reflects this moderate severity, while the EPSS score of < 1 % indicates a very low likelihood of exploitation. The issue is not listed in the CISA KEV catalog. Administrators should consider the confidentiality risk, particularly if the markdown rendering process runs with elevated privileges or processes untrusted content on a web server.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pymdown-extensions to version 10.21.3 or later to remove the path traversal bypass
  • If an immediate upgrade is not feasible, disable the snippet extension for untrusted markdown or restrict its use to trusted input sources only
  • Consider running the markdown rendering process in a sandboxed environment or container to limit local file access

Generated by OpenCVE AI on August 1, 2026 at 08:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-62q4-447f-wv8h Regression in pymdownx.snippets reintroduces sibling-prefix path traversal bypass despite restrict_base_path
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Facelessuser
Facelessuser pymdown Extensions
Vendors & Products Facelessuser
Facelessuser pymdown Extensions
Type Values Removed Values Added
Description PyMdown Extensions is a set of extensions for the Python-Markdown markdown project. From 10.0.1 until 10.21.3, pymdownx.snippets uses a string-prefix containment check in SnippetPreprocessor.get_snippet_path() in pymdownx/snippets.py when `restrict_base_path: True`, allowing markdown snippet directives to read files from sibling paths that share the same base_path prefix, such as docs and docs_internal. This is a regression of CVE-2023-32309. This issue is fixed in version 10.21.3.
Title PyMdown Extensions: Regression in pymdownx.snippets reintroduces sibling-prefix path traversal bypass despite restrict_base_path
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 4.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 17, 2026, 5:52 PM
Reserved
May 13, 2026, 6:37 PM
Status
Analyzed
Published
Jul 16, 2026, 7:16 PM
Modified
Oct 24, 2026, 8:10 PM
Severity
Moderate
Public date
Jul 16, 2026, 6:24 PM