Bug 968059 (CVE-2013-1629)

Summary: CVE-2013-1629 python-pip: insecure installation mechanism
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: metherid, tflink
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=moderate,public=20120104,reported=20130528,source=debian,cvss2=4.4/AV:L/AC:M/Au:N/C:P/I:P/A:P,fedora-all/python-pip=notaffected,epel-5/python-pip=affected,epel-6/python-pip=affected
Fixed In Version: python-pip 1.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-29 00:21:00 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 968061, 968060    
Bug Blocks:    

Description Vincent Danen 2013-05-28 18:58:52 EDT
It was reported [1],[2] that pip, a package installer for Python modules, would retrieve code to install in an insecure manner.  When pip is used to install a module, that code is retrieved from the internet and then, in the presence of setup.py, is executed.  If pip is used as root (e.g. "sudo pip install [module]"), then this code is executed with root permissions.  Because pip does not do TLS certificate verification, or package verification, it is trivial for an attacker to perform a MitM attack and cause the user attempting to install a module to execute arbitrary code.

As of version 1.3, pip provides SSL certificate verification over HTTPS [3],[4].


[1] https://github.com/pypa/pip/issues/425
[2] http://www.reddit.com/r/Python/comments/17rfh7/warning_dont_use_pip_in_an_untrusted_network_a/
[3] https://github.com/pypa/pip/pull/791/files
[4] http://www.pip-installer.org/en/latest/logic.html#ssl-certificate-verification
Comment 1 Vincent Danen 2013-05-28 19:00:10 EDT
Created python-pip tracking bugs for this issue

Affects: fedora-all [bug 968060]
Affects: epel-all [bug 968061]
Comment 2 Tim Flink 2013-05-28 23:50:10 EDT
python-pip 1.3 is already stable in all current fedora releases (17, 18, 19, rawhide) and el6.

python-pip upstream has a minimum python version requirement of 2.6, so the fix for el5 is a bit tougher but I'll take a look to see what's reasonable there.
Comment 3 Vincent Danen 2013-05-29 00:18:47 EDT
Thanks, Tim.  I realized that the manifest I looked at initially is out of date, so I looked at koji and just now realized that 1.3.1 is already in there.

If it's possible to fix in EPEL5, fantastic.  If it's not then it is what it is; looking at the changeset it's quite significant so might be understandably difficult.  Thank you for taking a look at it, however!
Comment 4 Vincent Danen 2013-05-29 00:21:00 EDT
Closing this bug as the epel5 tracker is sufficient for its purpose.
Comment 5 Tomas Hoger 2015-01-14 07:28:19 EST
Upstream changelog lists this as fixed in 1.3:

SSL Cert Verification; Make https the default for PyPI access. Thanks James Cleveland, Giovanni Bajo, Marcus Smith and many others (PR #791, CVE-2013-1629).

https://pip.pypa.io/en/latest/news.html
https://github.com/pypa/pip/pull/791
https://github.com/pypa/pip/pull/789