rustsec-2026-0067
Vulnerability from osv_rustsec
Published
2026-03-19 12:00
Modified
2026-03-23 09:31
Summary
`unpack_in` can chmod arbitrary directories by following symlinks
Details

In versions 0.4.44 and below of tar-rs, when unpacking a tar archive, the tar crate's unpack_dir function uses fs::metadata() to check whether a path that already exists is a directory. Because fs::metadata() follows symbolic links, a crafted tarball containing a symlink entry followed by a directory entry with the same name causes the crate to treat the symlink target as a valid existing directory — and subsequently apply chmod to it. This allows an attacker to modify the permissions of arbitrary directories outside the extraction root.

This issue has been fixed in version 0.4.45.


{
  "affected": [
    {
      "database_specific": {
        "categories": [],
        "cvss": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N",
        "informational": null
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [
            "tar::Entry::unpack",
            "tar::Entry::unpack_in"
          ],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "tar",
        "purl": "pkg:cargo/tar"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "0.4.45"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [
    "CVE-2026-33056",
    "GHSA-j4xf-2g29-59ph"
  ],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "In versions 0.4.44 and below of tar-rs, when unpacking a tar archive, the tar\ncrate\u0027s `unpack_dir` function uses [`fs::metadata()`][fs-metadata] to check\nwhether a path that already exists is a directory. Because `fs::metadata()`\nfollows symbolic links, a crafted tarball containing a symlink entry followed\nby a directory entry with the same name causes the crate to treat the symlink\ntarget as a valid existing directory \u2014 and subsequently apply chmod to it. This\nallows an attacker to modify the permissions of arbitrary directories outside\nthe extraction root.\n\nThis issue has been fixed in version 0.4.45.\n\n[fs-metadata]: https://doc.rust-lang.org/std/fs/fn.metadata.html",
  "id": "RUSTSEC-2026-0067",
  "modified": "2026-03-23T09:31:59Z",
  "published": "2026-03-19T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/tar"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2026-0067.html"
    }
  ],
  "related": [],
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "`unpack_in` can chmod arbitrary directories by following symlinks"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…