CVE-2025-4517 is an arbitrary file write/path traversal vulnerability in Python's standard-library tarfile module. When an application extracts an untrusted tar archive via TarFile.extractall() or TarFile.extract() with the extraction filter set to "data" or "tar", a crafted archive can cause files to be written outside the intended extraction directory. The provided context explicitly states that the issue allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data", and notes that Python 3.14+ changed the default filter behavior from no filtering to "data", which can expose applications relying on that default. The issue is described in the context as being related to tarfile handling of symlinks and path traversal during extraction of untrusted archives.
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.
14 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a small standalone local privilege-escalation PoC consisting of one Python exploit script, a README, and .gitattributes. The main file, CVE-2025-4517-POC.py, programmatically builds a malicious tar archive intended to exploit a tarfile extraction weakness by combining deep directory nesting, symlink traversal, and a hardlink write primitive. Its explicit goal is to redirect a file write into /etc/sudoers so the current user receives 'ALL=(ALL) NOPASSWD: ALL'. Operational flow: (1) create_exploit_tar() generates the crafted archive at /tmp/cve_2025_4517_exploit.tar; (2) deploy_and_execute() copies it into /opt/backup_clients/backups/backup_9999.tar and invokes a privileged restore workflow using 'sudo /usr/local/bin/python3 /opt/backup_clients/restore_backup_clients.py -b backup_9999.tar -r restore_pwn_9999'; (3) verify_exploit() checks /etc/sudoers for the injected rule; and (4) get_root_shell() optionally runs 'sudo /bin/bash'. The exploit is purely local: it does not contact remote network services and contains no C2 or callback logic. The key fingerprintable artifacts are filesystem paths and command invocations associated with the target environment, especially /opt/backup_clients/backups, /opt/backup_clients/restore_backup_clients.py, /etc/sudoers, and the temporary tar path in /tmp. The README provides attack rationale, prerequisites, and example sudoers configuration showing the intended target scenario: a user allowed to run the vulnerable restore script as root. Overall, this is an operational PoC for a specific Linux privilege-escalation chain rather than a scanner or detection tool.
Repository contains a single Python proof-of-concept exploit (CVE-2025-4517-POC.py) plus a detailed README. Core purpose: local privilege escalation by abusing a Python tarfile extraction weakness (CVE-2025-4517) using a crafted tar archive that combines (1) deep directory nesting and symlink loops for path confusion, (2) a symlink chain that traverses upward, (3) an “escape” symlink that resolves into /etc, and (4) a hardlink entry that points through the escape symlink to /etc/sudoers. The tar then writes a regular file entry to the hardlink name so the extraction process overwrites /etc/sudoers. Exploit flow implemented in code: - create_exploit_tar(username, output_file): builds the malicious tar with multiple phases (nested dirs + symlinks, traversal symlink, escape symlink to /etc, hardlink to sudoers, then writes a sudoers line granting NOPASSWD:ALL). - deploy_and_execute(tar_file, backup_id=9999): copies the tar to /opt/backup_clients/backups/backup_<id>.tar and triggers extraction by running (with sudo) /usr/local/bin/python3 /opt/backup_clients/restore_backup_clients.py -b backup_<id>.tar -r restore_pwn_<id>. - verify_exploit(username): uses sudo cat /etc/sudoers to confirm the injected line exists. - get_root_shell(): optionally runs sudo /bin/bash. Notable characteristics: - No network functionality; it is a local/CTF-style privesc helper that assumes the user already has sudo rights to run a specific restore script and can place a tar where that script reads it. - The payload effect is persistent privilege escalation by modifying /etc/sudoers. - Repository structure is minimal (2 files) and the Python script is the clear entry point.
Repository contains a single Python exploit script (CVE-2025-4517-POC.py) and a detailed README. The script is a local privilege-escalation PoC/operational exploit that crafts a malicious tar archive designed to bypass tarfile extraction safety checks using a combination of: (1) deep nested long directory names and symlink loops for path confusion, (2) a symlink chain that traverses upward, (3) an 'escape' symlink that ultimately points outside the extraction directory to /etc, (4) a hardlink entry that targets 'escape/sudoers', and (5) a regular file entry written to the same hardlink name so the extracted content is written into /etc/sudoers when extraction runs with elevated privileges. Operational flow implemented by the code: - create_exploit_tar(): builds the tar and embeds a sudoers line granting the current $USER passwordless sudo. - deploy_and_execute(): copies the tar to /opt/backup_clients/backups/backup_<id>.tar and triggers extraction by running (via sudo) /usr/local/bin/python3 /opt/backup_clients/restore_backup_clients.py -b <tar> -r <restore_dir>. - verify_exploit(): reads /etc/sudoers via sudo to confirm the injected rule. - get_root_shell(): optionally runs 'sudo /bin/bash' for a root shell. No network scanning or remote exploitation is present; the exploit relies on a specific privileged tar-extraction workflow on the target host (as described for the HTB WingData scenario).
Repository contains a single Python PoC exploit (CVE-2025-4517.py) and a README describing the vulnerability and usage. Core capability: local privilege escalation via arbitrary file write as root by bypassing Python tarfile’s extraction sandbox (filter="data") using a PATH_MAX (4096) realpath() resolution truncation/confusion. The exploit crafts a tar archive with 16 levels of 247-character directory names and symlinks such that os.path.realpath() stops resolving once the path exceeds PATH_MAX. The tarfile filter validates an unresolved/safe-looking path, but during extraction the kernel resolves the full symlink chain, allowing traversal outside the intended extraction directory. Payload behavior: the crafted tar includes an "escape" symlink that ultimately points to /root, then creates /root/.ssh (0700) and writes /root/.ssh/authorized_keys containing an attacker-controlled SSH public key. The script can generate an ed25519 keypair via ssh-keygen (stored under /tmp/cve_2025_4517_key) or accept a user-supplied public key (-k). Execution flow/structure: - generate_ssh_keypair(): runs ssh-keygen to create a temporary keypair and reads the .pub key. - create_exploit_tar(): builds the malicious tar with deep nesting + symlink chain + file write to escape/.ssh/authorized_keys. - deploy_and_execute(): copies the tar to /opt/backup_clients/backups/backup_<id>.tar and triggers extraction by running (via sudo) /usr/local/bin/python3 /opt/backup_clients/restore_backup_clients.py. - verify_exploit(): attempts SSH to root@localhost using the generated key and runs `id`; optionally execs an interactive SSH session. Target assumptions are explicit and local: the presence of a privileged restore workflow that extracts attacker-controlled tar files using vulnerable Python tarfile with filter="data", plus permissions to place the tar in the backup directory and to invoke the restore script with sudo.
Repository contains a single Python exploit script plus a detailed README. - Files: - CVE-2025-4517-POC.py: Standalone local privilege-escalation exploit builder/runner. - README.md: Background, assumed HTB WingData environment, usage steps, and mitigation guidance. - Core exploit capability: - Crafts a malicious tar archive intended to exploit a Python tarfile extraction weakness (CVE-2025-4517) by combining (1) deep directory nesting for path confusion, (2) a symlink chain that traverses upward, (3) an “escape” symlink that resolves into /etc, and (4) a hardlink that targets /etc/sudoers. - The tar then writes a regular file entry over the hardlink name so that extraction writes attacker-controlled content into /etc/sudoers. - Execution flow (script): 1) create_exploit_tar(): builds /tmp/cve_2025_4517_exploit.tar with symlink/hardlink structure and a sudoers line granting NOPASSWD:ALL to the current $USER. 2) deploy_and_execute(): copies the tar into /opt/backup_clients/backups/backup_<id>.tar and triggers extraction by running (via sudo) /usr/local/bin/python3 /opt/backup_clients/restore_backup_clients.py -b <tar> -r <restore_dir>. 3) verify_exploit(): uses sudo cat /etc/sudoers to confirm the injected rule. 4) get_root_shell(): optionally runs sudo /bin/bash. - Target assumptions (from README and code): - A privileged restore workflow exists that extracts attacker-supplied tar archives using Python’s tarfile (README shows extractall(..., filter="data")). - The attacker can place a tar in /opt/backup_clients/backups and can run the restore script with sudo. - Notable observations: - This is a local privesc helper for a specific environment (HTB WingData) rather than a remote exploit; no C2 or network callbacks are present. - README mentions CLI options like --create-only, but the provided script does not implement argument parsing; actual usage is interactive/automatic as coded.
Repository contains a single Python script (CVE_2025_4517.py) plus a README. The script generates a malicious tar archive intended to exploit a Python tarfile path sanitization/realpath edge case (PATH_MAX-length overflow/"blinding" of security filters) described in the referenced Google Security Research advisory (GHSA-hgqp-3mmf-7h8f). Exploit capabilities: - Produces a crafted tar file that builds a deeply nested directory structure and a chain of symlinks to push path resolution to the edge of PATH_MAX (platform-dependent: shorter on macOS, longer on others). - Introduces a deep-path symlink trigger designed to break or confuse os.path.realpath()-based checks. - Creates a symlink ("escape") that resolves to a path escaping the extraction directory and targeting /etc/sudoers.d/<username>. - Uses a hardlink ("exploit_link") pointing to the escape symlink to bypass tarfile filtering logic, then writes a regular file entry with sudoers content to effect an arbitrary file write. Overall purpose/structure: - CVE_2025_4517.py: command-line tool taking (username, output tar filename) and writing a weaponized tarball. - README.md: explains this is a weaponized variant of the advisory PoC, adapted from writing a benign file to an LPE/persistence scenario by writing a sudoers drop-in. No network activity is present; the exploit is purely local and relies on a privileged extraction of the generated tar archive on a vulnerable Python tarfile implementation.
Repository contains a single Python PoC (poc.py) plus a minimal README and a standard Python .gitignore. The PoC is a tar-archive generator intended for controlled testing of CVE-2025-4517-class issues in tar extraction logic. Core behavior (poc.py): - CLI tool using argparse to generate a crafted tar file to an output directory (default /tmp). - Constructs a chain of tar entries: repeated directory entries and symlinks (steps 'a'..'p') to build a deep path, then creates an additional long symlink path and a key symlink named 'escape' whose link target includes '../' repeated per user-supplied traversal count and the user-supplied target directory path. - Adds a hardlink entry ('flaglink') pointing to 'escape', and finally adds a regular file entry 'escape/<filename>' containing attacker-controlled data. Exploit capability: - Produces a malicious tar that, when extracted by a vulnerable implementation, can cause the regular file payload to be written outside the intended extraction directory (path traversal/arbitrary file write) by abusing symlink/hardlink resolution and traversal sequences. No network activity is present; the only notable endpoints are filesystem paths (default /tmp and attacker-specified target paths).
Repository contains a single Python exploit generator (exploit.py) and a README describing usage. The script does not attack a network service; it produces a malicious tar archive intended to be extracted by a privileged process running a vulnerable Python tarfile implementation (CVE-2025-4138 / CVE-2025-4517, described as PATH_MAX truncation leading to path traversal and filter bypass). Structure & purpose: - README.md: Explains the vulnerability context, affected Python versions (as claimed), and an attack workflow: generate tar, deliver to target, wait for privileged extraction, then gain root via sudo. - exploit.py: Implements the tar crafting logic. It builds (1) a deep directory + symlink chain to inflate resolved path length toward PATH_MAX, (2) a pivot symlink with a very long name to induce early stop/truncation behavior, (3) an 'escape' symlink that ultimately resolves to /etc by combining the pivot path with multiple '../', and (4) a final tar file entry written to 'escape/sudoers.d/<user>' containing a sudoers rule granting NOPASSWD:ALL. File permissions are set to 0440 to satisfy sudoers requirements. Main exploit capabilities: - Arbitrary file write on extraction (via crafted symlink/path traversal conditions) with a concrete privilege-escalation payload. - Automatic selection of target username (defaults to current user via getpass.getuser()) and configurable output path. No external network endpoints, C2, or remote callbacks are present; the only actionable targets are filesystem paths, primarily /etc/sudoers.d/.
Repository purpose: a Python tool (“PyPath-Escape”) that generates a malicious tar archive intended to exploit a PATH_MAX-related symlink filter bypass in Python’s `tarfile` extraction logic (claimed CVE-2025-4138 / CVE-2025-4517). Structure: - `exploit.py` (main code): builds a crafted tar containing a long directory/symlink chain designed to reach near PATH_MAX, then introduces a pivot symlink (`pwn_portal`) that points back up (`../` repeated) and a second symlink (`pwn_escape`) that redirects into an attacker-chosen absolute target directory. Finally, it adds a regular file entry under `pwn_escape/<basename>` whose contents are attacker-supplied bytes from `--payload`. - `README.md`: marketing/description, references GHSA-hgqp-3mmf-7h8f and CPython PR #135037, and claims targeting the above CVEs. - `LICENSE` and `not.md`: legal disclaimers. Exploit capabilities (as implemented): - Produces a .tar that attempts to cause an arbitrary file write outside the intended extraction directory when extracted by vulnerable code. - Includes presets for high-impact targets: - `ssh-key`: writes to `/root/.ssh/authorized_keys` (root persistence). - `cron`: writes to `/etc/cron.d/pwned` (scheduled execution). - `sudoers`: writes to `/etc/sudoers.d/pwned` (privilege escalation). Operational notes: - No network I/O is present; the attack vector is delivery of a malicious archive to a process that extracts it. - Success depends on the victim using a vulnerable `tarfile` extraction path and running extraction with sufficient filesystem privileges.
Repository contains a single Python proof-of-concept exploit script plus documentation. Structure: - CVE-2025-4517-POC.py: Standalone local privilege-escalation exploit. It generates a malicious tar archive designed to bypass Python tarfile’s safety filter ("data") by combining (1) deep nested directories for path confusion, (2) a symlink chain that traverses upward, (3) an “escape” symlink that resolves outside the extraction directory to /etc, (4) a hardlink entry that points through the escape symlink to /etc/sudoers, and (5) a final regular-file member written to the hardlink name so the extractor writes attacker-controlled content into /etc/sudoers. - It then copies the tar to /opt/backup_clients/backups/backup_<id>.tar and triggers extraction by running (via sudo) /usr/local/bin/python3 /opt/backup_clients/restore_backup_clients.py -b <tar> -r <restore_dir>. - After extraction, it verifies success by reading /etc/sudoers and checking for a NOPASSWD entry for the current $USER, and optionally spawns a root shell with `sudo /bin/bash`. - README.md: Explains the CVE, affected versions, the attack flow, and an HTB “WingData” scenario where a user has sudo rights to run the vulnerable restore script and write access to the backups directory. Exploit capabilities: - Primary: local privilege escalation via arbitrary file write as a privileged tar extractor. - Concrete outcome implemented: modifies /etc/sudoers to grant passwordless sudo to the current user, enabling root shell. No network IOCs/endpoints are present in the exploit code itself; all targets are local filesystem paths and local process invocations (cp, sudo, python3, cat, /bin/bash).
Repository contains a working exploit generator for CVE-2025-4517 / CVE-2025-4330 affecting CPython’s tarfile.extractall(filter='data') safety checks. It provides two equivalent implementations (CVE-2025-4517.py and CVE-2025-4517.go) that generate a malicious tar archive (default: backup_99.tar). The exploit abuses a PATH_MAX (4096) overflow edge case in os.path.realpath(strict=False): when the resolved path becomes longer than PATH_MAX, realpath stops resolving symlinks and falls back to string-based path manipulation, causing Python’s tarfile “data” filter to incorrectly conclude a symlink remains within the extraction directory. Exploit structure (both implementations): (1) create 16 nested long-name directories plus 16 short 1-character symlinks (a–p) pointing to the long directories, so the logical path stays short while the resolved path grows; (2) add a 254-character symlink name at the end of the short chain that points back up 16 levels (".." x 16), pushing the resolved path over PATH_MAX; (3) create an 'escape' symlink whose link target traverses the short chain and then includes additional '..' components (DEPTH_TO_ROOT) intended to reach '/', which Python mis-validates due to the realpath fallback; (4) add a regular file entry at 'escape/<TARGET_FILE>' so extraction follows the OS-resolved symlink to write to '/<TARGET_FILE>' (default /root/.ssh/authorized_keys) with attacker-controlled content (default SSH public key placeholder). No network scanning or callbacks are present; the attack vector is delivery of a crafted tar to a workflow that extracts it with a vulnerable Python version. README.md documents affected versions, mechanics, configuration knobs (DEST_DIR/DEPTH_TO_ROOT/TARGET_FILE/PAYLOAD/OUTPUT), and expected post-exploitation outcome (e.g., root SSH access if extraction runs as root).
Repository contains a single Python PoC generator (CVE-2025-4517.py), a README describing CVE-2025-4517 (tarfile extraction bypass when using filter="data"/"tar"), and a GPLv3 LICENSE. Core behavior: the script generates a malicious tarball (evil_backup_cve_2025_4517.tar) designed to achieve an arbitrary write outside the extraction directory when processed by vulnerable tar extraction logic. It does not perform network activity or exploitation itself; it only crafts the archive. Exploit structure (CVE-2025-4517.py): - Phase 1: Builds a deep directory tree using repeated very-long directory names (247 'd' characters) and creates symlinks named a..p that point back to the long directory name, creating confusing/looping resolution behavior. - Phase 2: Creates a long symlink entry at a path like "a/b/c/.../p/llll..." (254 'l' chars) whose link target is "../" repeated 16 times, intended to traverse upward many levels. - Phase 3: Creates an "escape" symlink that points through the long symlink chain and then adds additional "../../.." to reach "/etc". - Phase 4 (key): Adds a hardlink (LNKTYPE) entry "sudoers_link" pointing to "escape/sudoers" so that subsequent writes to "sudoers_link" affect the same inode as the escaped target. - Phase 5: Re-adds "sudoers_link" as a regular file containing a sudoers line granting NOPASSWD sudo to "demouser"; on vulnerable extraction this results in overwriting /etc/sudoers (if permissions allow). Overall purpose: demonstrate a tar extraction path traversal / filter bypass leading to arbitrary filesystem write and potential privilege escalation via configuration overwrite (example target: /etc/sudoers).
Repository contains a single Python exploit generator (exploit.py) plus README and LICENSE. The exploit targets CPython tarfile extraction filter bypass vulnerabilities CVE-2025-4138 and CVE-2025-4517 affecting Python 3.12.0–3.12.10 and 3.13.0–3.13.3 on Linux/macOS. Core capability: it builds a malicious tar archive that abuses a TOCTOU gap between tarfile’s safety checks (which rely on os.path.realpath()) and the kernel’s symlink resolution during extraction. By constructing a deep chain of directories and symlinks whose fully-resolved path exceeds PATH_MAX, os.path.realpath() stops resolving and appends remaining components literally (including traversal like "../"). This allows the archive to pass tarfile’s filter="data"/"tar" checks while still escaping the intended extraction directory at extraction time, resulting in an arbitrary file write to an attacker-chosen absolute path. Operational behavior (from visible code/README): - CLI-driven tool that outputs a tar file (--tar-out) containing crafted symlink/directory entries and a final file entry that is written through the escaped symlink. - Supports direct targeting via --target (absolute path required) and --payload (file content to embed), with optional --mode to set file permissions. - Mentions preset attack modes (PRESETS) and a generator for preset payloads (e.g., SSH authorized_keys injection, cron, sudoers), though the preset definitions are in the truncated portion. - Includes a local Python version check that warns if the generator is run on a patched interpreter; exploitation depends on the target extractor’s Python version. No network C2 or callback endpoints are present; the primary “endpoints” are filesystem targets (e.g., /root/.ssh/authorized_keys, /etc/cron.d/privesc). The exploit is not part of a larger framework (standalone script).
Repository contains a single operational PoC (poc.py) plus a short README describing CVE-2025-4517 (Python tarfile extraction path traversal/arbitrary write when using filter="data" or filter="tar", with Python 3.14 defaulting to "data"). poc.py is an interactive local exploit helper that: 1) Prompts for (a) a username to grant sudo, (b) the path to a vulnerable program/script that performs tar extraction, and (c) a directory where that program will look for the tarball. 2) Builds a malicious tar archive at /tmp/backup_9999.tar using tarfile.TarInfo entries. It creates a deep directory + symlink chain intended to bypass PATH_MAX-related checks, then adds: - a long symlink (linkpath) that points back up the directory chain ("../" repeated), - an "escape" symlink that resolves into /etc, - a hardlink entry "sudoers_link" pointing to escape/sudoers, - and finally a regular file entry also named "sudoers_link" containing a sudoers line for the chosen user, with mode 0440. When extracted by a vulnerable privileged process, this sequence aims to overwrite /etc/sudoers. 3) Moves the tarball into the specified drop directory as backup_9999.tar. 4) Attempts to trigger exploitation by running: sudo /usr/local/bin/python3 <target_prog> -b backup_9999.tar -r restore_getsuga, streaming output with basic colorization. No network IOCs are present; the exploit is purely local and relies on a privileged tar extraction workflow. The primary capability is arbitrary file write leading to privilege escalation via sudoers modification.
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.
37 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A Python tarfile symlink/path traversal vulnerability referenced as related to the Keras issue, affecting tarfile handling of symlinks and path traversal.
A previously referenced tarfile-related vulnerability mentioned as part of Python tarfile's security history; no further details are provided in the content.
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.