CVE-2026-46338: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in facelessuser pymdown-extensions
PyMdown Extensions versions from 10.0.1 up to but not including 10.21.3 contain a path traversal vulnerability in the SnippetPreprocessor component when the restrict_base_path option is enabled. This flaw allows markdown snippet directives to read files outside the intended restricted directory by exploiting a string-prefix containment check. The issue is a regression of a previous vulnerability (CVE-2023-32309) and was fixed in version 10.21.3. The vulnerability has a medium severity with a CVSS score of 4.3.
AI Analysis
Technical Summary
The vulnerability in facelessuser's pymdown-extensions affects the SnippetPreprocessor.get_snippet_path() method in pymdownx/snippets.py when restrict_base_path is set to True. The method uses a string-prefix containment check that is insufficient to properly restrict file access to the intended base directory. This allows an attacker to craft markdown snippet directives that read files from sibling directories sharing the same base_path prefix, effectively enabling path traversal. This regression reintroduces a previously fixed issue (CVE-2023-32309). The vulnerability affects versions from 10.0.1 up to but not including 10.21.3 and was resolved in version 10.21.3.
Potential Impact
An attacker can read files outside the intended restricted directory by exploiting the path traversal vulnerability in the snippet processing feature. This can lead to unauthorized disclosure of sensitive files accessible to the application user. The CVSS score of 4.3 reflects a medium impact primarily on confidentiality, with no impact on integrity or availability. There are no known exploits in the wild at this time.
Mitigation Recommendations
Upgrade pymdown-extensions to version 10.21.3 or later, where this path traversal vulnerability has been fixed. Since the vendor advisory indicates the issue is resolved in 10.21.3, applying this official fix is the recommended remediation. No other mitigation or temporary workaround is documented.
CVE-2026-46338: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in facelessuser pymdown-extensions
Description
PyMdown Extensions versions from 10.0.1 up to but not including 10.21.3 contain a path traversal vulnerability in the SnippetPreprocessor component when the restrict_base_path option is enabled. This flaw allows markdown snippet directives to read files outside the intended restricted directory by exploiting a string-prefix containment check. The issue is a regression of a previous vulnerability (CVE-2023-32309) and was fixed in version 10.21.3. The vulnerability has a medium severity with a CVSS score of 4.3.
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
The vulnerability in facelessuser's pymdown-extensions affects the SnippetPreprocessor.get_snippet_path() method in pymdownx/snippets.py when restrict_base_path is set to True. The method uses a string-prefix containment check that is insufficient to properly restrict file access to the intended base directory. This allows an attacker to craft markdown snippet directives that read files from sibling directories sharing the same base_path prefix, effectively enabling path traversal. This regression reintroduces a previously fixed issue (CVE-2023-32309). The vulnerability affects versions from 10.0.1 up to but not including 10.21.3 and was resolved in version 10.21.3.
Potential Impact
An attacker can read files outside the intended restricted directory by exploiting the path traversal vulnerability in the snippet processing feature. This can lead to unauthorized disclosure of sensitive files accessible to the application user. The CVSS score of 4.3 reflects a medium impact primarily on confidentiality, with no impact on integrity or availability. There are no known exploits in the wild at this time.
Mitigation Recommendations
Upgrade pymdown-extensions to version 10.21.3 or later, where this path traversal vulnerability has been fixed. Since the vendor advisory indicates the issue is resolved in 10.21.3, applying this official fix is the recommended remediation. No other mitigation or temporary workaround is documented.
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/16/2026, 19:04:42 UTC
Last updated: 07/16/2026, 19:28:43 UTC
Views: 4
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.