Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. pymdown-extensions
  4. ›
  5. CVE-2026-46338

CVE-2026-46338: Regression in pymdownx.snippets reintroduces sibling-prefix path traversal bypass despite restrict_base_path

May 19, 2026

pymdownx.snippets has a regression of the CVE-2023-32309 / GHSA-jh85-wwv9-24hv fix. With restrict_base_path: True (the default), the current filename.startswith(base) containment check does not enforce a directory boundary. As a result, a markdown snippet directive can read files from sibling paths that share the same prefix as base_path, such as docs vs docs_internal.

The regression was introduced in PR #2039 / commit 7c13bda5b7793b172efd1abb6712e156a83fe07d, which replaced the original directory-identity check with a plain string-prefix comparison.

References

  • github.com/advisories/GHSA-62q4-447f-wv8h
  • github.com/facelessuser/pymdown-extensions/pull/2039
  • github.com/facelessuser/pymdown-extensions/security/advisories/GHSA-62q4-447f-wv8h
  • nvd.nist.gov/vuln/detail/CVE-2026-46338

Code Behaviors & Features

Detect and mitigate CVE-2026-46338 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 10.0.1 before 10.21.3

Fixed versions

  • 10.21.3

Solution

Upgrade to version 10.21.3 or above.

Impact 4.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

pypi/pymdown-extensions/CVE-2026-46338.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:07 +0000.