CVE-2026-46338
Received Received - Intake

Path Traversal in PyMdown Extensions

Vulnerability report for CVE-2026-46338, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-16

Last updated on: 2026-07-16

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-16
Last Modified
2026-07-16
Generated
2026-07-16
AI Q&A
2026-07-16
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
facelessuser pymdown_extensions From 10.0.1 (inc) to 10.21.2 (inc)
facelessuser pymdown_extensions 10.21.3

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a directory traversal issue in PyMdown Extensions affecting versions 10.0.1 to 10.21.2. It occurs when the restrict_base_path setting is enabled (default true). The code incorrectly checks file paths using a string-prefix comparison instead of verifying directory boundaries, allowing snippet directives to read files from sibling directories that share a prefix with the base_path. For example, with base_path '/x/docs', files could be read from '/x/docs_internal/' or '/x/docs.bak/'.

Detection Guidance

Check if your system uses PyMdown Extensions versions between 10.0.1 and 10.21.2. Run: pip show pymdown-extensions. If installed, verify the version matches the vulnerable range.

Impact Analysis

This vulnerability enables arbitrary file reads on the host system where the build runs. It could expose sensitive files or secrets in CI environments, potentially leading to information disclosure or further attacks if those files contain credentials or configuration data.

Mitigation Strategies

Upgrade PyMdown Extensions to version 10.21.3 or later. Run: pip install --upgrade pymdown-extensions. If using restrict_base_path, ensure it is set to True and verify directory boundaries are enforced.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-46338. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart