CVE-2007-4559 is a directory traversal vulnerability in Python's standard-library tarfile module. The flaw affects the extract and extractall functions when they process untrusted TAR archives containing member names with relative traversal sequences such as dot-dot path components. Because archive entry paths are not safely constrained to the intended destination directory, a crafted TAR file can cause extraction to write files outside the target extraction path. This is a Zip Slip-style archive extraction flaw related to CVE-2001-1267. The issue can lead to arbitrary file overwrite when a user or application extracts a malicious archive.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
3 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (1 hidden).
This repository is a self-contained Docker lab demonstrating exploitation of CVE-2007-4559 (Python TarSlip) rather than a generic exploit toolkit. The core vulnerable component is vulnerable-api/app.py, a Flask application exposing POST /upload, GET /admin, and GET /health. The exploit path is straightforward: the API saves an uploaded tarball to /tmp/upload.tar.gz, creates /shared/uploads/<uuid>, and calls tarfile.extractall() on attacker-controlled content. In vulnerable mode, no path validation is performed, so a tar member named ../../../etc/passwd escapes the extraction directory and overwrites /etc/passwd. The app’s /admin endpoint intentionally authenticates by reading plaintext credentials from /etc/passwd, so the overwrite plants admin:hacked and converts the file write into an authentication bypass. Repository structure supports a full demo chain. attacker/craft_malicious.py generates two archives: innocent.tar.gz for baseline behavior and tarslip_passwd.tar.gz containing the traversal entry and malicious passwd contents. attacker/demo.py automates the attack workflow: upload archive, probe /admin with HTTP Basic auth, and optionally verify that the fixed configuration blocks the same payload. docker-compose.vulnerable.yml launches the vulnerable API, nginx file server, and attacker container on an isolated bridge network; docker-compose.fixed.yml launches the same app with USE_SAFE_EXTRACTION=true so extractall(..., filter='data') is used. run_demo.sh orchestrates the full demonstration interactively. Main exploit capabilities: crafting a malicious tar.gz archive, exploiting unsafe archive extraction over a web upload endpoint, arbitrary file overwrite via path traversal, and post-overwrite access to a protected admin endpoint. There is no reverse shell or code execution payload in the repository; the demonstrated impact is file overwrite leading to auth bypass. The exploit is operational because it includes working payload generation and an end-to-end driver, but payloads are hardcoded for the lab environment.
This repository contains a proof-of-concept (PoC) exploit for CVE-2007-4559, a long-standing path traversal vulnerability in Python's tarfile module. The main file, 'CVE-2007-4559-PoC.py', demonstrates how a malicious tar archive can be crafted to include a file with a path that escapes the intended extraction directory (e.g., '../../../../../../../..//tmp/passwd.etc'). When a vulnerable extraction is performed (using tarfile.extractall() without path sanitization), the file is written outside the target directory, confirming the vulnerability. The script creates a test file, adds it to a tar archive with a traversal path, extracts the archive, and checks if the file was written to the target location. The README.md provides background on the vulnerability, affected systems (notably Debian 11/12 and Ubuntu 24), and the ongoing risk due to lack of patching in some distributions. The exploit is a local PoC and does not require network access. The repository is structured simply, with one Python exploit script and a markdown readme.
This repository demonstrates a proof-of-concept exploit for CVE-2007-4559, a directory traversal vulnerability in tar file extraction. The main application is a Flask-based web app (src/app.py) that allows users to upload files, including .tar archives, which are extracted into a user-specific directory. The exploit leverages the fact that tar files can contain entries with directory traversal sequences (e.g., '../../flag'), allowing an attacker to write files outside the intended directory. The provided test/poc.py script uploads a malicious tar archive (test/pay.tar) containing a reference to '../../flag', then accesses the extracted file via the /api/access/get_flag endpoint. The repository includes Dockerfile and deployment instructions, a sample 'flag' file, and both the vulnerable application and exploit scripts. The main attack vector is network-based, targeting the /api/upload endpoint. The exploit is a working proof-of-concept and not weaponized, as it requires manual crafting of the tar file and direct interaction with the endpoints.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.