Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 14 Dec 2013 00:07:06 -0700
From: Kurt Seifried <>
Subject: Re: Re: Issue with PYTHON_EGG_CACHE

Hash: SHA1

On 12/09/2013 04:39 PM, wrote:
>> Python .egg files can be loaded dynamically as dependencies. In
>> order to process native DSO in .egg distributions the content of
>> the file is unpacked. By default Python unpacks the files to
>> $HOME/.python-eggs however this 'egg cache' directory can be
>> overwritten by setting the environment variable
>> It is common practice to set this to a world writeable directory
>> such as /tmp in the instances where the user the process is
>> executing as does not have a home directory (e.g. httpd).
>> Unfortunately the extraction is done in such a way that the
>> extraction path for the DSO is deterministic. As such it exposes
>> a TOCTOU attack vector where a user my pre-emptively injecting a
>> specially crafted DSO to achieve arbitrary code execution and
>> potentially privilege escalation.
>> The current version of setuptools attempts to mitigate this
>> threat by a number of additional integrity checks in conjunction
>> with issuing a warning if the extract directory is group or world
>> writeable.
>> This fix was introduced in version 0.6.46 of Python setuptools 
>> (
> This report didn't have enough information to assign any CVE IDs.
> When you say "It is common practice to set this to a world
> writeable directory such as /tmp in the instances where the user
> the process is executing as does not have a home directory (e.g.
> httpd)," can you describe where this common practice is observed?
> It seems likely that a separate CVE ID could be assigned for each
> application that follows this unsafe practice, as long as the
> application is an open-source product intended for deployment at
> multiple arbitrary sites.
> Looking at this from the perspective of setuptools "Issue a warning
> if the PYTHON_EGG_CACHE or otherwise customized egg cache location 
> specifies a directory that's group- or world-writable," this seems
> to be a security improvement, not a vulnerability fix. Accordingly,
> a CVE ID would probably not be assigned with setuptools as the 
> affected/responsible product.

Lots of code does this:

OpenStack swift:
"""Try to increase resource limits of the OS. Move PYTHON_EGG_CACHE to
os.environ['PYTHON_EGG_CACHE'] = '/tmp'

Google search:

PYTHON_EGG_CACHE "/tmp" filetype:py

- -- 
Kurt Seifried Red Hat Security Response Team (SRT)
PGP: 0x5E267993 A90B F995 7350 148F 66BF 7554 160D 4553 5E26 7993
Version: GnuPG v1.4.15 (GNU/Linux)


Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.