CVE-2019-20916
Python vulnerability analysis and mitigation

Overview

The pip package before version 19.2 for Python contains a directory traversal vulnerability (CVE-2019-20916) that was discovered in 2019. The vulnerability occurs when a URL is given in an install command, where a Content-Disposition header can contain '../' in a filename, potentially allowing attackers to overwrite arbitrary files on the system. This vulnerability specifically affects the downloadhttpurl function in internal/download.py (NVD, Debian).

Technical details

The vulnerability has a CVSS v3.1 Base Score of 7.5 (HIGH) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N. The issue stems from improper validation of filenames in the Content-Disposition header during package downloads. When pip downloads a package from a URL, it uses the filename from the Content-Disposition header without properly sanitizing it, allowing directory traversal sequences like '../' to be included (NVD).

Impact

A successful exploitation of this vulnerability could allow an attacker to overwrite arbitrary files on the system with the privileges of the user running pip. For example, if pip is run with root privileges, an attacker could potentially overwrite sensitive files like /root/.ssh/authorized_keys, which could lead to unauthorized system access (GitHub).

Mitigation and workarounds

The vulnerability was fixed in pip version 19.2. Users should upgrade to this version or later to protect against this vulnerability. The fix involves proper sanitization of filenames from Content-Disposition headers to prevent directory traversal attacks (GitHub).

Community reactions

Multiple Linux distributions and software vendors have released security advisories and patches for this vulnerability, including Debian, OpenSUSE, and Oracle. Debian released version 9.0.1-2+deb9u2 to address this issue (Debian), while OpenSUSE provided fixes in their security updates (OpenSUSE).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management