Listen to this Post
The vulnerability in `astral-tokio-tar` arises from a desynchronization between the POSIX `ustar` and `PAX` archive formats. Specifically, when parsing a maliciously crafted TAR file, the library incorrectly calculates data boundaries, leading to header desynchronization.
PAX Header Override: The vulnerability exploits a discrepancy where a PAX extended header correctly specifies a file size (e.g., 1MB), but the corresponding `ustar` header contains a size value of zero.
Faulty Stream Advancement: When calculating the position to read the next file entry, the vulnerable parser uses the `ustar` header size (which is 0) instead of the overridden value from the PAX header.
Desynchronization & Smuggling: This miscalculation causes the parser to not advance over the actual file data block. The byte payload from the current file is then misinterpreted as legitimate headers for subsequent archive entries.
Root Cause (Code Level): The vulnerable code logic resembles:
// Vulnerability: Using ustar size without applying PAX overrides let file_size = header.size(); // Returns 0 from the ustar field let next_pos = current_pos + 512 + pad_to_512(file_size); // Advances by 0 bytes
The fixed code correctly applies the PAX size from the pending extended header.
Attacker Goal: An attacker can craft a TAR file where an outer entry’s content begins with valid TAR headers. Due to the desynchronization, `tokio-tar` treats this inner content as new, separate top-level entries.
Differential Behavior: The vulnerability allows an attacker to make archive entries “selectively visible or invisible” during extraction with `astral-tokio-tar` versus other standard `tar` implementations. This is often referred to as a “parsing differential” or “parser differential” vulnerability.
Downstream Impact (e.g., uv): The primary downstream user, uv, was also affected. The vulnerability could allow an attacker to control the extraction of source distributions. In some contexts, this could lead to unexpected filesystem access or arbitrary code execution.
DailyCVE Form
Platform: Rust/Crates.io….
Version: 0.5.5 & earlier….
Vulnerability : Boundary desync…..
Severity: High (8.1)……
date: 2026-05-06……
Prediction: 2026-05-07……..
What Undercode Say:
A successful exploitation, nicknamed “TARmageddon,” would involve a supply chain attack where an attacker replaces a legitimate package in a registry with a maliciously crafted TAR file. The parsing error then triggers during installation, allowing file smuggling.
Exploit:
A proof-of-concept (PoC) crafted malicious TAR file can be created with the following structure:
Conceptual bash command to demonstrate the vulnerability echo "[] Creating malicious PAX/ustar desync archive" printf 'PAX header: size=1000\nustar header: size=0\n[malicious content beginning with 'valid' TAR header]' > malicious.tar When extracted with vulnerable tokio-tar, the inner 'valid' header is treated as a real file
The exact PoC exploit structure would involve binary manipulation of TAR headers, overriding the `size` keyword in a PAX header to desynchronize the parser, causing it to interpret the data segment as a new entry.
Protection from this CVE
Immediate upgrade of the `astral-tokio-tar` dependency in your `Cargo.toml` file:
Update your Cargo.toml dependency from vulnerable versions BEFORE (Vulnerable): astral-tokio-tar = "0.5.5" AFTER (Patched): astral-tokio-tar = "0.5.6" or newer
No other effective workarounds exist for this vulnerability other than upgrading to the patched version.
Impact
If an application or system uses the vulnerable library to extract untrusted TAR archives (a common vector in package managers and build tools), an attacker could smuggle unexpected files onto a victim’s filesystem. This can potentially lead to arbitrary code execution or credential exfiltration, depending on the application’s subsequent handling of the extracted data.
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

