CVE-2026-136440 in pip
Summary
by MITRE • 11/24/2026
Python Packaging Authority pip Configuration File Incorrect Permission Assignment Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of Python Packaging Authority pip. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability. User interaction on the part of a target user is also required.
The specific flaw exists within the way configuration files are stored. The issue results from incorrect permissions on files. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of a target user. Was ZDI-CAN-25377.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 11/24/2026
This vulnerability, identified as CVE-2019-20907 and previously tracked under ZDI-CAN-25377, represents a critical local privilege escalation flaw within the Python Packaging Authority's pip package manager. The core of the issue lies in the incorrect permission assignment applied to configuration files generated or modified by pip during its operation on Unix-like operating systems. Specifically, when pip writes configuration data to user-specific directories such as .pip/pip.conf, it fails to restrict access permissions appropriately. Instead of setting restrictive read-write-only permissions for the owning user, the tool often creates these files with overly permissive settings that allow other users on the same system to read or even modify them depending on the specific environment and default umask values. This misconfiguration effectively turns a standard configuration file into an attack vector for lateral movement within a multi-user environment where privilege boundaries are not strictly enforced by the application itself.
The technical flaw stems from pip's handling of file creation modes during the initialization and update processes of its configuration system. When establishing or updating these files, the software does not explicitly enforce restrictive access control lists that would prevent non-privileged users from accessing sensitive information stored within them. In many default Linux distributions, if a process creates a file without specifying explicit permissions, it relies on the system's umask setting. If this value is permissive, other local accounts can gain read access to configuration files that may contain authentication tokens, proxy settings, or trusted host configurations. This lack of strict permission enforcement violates fundamental security principles regarding least privilege and secure default configurations, allowing any user with shell access on the target machine to inspect these files for sensitive data or potentially manipulate them if write permissions are also inadvertently exposed through broader directory permissions.
From an operational impact perspective, this vulnerability facilitates local privilege escalation by enabling attackers to gather intelligence that can lead to further exploitation. While the immediate effect is often information disclosure of configuration details such as PyPI credentials or trusted hosts, these artifacts can be leveraged in conjunction with other vulnerabilities or misconfigurations on the system. For instance, if a user has configured pip to use specific authentication tokens for private repositories, an attacker who gains read access to this file can extract those tokens and potentially upload malicious packages under that user's identity, thereby achieving code execution within the context of that privileged account. Furthermore, in environments where shared development tools are used across multiple accounts with varying levels of trust, reading another user’s pip configuration might reveal network topology details or internal repository structures that aid in broader system compromise.
This vulnerability maps directly to CWE-732: Incorrect Permission Assignment for Critical Resource within the Common Weakness Enumeration framework. It also aligns with MITRE ATT&CK technique T1059, specifically Command and Scripting Interpreter sub-techniques related to local privilege escalation via misconfigured resources. The requirement for an attacker to first obtain low-privileged code execution highlights that this is not a remote exploitation vector but rather a post-exploitation tool used by adversaries who have already breached the perimeter or gained initial access through phishing, web application vulnerabilities, or other entry points. User interaction is typically required in the sense that the victim must have previously executed pip commands to generate these configuration files with insecure permissions, although this interaction often occurs as part of normal development workflows without explicit malicious intent from the user.
Mitigation strategies for this vulnerability focus on both immediate remediation and long-term architectural improvements. Administrators should manually audit existing .pip directories across all user accounts on affected systems and correct file permissions to ensure that configuration files are readable only by their respective owners, typically using chmod 600 or similar restrictive settings. Upgrading pip to versions where this issue has been patched is the primary defense, as newer releases enforce stricter permission checks during file creation. Additionally, organizations should implement strict umask policies across all user accounts on shared systems to ensure that any newly created files default to secure permissions regardless of application behavior. Security teams should also monitor for unusual access patterns to pip configuration directories and consider deploying endpoint detection solutions capable of identifying privilege escalation attempts via misconfigured resource exploitation.