Volker Braun discovered a serious security vulnerability in Sage when
doctesting sage/tests/cmdline.py
Until this is fixed, *do not run Sage doctests on shared systems*.
Doctesting individual files, different from sage/tests/cmdline.py should
still be okay.
ISSUE:
The problem is really due to a bad Python design decision (this should
be and will be reported upstream): when running a script like
$ python /path/to/script.py
then /path/to is added in front of sys.path, so any
$ import some_module
statement in /path/to/script.py will /first/ look in the directory
/path/to for some_module. This is problematic if the script lives in
/tmp because any user can put files there. Python does not check for
this. It happens that sage/tests/cmdline.py does create a Sage script
in /tmp, exposing this vulnerability.
WHAT TO DO NOW:
* if you're a Sage user: go ahead as usual. As long as you don't
doctest the Sage library, you should be safe.
* if you're a Sage developer: unless nobody else can log in to your
system, do not run anything like "make ptestlong" or "./sage -t
devel/sage/sage". Consider deleting sage/tests/cmdline.py from your
Sage installation.
* if you're a sysadmin: run the following script to temporarily prevent
this hole from being exploited on your system:
http://boxen.math.washington.edu/home/jdemeyer/plug13579.sh
(this writes some files in /tmp so be careful when /tmp is cleaned
either by a tmp-cleaner or on system startup)
All credit to Volker Braun for discovering this issue!
See also
http://trac.sagemath.org/sage_trac/ticket/13579