Skip to content

Conversation

@alexcrichton
Copy link
Owner

This crate tries to provide the guarantee that unpack_in won't actually overwrite any files outside of the provided directory. Unfortunately though there's a hole in this logic where a hard link can be used to overwrite an arbitrary file on the filesystem.

This commit fixes this issue by using the preexisting logic for extracting paths outside the destination (including symlinks) to validate the link destination of a hard link.

@alexcrichton alexcrichton merged commit 54651a8 into master Jun 29, 2018
@alexcrichton alexcrichton deleted the protect-hard-links branch June 29, 2018 19:36
matthiaskrgr added a commit to matthiaskrgr/cargo-tree that referenced this pull request Aug 30, 2018
"cargo audit" was showing a vulnerability in tar 0.4.15, this updates to tar v0.4.16.

error: Vulnerable crates found!
ID:  RUSTSEC-2018-0002
Crate:   tar
Version: 0.4.15
Date:    2018-06-29
URL:     alexcrichton/tar-rs#156
Title:   Links in archives can overwrite any existing file
Solution: upgrade to: >= 0.4.16
error: 1 vulnerability found!
matthiasbeyer pushed a commit to science-computing/butido that referenced this pull request Apr 20, 2021
matthiasbeyer pushed a commit to science-computing/butido that referenced this pull request Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant