Executive brief
pip, the standard package installer for Python, is vulnerable to a flaw that allows malicious software packages to install files in unauthorized locations on a user's computer. By tricking a user or automated system into installing a specially crafted Python package, an attacker could overwrite system files or place malicious scripts in sensitive directories. This could lead to full system compromise or persistent access to the affected machine.
Technical details
A path traversal vulnerability exists in pip's handling of 'console_scripts' and 'gui_scripts' entry points. The root cause is a failure to sanitize entry point names, which pip treats as paths rather than simple filenames when resolving absolute installation paths. An attacker can exploit this by creating a malicious Python package with entry point names containing directory traversal sequences (e.g., '../'). When a user installs this package via pip, the installer will write executable scripts to arbitrary locations on the filesystem, provided the user running pip has the necessary permissions. This can be used to achieve local privilege escalation or persistence by overwriting known binaries or placing scripts in startup directories. The issue is fixed in pip version 26.1.2.
Affected products
- Python Software Foundation pip < 26.1.2
Timeline
- 2026-05-20: patched: Fix merged into pip main branch
- 2026-06-01: disclosed: Public disclosure and CVE assignment
- 2026-06-01: advisory: GitHub Advisory published
References
- https://github.com/pypa/pip/pull/14000
- https://mail.python.org/archives/list/security-announce@python.org/thread/YV63UET5D3OOJY7O4M5XCVYO2YM4NBYJ
- http://www.openwall.com/lists/oss-security/2026/06/01/5
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-8643.json
- https://github.com/pypa/advisory-database/tree/main/vulns/pip/PYSEC-2026-196.yaml