Skip to content

GHSA-xx64-wwv2-hcqq RUSTSEC-2026-0113

astral-tokio-tar: `unpack_in` can chmod arbitrary directories by following symlinks

Low crates.io
Severity
0.0 / 10
Low · CVSS 4.0
Exploit chance (EPSS)
—
No score published
Known exploited
No
Not in CISA's catalog
Weakness
CWE-61 UNIX Symbolic Link (Symlink) Following
Fix
0.6.1
Upgrade astral-tokio-tar to this version or later

Description

Impact

In versions 0.6.0 and earlier of astral-tokio-tar, the unpack_in API could inadvertently modify the permissions of external (i.e. non-archive) directories outside of the archive. An attacker could use this to contrite a tar archive that maliciously changes directory permissions outside of its intended hierarchy. This flaw only affects directories; individual file permissions cannot be modified via it.

See GHSA-j4xf-2g29-59ph for the equivalent flaw in the tar crate.

Patches

Versions 0.6.1 and newer of astral-tokio-tar use fs::symlink_metdata rather than fs::metadata, avoiding the traversal.

Workarounds

Users are advised to upgrade to version 0.6.1 or newer to address this advisory.

Users should experience no breaking changes as a result of the patch above.

Resources

  • GHSA-j4xf-2g29-59ph for the original tar vulnerability

Attribution

  • Reporter: Adam Harvey (@lawngnome)

Affected versions

crates.io

PackageVulnerableFixed in
astral-tokio-tar
< 0.6.1
0.6.1
astral-tokio-tar
>= 0.0.0-0, < 0.6.1
0.6.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

astral-tokio-tar crates.io → 0.6.1

cargo
cargo update -p astral-tokio-tar --precise 0.6.1

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
Low
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None
Exploit maturity
Unreported

Weakness

CWE-61: UNIX Symbolic Link (Symlink) Following

The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.

How to prevent it
  • Implementation: Symbolic link attacks often occur when a program creates a tmp directory that stores files/links. Access to the directory should be restricted to the program as to prevent attackers from manipulating the files.
  • Architecture and Design: Follow the principle of least privilege when assigning access rights to entities in a software system. Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References

Timeline

  1. Published
  2. Last updated by the source
AdvisorySeverityWhy it's related
GHSA-3cv2-h65g-fgmm
astral-tokio-tar has a PAX Header Desynchronization issue
Medium Also affects astral-tokio-tar
GHSA-fp55-jw48-c537
astral-tokio-tar is Vulnerable to PAX Header Desynchronization
Medium Also affects astral-tokio-tar
GHSA-6gx3-4362-rf54
astral-tokio-tar insufficiently validates PAX extensions during extraction
Medium Also affects astral-tokio-tar
GHSA-j5gw-2vrg-8fgx
astral-tokio-tar Vulnerable to PAX Header Desynchronization
High Also affects astral-tokio-tar
GHSA-3wgq-wrwc-vqmv
astral-tokio-tar has a path traversal in tar extraction
Medium Also affects astral-tokio-tar
GHSA-hjqx-j4rw-g7xv
zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.
High Same weakness, CWE-61
GHSA-p8v3-89rh-jxc7
Nginx UI: Backup restore follows crafted symlinks into the live Nginx configuration path before restore flags are applied
High Same weakness, CWE-61
GHSA-f794-5jv7-7672
NLTK: Downloader.download follows hardlinks and overwrites outside-root files
High Same weakness, CWE-61
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor