Skip to main content

A safe subclass of the TarFile class for interacting with tar files. Can be used as a direct drop-in replacement for safe usage of extractall()

Project description

# Tarsafe
![Unit Tests](https://github.com/beatsbears/tarsafe/workflows/Unit%20Tests/badge.svg)

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](https://bugs.python.org/issue21109).

## Installation
```
$ pip install tarsafe
```

## Usage
```
from tarsafe import TarSafe

tar = TarSafe.open("example.tar", "r")
tar.extractall()
tar.close()

# OR

with TarSafe.open("example.tar", "r") as tar:
tar.extractall()
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tarsafe-0.0.5.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

tarsafe-0.0.5-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file tarsafe-0.0.5.tar.gz.

File metadata

  • Download URL: tarsafe-0.0.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.3

File hashes

Hashes for tarsafe-0.0.5.tar.gz
Algorithm Hash digest
SHA256 cbdffc260d8a33f0e35ed7b70b2e2f56ad40e77019e5384bbe1cfc1ccccac79a
MD5 35a71973350f90e3025cd24fa639eb0a
BLAKE2b-256 17a37787b1103146248f365528f1a4870e5d6c79c82175a1f8b5117617621bf3

See more details on using hashes here.

File details

Details for the file tarsafe-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: tarsafe-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.3

File hashes

Hashes for tarsafe-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6aa8255c181d6070db3b083f6d969602c6306ba3dc7c836a288cc26a5c5bff
MD5 f9cee331913dd06a6b1450facf5be695
BLAKE2b-256 f18c4aadcd0eca9001266ef026338df159cc5f75483abea8f9f97e2dc2fd705f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page