Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use TarSafe for extracting backup tarball
The tarfile.extractall() command is vulnerable to path traversal, which may be exploited by adding a member with an "../" path to the tarball. In our case, this might open up the possibility of malicious data injection to someone that doesn't normally have access to the Open edX cluster, but does have write access to the S3 bucket. In that case, bad things could happen upon extraction of a thus-crafted archive, during an automated restore. This shouldn't have particularly wide-ranging implications since the only filesystem affected by such an attack would be the restore job's container, which is by definition short-lived. And an attacker with access to the S3 bucket could already do far greater damage to the Open edX installation by simply modifying the MongoDB or MySQL data contained in the tarball. Still, it does not hurt to use a safer (if slightly slower) approach that is provided by the tarsafe module. References: python/cpython#73974 https://mail.python.org/pipermail/python-dev/2007-August/074290.html https://nvd.nist.gov/vuln/detail/CVE-2007-4559
- Loading branch information