You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a replay or freeze attack, we prevent pip from seeing updates by replaying previous metadata or data. This means that users will not be able to see the latest security updates to packages.
First, we set up the virtual environment (for cleanroom testing) and install pip-without-TUF:
$ cd /tmp
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz
$ tar xvfz virtualenv-1.10.1.tar.gz
$ python virtualenv-1.10.1/virtualenv.py --no-site-packages replay-without-tuf
$ source replay-without-tuf/bin/activate
First, suppose the attackers on PyPI show you the current FooBar (0.2):
Finally, when you try to upgrade FooBar, suppose the attackers on PyPI froze the current FooBar (0.2):
# Fast-forward system clock to the future.
$ sudo date --set="Sep 1 01:54:38 UTC 2014"
$ pip install FooBar --upgrade --index-url http://mirror1.poly.edu/test-pip/replay/repository.current/targets/simple/
Requirement already up-to-date: FooBar in ./replay-without-tuf/lib/python2.7/site-packages
Cleaning up...
# Return system clock to a current time.
$ sudo ntpdate-debian