Skip to main content
Mallory
Medium

CPython Windows VPATH Landmark Search Path Privilege Escalation

IdentifiersCVE-2026-12003CWE-427· Uncontrolled Search Path Element

CVE-2026-12003 is a moderate-severity vulnerability in CPython affecting versions up to and including 3.11.15, 3.12.13, 3.13.14, 3.14.6, and 3.15.0b2. CPython retains logic in release builds to support running from an in-tree build layout rather than an installed layout. That logic uses the build-time VPATH variable to locate landmarks such as Modules/setup.local; when such a landmark is found relative to the executable, Python assumes it is running from a source tree and generates an alternate default sys.path. On Windows, builds under PCbuild/<arch> set VPATH to ...., producing a landmark path of ....\Modules\setup.local. Because this path can resolve outside the Python installation directory, an attacker with low privileges may be able to create the expected landmark and a malicious alternative Lib directory in a location discovered by Python. This can cause an otherwise restricted Python installation to resolve imports from attacker-controlled locations.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

On affected Windows installations, successful exploitation can let a low-privilege local user influence Python's default sys.path by planting a forged Modules/setup.local landmark and alternate Lib tree outside the install directory. This can result in unauthorized library loading and, in scenarios where a more privileged user or service executes the affected Python installation, privilege escalation through execution of attacker-controlled Python modules or code during interpreter startup or subsequent imports. The issue is primarily relevant to legacy all-users EXE installations where the directory two levels above the Python install path is writable by less-privileged users.

Mitigation

If you can’t patch tonight, do this now.

On Windows, avoid legacy all-users EXE installations in locations where the directory two levels above the Python installation path is writable by unprivileged users. Prefer per-user installs via the Python install manager. As an alternative mitigation, pre-create the relevant Modules directory at the externally resolved path and restrict write access so unprivileged users cannot plant Modules/setup.local or an alternate Lib tree. Installations where the directory two levels above the Python installation directory has equivalent permissions to the install directory are generally unaffected.

Remediation

Patch, then assume compromise.

Upgrade to vendor-fixed releases where available. The issue affects CPython up to and including 3.11.15, 3.12.13, 3.13.14, 3.14.6, and 3.15.0b2. On Windows, migrate away from the legacy all-users EXE installer to the newer Python install manager using current-user installs. Python indicated that only 3.13 and 3.14 will receive updated legacy installers; earlier affected branches receive fixes only in source form. Future Python releases will remove the VPATH fallback behavior and rely on pybuilddir.txt for in-tree builds.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

ACTIVITY FEED

Recent activity

9 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.

No news coverage yet. Advisories and community discussion only.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity8

Community discussion across Reddit, Mastodon, and other social sources.