CVE-2026-46338: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in facelessuser pymdown-extensions
CVE-2026-46338 is a path traversal vulnerability in the pymdown-extensions Python package, specifically in the SnippetPreprocessor component when the restrict_base_path option is enabled. Versions from 10.0.1 up to but not including 10.21.3 are affected. The vulnerability allows reading files from sibling directories that share a common base path prefix due to improper pathname limitation. This issue is a regression of a previous vulnerability (CVE-2023-32309) and is fixed starting in version 10.21.3. The CVSS score is 4.3, indicating medium severity.
AI Analysis
Technical Summary
PyMdown Extensions' SnippetPreprocessor.get_snippet_path() method uses a string-prefix containment check for path restriction when restrict_base_path is set to True. This check is insufficient, allowing an attacker to craft markdown snippet directives that read files outside the intended restricted directory by exploiting sibling paths with the same base path prefix. This vulnerability affects versions >=10.0.1 and <10.21.3 and was introduced as a regression of CVE-2023-32309. The issue is resolved in version 10.21.3.
Potential Impact
An attacker with the ability to control markdown snippet directives can read files from directories outside the intended restricted base path, potentially exposing sensitive information. The vulnerability does not allow modification or denial of service, only limited information disclosure. The CVSS score of 4.3 reflects a low-impact confidentiality loss with no integrity or availability impact.
Mitigation Recommendations
Upgrade pymdown-extensions to version 10.21.3 or later, where this path traversal vulnerability is fixed. There is no official patch advisory provided, but the fix is included starting in 10.21.3. Until upgrading, avoid enabling restrict_base_path or restrict usage of markdown snippet directives from untrusted sources.
CVE-2026-46338: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in facelessuser pymdown-extensions
Description
CVE-2026-46338 is a path traversal vulnerability in the pymdown-extensions Python package, specifically in the SnippetPreprocessor component when the restrict_base_path option is enabled. Versions from 10.0.1 up to but not including 10.21.3 are affected. The vulnerability allows reading files from sibling directories that share a common base path prefix due to improper pathname limitation. This issue is a regression of a previous vulnerability (CVE-2023-32309) and is fixed starting in version 10.21.3. The CVSS score is 4.3, indicating medium severity.
CVSS v3.1
Score 4.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
PyMdown Extensions' SnippetPreprocessor.get_snippet_path() method uses a string-prefix containment check for path restriction when restrict_base_path is set to True. This check is insufficient, allowing an attacker to craft markdown snippet directives that read files outside the intended restricted directory by exploiting sibling paths with the same base path prefix. This vulnerability affects versions >=10.0.1 and <10.21.3 and was introduced as a regression of CVE-2023-32309. The issue is resolved in version 10.21.3.
Potential Impact
An attacker with the ability to control markdown snippet directives can read files from directories outside the intended restricted base path, potentially exposing sensitive information. The vulnerability does not allow modification or denial of service, only limited information disclosure. The CVSS score of 4.3 reflects a low-impact confidentiality loss with no integrity or availability impact.
Mitigation Recommendations
Upgrade pymdown-extensions to version 10.21.3 or later, where this path traversal vulnerability is fixed. There is no official patch advisory provided, but the fix is included starting in 10.21.3. Until upgrading, avoid enabling restrict_base_path or restrict usage of markdown snippet directives from untrusted sources.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-13T18:37:30.990Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a59276968715ace438892a8
Added to database: 07/16/2026, 18:48:09 UTC
Last enriched: 07/23/2026, 22:41:31 UTC
Last updated: 08/29/2026, 10:52:09 UTC
Views: 54
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.