Skip to content

← Actionable
Medium, CVSS 4.3amended

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

CVE-2026-46338GHSA-62q4-447f-wv8h

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (pymdown-extensions 10.21.3), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
4.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
EPSS
  • CVE-2026-46338: 0.40% estimated exploitation activity in the next 30 days; percentile 34.04 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary pymdownx.snippets has a regression of the CVE-2023-32309 / GHSA-jh85-wwv9-24hv fix. With restrictbasepath: 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 basepath, such as docs vs docsinternal. The regression was introduced in PR #2039 / commit 7c13bda5b7793b172efd1abb6712e156a83fe07d, which replaced the original directory-identity check with a plain string-prefix comparison. Details The regression was introduced in commit 7c13bda5b7793b172efd1abb6712e156a83fe07d (2023-05-15, #2039 "Fix regression of snippets nested deeply under specified base path"), which relaxed the original os.path.samefile(base, os.path.dirname(filename)) check to a plain startswith(base). SnippetPreprocessor.getsnippetpath() in pymdownx/snippets.py: base is os.path.abspath(b) and has no trailing separator. str.startswith(base) is…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-62q4-447f-wv8h

  2. Revision 1 · created ·

    Published from osv record GHSA-62q4-447f-wv8h

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-46338

Advisory: Regression in pymdownx.snippets reintroduces sibling-prefix path traversal bypass despite restrict_base_path
IDs: CVE-2026-46338, GHSA-62q4-447f-wv8h
Record: https://patchnext.com/advisories/cve-2026-46338 (revision 2, source checked 26 Oct 2026, 13:41 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 4.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: pymdown-extensions 10.21.3. A vendor fix does not mean a deployment is fixed.

## Affected components
- PyPI pymdown-extensions: affected >= 10.0.1, <= 10.21.2; fixed in 10.21.3

## Suggested inspection (read-only)
- `python -m pip show pymdown-extensions`: prints the installed version. Run with the environment that serves production active.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on pymdown-extensions.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-62q4-447f-wv8h (OSV record GHSA-62q4-447f-wv8h lists affected ranges: PyPI pymdown-extensions >=10.0.1 <10.21.3 (fixed))
- Verified: https://github.com/advisories/GHSA-62q4-447f-wv8h (GitHub-reviewed advisory GHSA-62q4-447f-wv8h lists affected ranges: PyPI pymdown-extensions >=10.0.1 <=10.21.2)

Commands are suggestions: review each one before running it.

Loading voting…