# CVE-2019-20916: Path Traversal in pip

> Attackers can overwrite critical files like SSH keys via directory traversal in pip, leading to code execution or privilege escalation.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Sep 2020
- **Updated:** 5 Aug 2024
- **Also known as:** CLSA-2026-1772756023, DEBIAN-CVE-2019-20916, DLA-2370-1, GHSA-gpvv-69j7-gwj8, PYSEC-2020-173, RHSA-2020:4432, RHSA-2022:5234, ROOT-APP-PYPI-CVE-2019-20916, SUSE-SU-2020:2698-1, SUSE-SU-2020:2726-1, SUSE-SU-2020:2784-1, SUSE-SU-2020:3016-1, SUSE-SU-2020:3565-1, SUSE-SU-2020:3566-1, SUSE-SU-2020:3593-1, SUSE-SU-2020:3594-1, SUSE-SU-2020:3596-1, SUSE-SU-2020:3597-1, SUSE-SU-2020:3599-1, SUSE-SU-2020:3737-1, SUSE-SU-2020:3765-1, SUSE-SU-2021:0344-1, SUSE-SU-2022:1454-1, SUSE-SU-2023:0516-2, UBUNTU-CVE-2019-20916, USN-4601-1, openSUSE-SU-2020:1598-1, openSUSE-SU-2020:1613-1, openSUSE-SU-2020:2143-1, openSUSE-SU-2020:2152-1, openSUSE-SU-2020:2169-1, openSUSE-SU-2020:2184-1, openSUSE-SU-2020:2185-1, openSUSE-SU-2020:2189-1, openSUSE-SU-2020:2190-1, openSUSE-SU-2020:2211-1, openSUSE-SU-2024:11272-1, openSUSE-SU-2024:14029-1

## What is CVE-2019-20916?

CVE-2019-20916 is a high-severity path traversal vulnerability in Debian Debian Linux, published on 4 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2019-20916?

3 open source packages ship an affected version, including pip. It affects 5 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pip` | PyPI | All versions | 19.2 |
| `pip` | PyPI | All versions | 19.2 |
| `pip` | PyPI | All versions | 19.2 |
| `python-virtualenv` | Red Hat:enterprise_linux:7::client | All versions | 0:15.1.0-7.el7_9 |
| `python-virtualenv` | Red Hat:enterprise_linux:7::computenode | All versions | 0:15.1.0-7.el7_9 |
| `python-virtualenv` | Red Hat:enterprise_linux:7::server | All versions | 0:15.1.0-7.el7_9 |
| `python-virtualenv` | Red Hat:enterprise_linux:7::workstation | All versions | 0:15.1.0-7.el7_9 |
| `python3-pip` | Red Hat:enterprise_linux:8::appstream | All versions | 0:9.0.3-18.el8 |
| `platform-python-pip` | Red Hat:enterprise_linux:8::baseos | All versions | 0:9.0.3-18.el8 |
| `python-pip` | Red Hat:enterprise_linux:8::baseos | All versions | 0:9.0.3-18.el8 |
| `python3-pip-wheel` | Red Hat:enterprise_linux:8::baseos | All versions | 0:9.0.3-18.el8 |
| `python` | SUSE:Enterprise Storage 5 | All versions | 2.7.17-28.59.1 |
| `python-base` | SUSE:Enterprise Storage 5 | All versions | 2.7.17-28.59.1 |
| `python-doc` | SUSE:Enterprise Storage 5 | All versions | 2.7.17-28.59.1 |
| `python-setuptools` | SUSE:Enterprise Storage 5 | All versions | 40.6.2-4.18.1 |
| `python3` | SUSE:Enterprise Storage 5 | All versions | 3.4.10-25.58.1 |
| `python3` | SUSE:Enterprise Storage 5 | All versions | 3.4.10-25.63.1 |
| `python3-base` | SUSE:Enterprise Storage 5 | All versions | 3.4.10-25.58.1 |
| `python3-base` | SUSE:Enterprise Storage 5 | All versions | 3.4.10-25.63.2 |
| `python-pip` | SUSE:Enterprise Storage 6 | All versions | 20.0.2-150100.6.18.1 |
| `python-pip-wheel` | SUSE:Enterprise Storage 6 | All versions | 20.0.2-150100.6.18.1 |
| `python-pip` | SUSE:Enterprise Storage 7 | All versions | 20.0.2-150100.6.18.1 |
| `python-pip-wheel` | SUSE:Enterprise Storage 7 | All versions | 20.0.2-150100.6.18.1 |
| `python` | SUSE:HPE Helion OpenStack 8 | All versions | 2.7.17-28.59.1 |
| `python-base` | SUSE:HPE Helion OpenStack 8 | All versions | 2.7.17-28.59.1 |
| `python-doc` | SUSE:HPE Helion OpenStack 8 | All versions | 2.7.17-28.59.1 |
| `python-pip` | SUSE:HPE Helion OpenStack 8 | All versions | 9.0.1-3.3.1 |
| `python-setuptools` | SUSE:HPE Helion OpenStack 8 | All versions | 40.6.2-4.18.1 |
| `python3` | SUSE:HPE Helion OpenStack 8 | All versions | 3.4.10-25.58.1 |
| `python3` | SUSE:HPE Helion OpenStack 8 | All versions | 3.4.10-25.63.1 |
| `python3-base` | SUSE:HPE Helion OpenStack 8 | All versions | 3.4.10-25.58.1 |
| `python3-base` | SUSE:HPE Helion OpenStack 8 | All versions | 3.4.10-25.63.2 |
| `python-pip` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 20.0.2-150100.6.18.1 |
| `python-pip-wheel` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 20.0.2-150100.6.18.1 |
| `python-pip` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 20.0.2-150100.6.18.1 |
| `python-pip-wheel` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 20.0.2-150100.6.18.1 |
| `python` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 2.7.17-7.47.1 |
| `python-base` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 2.7.17-7.47.1 |
| `python-pip` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 10.0.1-3.3.1 |
| `python-pip` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 10.0.1-3.6.1 |

Products: Debian Debian Linux, Opensuse Leap, Oracle Communications Cloud Native Core Network Function Cloud Native Environment, Oracle Communications Cloud Native Core Policy, Pypa Pip.

## How do I fix CVE-2019-20916?

Upgrade pip to 19.2 or later.

## Is CVE-2019-20916 being exploited?

There is no known exploitation of CVE-2019-20916 in the wild and no public exploit code.

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-20916 and fix it if it is affected.

What it is: CVE-2019-20916 is a high-severity path traversal vulnerability in Debian Debian Linux, published on 4 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2019-20916 in the wild and no public exploit code.

Affected packages and fixed versions:
- pip (PyPI): affected all versions; fixed in 19.2
- pip (PyPI): affected all versions; fixed in 19.2
- pip (PyPI): affected all versions; fixed in 19.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2019-20916/ (Markdown: https://insights.sbomify.com/CVE-2019-20916/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-20916
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-20916
- OSV: https://osv.dev/vulnerability/CVE-2019-20916

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-20916/
Summaries are generated and may contain mistakes; the official description above is the record.
