Don't allow hardlinks to overwrite existing files#156
Merged
Conversation
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: composefs/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
See:
https://rustsec.org/advisories/RUSTSEC-2018-0002.html
composefs/tar-rs#156
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
matthiasbeyer
pushed a commit
to science-computing/butido
that referenced
this pull request
Apr 20, 2021
See:
https://rustsec.org/advisories/RUSTSEC-2018-0002.html
composefs/tar-rs#156
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
(cherry picked from commit c75d620)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This crate tries to provide the guarantee that
unpack_inwon'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.