PyPi: Pip

CVE-2019-20916

Safety vulnerability ID: 38765

This vulnerability was reviewed by experts

The information on this page was manually curated by our Cybersecurity Intelligence Team.

Created at Sep 04, 2020 Updated at Oct 27, 2024
Scan your Python projects for vulnerabilities →

Advisory

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.

Affected package

pip

Latest version: 24.3.1

The PyPA recommended tool for installing Python packages.

Affected versions

Fixed versions

Vulnerability changelog

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

Resources

Use this package?

Scan your Python project for dependency vulnerabilities in two minutes

Scan your application

Severity Details

CVSS Base Score

HIGH 7.5

CVSS v3 Details

HIGH 7.5
Attack Vector (AV)
NETWORK
Attack Complexity (AC)
LOW
Privileges Required (PR)
NONE
User Interaction (UI)
NONE
Scope (S)
UNCHANGED
Confidentiality Impact (C)
NONE
Integrity Impact (I)
HIGH
Availability Availability (A)
NONE

CVSS v2 Details

MEDIUM 5.0
Access Vector (AV)
NETWORK
Access Complexity (AC)
LOW
Authentication (Au)
NONE
Confidentiality Impact (C)
NONE
Integrity Impact (I)
PARTIAL
Availability Impact (A)
NONE