CVE-2026-1703
Python vulnerability analysis and mitigation

Overview

CVE-2026-1703 is a path traversal vulnerability in Python's pip package manager affecting versions prior to 26.0. When pip installs and extracts a maliciously crafted wheel archive, files may be extracted outside the intended installation directory. The traversal is constrained to directory prefixes of the installation path, limiting — but not eliminating — the potential for harm. It was disclosed on February 2, 2026, and carries a CVSS v4.0 base score of 2.0 (Low), assigned by the Python Software Foundation (GitHub Advisory, ENISA EUVD).

Technical details

The root cause is improper use of Python's os.path.commonprefix() function in pip's is_within_directory() helper (located in src/pip/_internal/utils/unpacking.py), classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). os.path.commonprefix() performs a character-by-character string comparison rather than a path-segment-aware comparison, meaning a directory named /install/child would incorrectly be considered a prefix match for /install/childfoo, allowing files to escape the intended extraction boundary. The fix replaced os.path.commonprefix() with os.path.commonpath(), which correctly compares full path segments (pip PR #13777, pip commit 8e227a9). Exploitation requires an attacker to supply a maliciously crafted wheel file and requires active user interaction (the user must install the package), with attack requirements classified as "present" (i.e., specific conditions must exist).

Impact

Successful exploitation allows an attacker to write files into directories that are prefixes of the installation directory — for example, writing into a parent or sibling directory — but not to arbitrary locations on the filesystem. This limits the practical impact primarily to tampering with configuration files or other non-executable files in parent directories of the installation target, rather than injecting or overwriting executable binaries in typical environments. The confidentiality impact is none; integrity impact is low and scoped to the vulnerable system only, with no availability impact (GitHub Advisory, ENISA EUVD).

Exploitability

There is no known public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the time of reporting (GitHub Advisory). The EPSS score is approximately 0.017%, reflecting very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires user interaction — specifically, a user must actively install a maliciously crafted wheel package — and specific attack conditions must be present, further reducing practical exploitability.

Exploitation steps

  1. Craft a malicious wheel archive: Create a Python wheel (.whl) file containing a file entry with a crafted path that exploits the os.path.commonprefix() flaw — for example, if the installation target is /opt/myapp/child, include a file with the path ../childfoo/malicious.conf to escape into /opt/myapp/childfoo/.
  2. Distribute the malicious package: Host the crafted wheel on a package index, distribute it via a dependency confusion attack, or deliver it directly to the target user (e.g., via a requirements file or direct URL).
  3. Induce the victim to install the package: Social engineer or otherwise cause the target to run pip install <malicious-package> using a vulnerable pip version (< 26.0).
  4. File extraction outside installation directory: During extraction, pip's is_within_directory() check incorrectly validates the crafted path as within the installation directory due to the character-level prefix comparison, allowing the file to be written to the unintended parent/sibling directory.
  5. Achieve objective: The attacker's file (e.g., a configuration file) is written to a directory prefix of the installation path, potentially enabling configuration tampering or setting up conditions for further exploitation (pip PR #13777, pip commit 8e227a9).

Indicators of compromise

  • File System: Unexpected files appearing in directories that are string-prefix siblings of pip installation directories (e.g., /opt/myapp-extra/ when installing to /opt/myapp/); configuration files with unexpected modification timestamps in parent directories of Python package installation paths.
  • Logs: pip installation logs showing extraction of files to paths outside the expected site-packages or virtual environment directory; warnings or errors from pip related to path validation during wheel extraction.
  • Process: pip processes writing files to unexpected filesystem locations during package installation; unusual file creation events in directories adjacent to or parent to Python environment directories.

Mitigation and workarounds

The vulnerability is fixed in pip 26.0, released January 30, 2026, which replaces os.path.commonprefix() with os.path.commonpath() in the wheel extraction path validation logic (pip PR #13777). Users should upgrade pip immediately by running pip install --upgrade pip. As interim mitigations, restrict pip installations to trusted package sources (e.g., private indexes with verified packages), validate wheel integrity before installation, and consider sandboxing pip installations. IBM has released patches for affected products including IBM Cloud Pak for Business Automation (April 2026 iFixes), IBM watsonx Orchestrate Developer Edition, and IBM App Connect Enterprise Certified Container (IBM Advisory, IBM ACE Advisory). Microsoft has also addressed the vulnerability in Azure Linux 3 python-virtualenv packages (Microsoft MSRC).

Community reactions

The fix was authored by Seth Michael Larson (Python Security Developer-in-Residence) and merged into pip's main branch on January 30, 2026, as part of the pip 26.0 release (pip PR #13777). Larson subsequently published a blog post discussing the deprecation of confusing APIs like os.path.commonprefix() in the context of this vulnerability. The issue was also picked up by Linux security news outlets including Pro-Linux.de and LinuxSecurity.com following downstream distribution updates for openSUSE, SUSE, and Amazon Linux.

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59714HIGH7.1
  • Python logoPython
  • cpe:2.3:a:openwebui:open_webui
NoYesAug 13, 2026
CVE-2026-48099HIGH7.1
  • Python logoPython
  • python3-wsgidav+pam
NoYesAug 13, 2026
CVE-2026-45725HIGH7.1
  • Python logoPython
  • compliance-trestle
NoYesAug 13, 2026
CVE-2026-73652HIGH7.1
  • Python logoPython
  • vantage6
NoNoAug 13, 2026
CVE-2026-45774MEDIUM6.9
  • Python logoPython
  • compliance-trestle
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management