mailing list archives
Issue with PYTHON_EGG_CACHE
From: Grant Murphy <gmurphy () redhat com>
Date: Mon, 09 Dec 2013 09:50:37 +1000
-----BEGIN PGP SIGNED MESSAGE-----
Not sure if this warrants a CVE -
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 PYTHON_EGG_CACHE.
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
The discovery of this issue can be attributed to Dhiru Kohlia and myself.
- - Grant.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
-----END PGP SIGNATURE-----
- Issue with PYTHON_EGG_CACHE Grant Murphy (Dec 09)