Low severityOSV Advisory· Published Feb 2, 2026· Updated Apr 15, 2026
CVE-2026-1703
CVE-2026-1703
Description
When pip is installing and extracting a maliciously crafted wheel archive, files may be extracted outside the installation directory. The path traversal is limited to prefixes of the installation directory, thus isn't able to inject or overwrite executable files in typical situations.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
pipPyPI | < 26.0 | 26.0 |
Affected products
1Patches
18e227a9be4faMerge pull request #13777 from sethmlarson/commonpath
3 files changed · +4 −1
news/+1ee322a1.bugfix.rst+1 −0 added@@ -0,0 +1 @@ +Use a path-segment prefix comparison, not char-by-char.
src/pip/_internal/utils/unpacking.py+1 −1 modified@@ -83,7 +83,7 @@ def is_within_directory(directory: str, target: str) -> bool: abs_directory = os.path.abspath(directory) abs_target = os.path.abspath(target) - prefix = os.path.commonprefix([abs_directory, abs_target]) + prefix = os.path.commonpath([abs_directory, abs_target]) return prefix == abs_directory
tests/unit/test_utils_unpacking.py+2 −0 modified@@ -412,6 +412,8 @@ def test_unpack_tar_unicode(tmpdir: Path) -> None: (("parent/", "parent/sub"), True), # Test target outside parent (("parent/", "parent/../sub"), False), + # Test target sub-string of parent + (("parent/child", "parent/childfoo"), False), ], ) def test_is_within_directory(args: tuple[str, str], expected: bool) -> None:
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-6vgw-5pg2-w6jpghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-1703ghsaADVISORY
- github.com/pypa/pip/commit/8e227a9be4faa9594e05d02ca05a413a2a4e7735nvdWEB
- github.com/pypa/pip/pull/13777nvdWEB
- mail.python.org/archives/list/security-announce@python.org/thread/WIEA34D4TABF2UNQJAOMXKCICSPBE2DJghsaWEB
- mail.python.org/archives/list/security-announce@python.org/thread/WIEA34D4TABF2UNQJAOMXKCICSPBE2DJ/nvd
News mentions
0No linked articles in our index yet.