Tarsafe is a drop-in replacement for the tarfile module from the standard library to safely handle the vulnerable extractall()
method. Inspired by a 6 year old security bug.
$ pip install tarsafe
import sys
from tarsafe import TarSafe
tar = TarSafe.open(sys.argv[1], "r")
tar.extractall()
tar.close()