alexcrichton/tar-rs · Security
Links in archive can create arbitrary directories
- GHSA ID
- GHSA-62jx-8vmh-4mcw
- CVE ID
- CVE-2021-38511
- Severity
- high
- Published
- Updated
- CVSS
- 7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- CVSS v3
- 7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Description
When unpacking a tarball that contains a symlink the tar crate may create directories outside of the directory it's supposed to unpack into. The function errors when it's trying to create a file, but the folders are already created at this point.
CWEs
- CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-38511 ↗
- https://github.com/alexcrichton/tar-rs/issues/238 ↗
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tar/RUSTSEC-2021-0080.md ↗
- https://rustsec.org/advisories/RUSTSEC-2021-0080.html ↗
- https://github.com/alexcrichton/tar-rs/pull/259 ↗
- https://github.com/advisories/GHSA-62jx-8vmh-4mcw ↗