Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. tar
  4. ›
  5. CVE-2018-20990

CVE-2018-20990: Arbitrary file overwrite in tar-rs

August 25, 2021 (updated June 13, 2023)

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.

References

  • github.com/advisories/GHSA-2367-c296-3mp2
  • github.com/alexcrichton/tar-rs
  • github.com/alexcrichton/tar-rs/commit/54651a87ae6ba7d81fcc72ffdee2ea7eca2c7e85
  • github.com/alexcrichton/tar-rs/pull/156
  • nvd.nist.gov/vuln/detail/CVE-2018-20990
  • rustsec.org/advisories/RUSTSEC-2018-0002.html

Code Behaviors & Features

Detect and mitigate CVE-2018-20990 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.4.16

Fixed versions

  • 0.4.16

Solution

Upgrade to version 0.4.16 or above.

Impact 7.5 HIGH

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-59: Improper Link Resolution Before File Access ('Link Following')

Source file

cargo/tar/CVE-2018-20990.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:52 +0000.