-
Notifications
You must be signed in to change notification settings - Fork 4.7k
change untar to use unpack instead of unpack_in #19216
Conversation
7366e5c
to
434100c
Compare
Codecov Report
@@ Coverage Diff @@
## master #19216 +/- ##
=========================================
- Coverage 82.9% 82.9% -0.1%
=========================================
Files 455 455
Lines 129382 129417 +35
=========================================
+ Hits 107322 107346 +24
- Misses 22060 22071 +11 |
@CriesofCarrots |
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.35 to 0.4.37. - [Release notes](https://github.com/alexcrichton/tar-rs/releases) - [Commits](alexcrichton/tar-rs@0.4.35...0.4.37) --- updated-dependencies: - dependency-name: tar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Passed ✅ Is it ready for a close look? |
I'm not confident in the sanitization partial port that I did. This has been a side project. Having someone else look at it would be swell. |
Here is the code we're adapting: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this @jeffwashington . Implementation looks good to me; one nit and a couple ideas about more explicit documentation
Co-authored-by: Tyera Eulberg <[email protected]>
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* change untar to use unpack instead of unpack_in * hacky, but maybe passes tests * chore: bump tar from 0.4.35 to 0.4.37 Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.35 to 0.4.37. - [Release notes](https://github.com/alexcrichton/tar-rs/releases) - [Commits](alexcrichton/tar-rs@0.4.35...0.4.37) --- updated-dependencies: - dependency-name: tar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * [auto-commit] Update all Cargo lock files * cleanup * cleanup, add validate_inside_dst * collapse use Co-authored-by: Tyera Eulberg <[email protected]> * delete comment line * add comments Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot-buildkite <[email protected]> Co-authored-by: Tyera Eulberg <[email protected]> (cherry picked from commit 89a31ff) # Conflicts: # Cargo.lock # download-utils/Cargo.toml # install/Cargo.toml # programs/bpf/Cargo.lock # runtime/Cargo.toml # sdk/cargo-build-bpf/Cargo.toml
…9340) * change untar to use unpack instead of unpack_in (#19216) * change untar to use unpack instead of unpack_in * hacky, but maybe passes tests * chore: bump tar from 0.4.35 to 0.4.37 Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.35 to 0.4.37. - [Release notes](https://github.com/alexcrichton/tar-rs/releases) - [Commits](alexcrichton/tar-rs@0.4.35...0.4.37) --- updated-dependencies: - dependency-name: tar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * [auto-commit] Update all Cargo lock files * cleanup * cleanup, add validate_inside_dst * collapse use Co-authored-by: Tyera Eulberg <[email protected]> * delete comment line * add comments Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot-buildkite <[email protected]> Co-authored-by: Tyera Eulberg <[email protected]> (cherry picked from commit 89a31ff) # Conflicts: # Cargo.lock # download-utils/Cargo.toml # install/Cargo.toml # programs/bpf/Cargo.lock # runtime/Cargo.toml # sdk/cargo-build-bpf/Cargo.toml * Fix conflicts Co-authored-by: Jeff Washington (jwash) <[email protected]> Co-authored-by: Tyera Eulberg <[email protected]>
Problem
tar crate changed its behavior as part of a security update. An internal call in
unpack_in
call was changed from:fs::create_dir_all(...)
// does NOT return error if path already existsto
fs::create_dir(...)
// returns error if path already existsThe goal was to fix a security hole where items could be unpacked in folders outside the destination folder.
There are possibly concerns with how we unpack to several configurable directories, which may be on different drives completely. That would seem to also trigger an error.
This pr switches from using unpack_in to unpack so that we control sanitizing.
#19175
tar crate change
PR by @CriesofCarrots against tar crate
Summary of Changes
Closes #19230