It was reported [1] that distutils would create ~/.pypirc insecurely. There is a race from the time the user's username and password is written to the file to when it is chmod'd with appropriate permissions. Typically, a user's home directory will be created with default 0700 permissions which would not allow for a local attacker to obtain access to this file during the race window, however if a user were to make their home directory 0755 they could be susceptible to this race. One solution would be to use tempfile.mkstemp() to create the file and then move it in place. [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650555
Statement: The Red Hat Security Response Team has rated this issue as having low security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.
Also, the pypi support seems to only be available in python 2.6 and higher, so earlier versions are unaffected.
I've reported this upstream: http://bugs.python.org/issue13512 I don't believe this issue is significant enough (particularly due to the default of home directories being mode 0700) to warrant more than that.
Upstream patch to go into 2.7.4: http://bugs.python.org/file23824/pypirc-secure.diff
This does in fact affect RHEL5 and earlier; the vulnerable code is in Lib/distutils/command/register.py.
Created attachment 573152 [details] proposed patch to correct the flaw This patch should correct the flaw in python 2.4.x.
Corrected CVE number as per http://www.openwall.com/lists/oss-security/2012/03/27/10
Created python tracking bugs for this issue Affects: fedora-all [bug 808303]
Created python3 tracking bugs for this issue Affects: fedora-all [bug 808304]
Created python26 tracking bugs for this issue Affects: epel-5 [bug 808305]
This issue has been addressed in following products: Red Hat Enterprise Linux 6 Via RHSA-2012:0744 https://rhn.redhat.com/errata/RHSA-2012-0744.html
This issue has been addressed in following products: Red Hat Enterprise Linux 5 Via RHSA-2012:0745 https://rhn.redhat.com/errata/RHSA-2012-0745.html