Email me

Rust advisories / tar

Vulnerability HighRUSTSEC-2018-0002 · tar

RUSTSEC-2018-0002: Links in archives can overwrite any existing file

Short answerA security vulnerability in the tar crate: Links in archives can overwrite any existing file. High severity (CVSS 7.5). Fixed in 0.4.16: update to a fixed version.

Cratetar
TypeVulnerability
Affected versionsBefore 0.4.16.
Fixed in0.4.16
SeverityHigh, CVSS 7.5
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Published2018-06-29
Last changed2023-11-08
Also known asCVE-2018-20990, GHSA-2367-c296-3mp2

What to do

  1. See which version you have: cargo tree -i tar (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p tar. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example tar = "0.4.16") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

When unpacking a tarball with the unpack_in-family of functions it's intended that only files within the specified directory are able to be written. Tarballs with hard links or symlinks, however, can be used to overwrite any file on the filesystem.

Tarballs can contain multiple entries for the same file. A tarball which first contains an entry for a hard link or symlink pointing to any file on the filesystem will have the link created, and then afterwards if the same file is listed in the tarball the hard link will be rewritten and any file can be rewritten on the filesystem.

This has been fixed in https://github.com/alexcrichton/tar-rs/pull/156 and is published as tar 0.4.16. Thanks to Max Justicz for discovering this and emailing about the issue!

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for tar

Full security history of tar

Up next

Same cratetar: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ