Case Study: TARmageddon — CVE-2025–62518 and the Supply Chain
A TAR parser in async Rust libraries mishandled PAX extended headers, using the ustar size field instead of the PAX override to calculate the next archive boundary. An attacker could craft a TAR archive that appears harmless to one parser but extracts hidden entries in the vulnerable parser, potentially leading to supply chain attacks.
Published on medium.com
Rust has built a strong reputation around memory safety. It eliminates entire categories of bugs that are common in C and C++: use-after-free, double free, buffer overflows, and many forms of undefined behavior.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The parser used the ustar header's size field to calculate the next archive boundary even when a PAX extended header had overridden the size, causing desynchronization.
Impact
An attacker could craft a TAR archive that extracts differently in vulnerable parsers, potentially leading to file overwriting, build backend hijacking, container image poisoning, or bill-of-materials bypasses, though real exploitability depends on how the library is used.
What the attacker needed
Application extracts untrusted TAR files; vulnerable parser library used
The fix
The vulnerability was fixed in astral-tokio-tar version 0.5.6 by applying PAX overrides before calculating archive boundaries; tokio-tar has no patched versions and should be replaced.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
TAR files are like boxes that hold many files. This bug made some Rust programs that open TAR files get confused about where one file ends and the next begins, so they could see extra hidden files that other programs do not see. An attacker could use this to sneak malicious files past security checks.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.