Safety vulnerability ID: 38765
The information on this page was manually curated by our Cybersecurity Intelligence Team.
Versions of Pip prior to 19.2 are vulnerable to a directory traversal attack during the installation process from a URL. This vulnerability stems from improperly handling filenames in the Content-Disposition header that include path traversal sequences, potentially allowing unauthorized overwrite of critical files such as /root/.ssh/authorized_keys. The flaw is specifically found in the _download_http_url function within _internal/download.py.
Latest version: 24.3.1
The PyPA recommended tool for installing Python packages.
The pip package before 19.2 for Python allows Directory Traversal when a URL is given in an install command, because a Content-Disposition header can have ../ in a filename, as demonstrated by overwriting the /root/.ssh/authorized_keys file. This occurs in _download_http_url in _internal/download.py.
MISC:https://github.com/gzpan123/pip/commit/a4c735b14a62f9cb864533808ac63936704f2ace: https://github.com/gzpan123/pip/commit/a4c735b14a62f9cb864533808ac63936704f2ace
MISC:https://github.com/pypa/pip/compare/19.1.1...19.2: https://github.com/pypa/pip/compare/19.1.1...19.2
MISC:https://github.com/pypa/pip/issues/6413: https://github.com/pypa/pip/issues/6413
Scan your Python project for dependency vulnerabilities in two minutes
Scan your application