PYSEC-2020-173: High severity pypi/pip vulnerability

Published Sep 4, 2020
·
Updated

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/authorizedkeys file. This occurs in downloadhttpurl in internal/download.py.

Affected Software

1 affected component
pypi/pip<19.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip to a version that resolves this vulnerability.

    Fixed in 19.2

Event History

Sep 4, 2020
CVE Published
via OSV·08:15 PM
Data Sourced
via OSV·08:15 PM
DescriptionSeverity

Frequently Asked Questions

1

What conditions are required to exploit this issue?

An attacker needs to cause pip to install from a URL that returns a Content-Disposition header containing a filename with directory-traversal sequences such as ../. No authentication or user interaction is required according to the supplied CVSS vector.

2

Which systems are exposed?

Systems using pip versions before 19.2 are affected when pip is used to install a package from a URL. The impact depends on the permissions of the account running pip; the example shows that a root-run installation could overwrite /root/.ssh/authorized_keys.

3

What should be done if an immediate upgrade is not possible?

Avoid using affected pip versions to install packages directly from URLs, particularly URLs not fully controlled by the organization. Do not run such installations as root, since file overwrites occur with the privileges of the pip process.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203