Skip to content
Path traversal Write-up Advanced

Tarmageddon: RCE vulnerability highlights challenges of open source abandonware

A TAR parsing library mishandled size fields when PAX and ustar headers disagreed, letting an attacker hide extra files inside a nested archive. An attacker could overwrite configuration files during extraction, potentially leading to remote code execution or bypassing security scans.

edera.dev

Published on edera.dev

The Edera team has uncovered a critical boundary-parsing bug, dubbed TARmageddon (CVE-2025-62518), in the popular async-tar Rust library and its deep lineage of forks, including the widely used tokio-tar. In the worst-case scenario, this vulnerability has a severity of 8.1 (High) and can lead to Remote Code Execution…

The author, on edera.dev

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 (zero) instead of the PAX header's size to advance the stream, causing misalignment and allowing nested archive entries to be treated as outer entries.

Impact

An attacker could overwrite files during extraction, potentially leading to remote code execution or bypassing security scans; the text notes that some downstream projects were not affected because they did not use the vulnerable extraction functionality.

What the attacker needed

Victim extracts a crafted TAR; uses vulnerable library version

The fix

The parser should prioritise PAX headers for size determination, validate header consistency, and implement strict boundary checking; patches were provided for some forks but the most popular fork remains unpatched.

How it was found

  1. Create a TAR file with a file entry that has both PAX and ustar headers.
  2. Set the PAX header to the actual file size and the ustar header to zero size.
  3. Place a nested TAR archive as the file data.
  4. Extract the outer TAR with the vulnerable library, which misinterprets the inner archive's entries as part of the outer archive.

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 other files, and each file has a label saying how big it is. This library trusted the wrong label when two labels disagreed, so it skipped over a hidden inner box and treated the files inside as if they were part of the outer box. That let an attacker sneak in extra files that could replace important settings.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.