CVE-2007-4559 Patch - #4499
Merged
Merged
Conversation
Contributor
|
@TrellixVulnTeam Thanks for opening this pull request! Please address the corresponding |
moelasmar
previously requested changes
Dec 30, 2022
| with tarfile.open(fileobj=fp, mode="r") as tar: | ||
| tar.extractall(path=to_host_path) | ||
|
|
||
| def is_within_directory(directory, target): |
Contributor
There was a problem hiding this comment.
it is better to move these inner functions to a utility module, and to add unit test cases for them.
hawflau
approved these changes
Jan 4, 2023
torresxb1
approved these changes
Jan 4, 2023
hawflau
added a commit
that referenced
this pull request
Jan 4, 2023
mildaniel
pushed a commit
that referenced
this pull request
Jan 10, 2023
* support lists of source_path dicts * add unit tests for source_path is specified as a list of dicts * fix: update pyopenssl dependency (#4528) * chore(deps): bump setuptools from 54.2.0 to 65.5.1 in /requirements (#4518) Bumps [setuptools](https://github.com/pypa/setuptools) from 54.2.0 to 65.5.1. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst) - [Commits](pypa/setuptools@v54.2.0...v65.5.1) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: bump version to 1.68.0 (#4532) Co-authored-by: Lau <lauwing@f8ffc25e8e59.ant.amazon.com> * CVE-2007-4559 Patch (#4499) * Adding tarfile member sanitization to extractall() * fix formatting issues * Refactored extract_tarfile functions and added unit/functional tests Co-authored-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Co-authored-by: Mohamed Elasmar <71043312+moelasmar@users.noreply.github.com> Co-authored-by: hnnasit <84355507+hnnasit@users.noreply.github.com> Co-authored-by: Haresh Nasit <hnnasit@amazon.com> Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> * chore: Update development guide to include information on dependency updates (#4476) * Add in instructions on updating SAMCLI dependencies * Update the command to be run to write to reproducible linux * Highlight content using separate sections for requirement files * Fix typos and reword for better readability * Update development guide text * Revert "CVE-2007-4559 Patch (#4499)" (#4535) This reverts commit 40bd90a. * chore: change license badge in readme to display GH license (#4538) * chore: update readme with pypi license * use gh rather than pypi * formatting only changes made by terraform fmt command * add intergration tests * Re-arrange order of if statements to remove recursion * remove print statement that was leftover from development Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Mohamed Elasmar <71043312+moelasmar@users.noreply.github.com> Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Co-authored-by: Lau <lauwing@f8ffc25e8e59.ant.amazon.com> Co-authored-by: TrellixVulnTeam <112716341+TrellixVulnTeam@users.noreply.github.com> Co-authored-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Co-authored-by: hnnasit <84355507+hnnasit@users.noreply.github.com> Co-authored-by: Haresh Nasit <hnnasit@amazon.com> Co-authored-by: Qingchuan Ma <69653965+qingchm@users.noreply.github.com>
hnnasit
added a commit
that referenced
this pull request
Jan 10, 2023
* Revert "Revert "CVE-2007-4559 Patch (#4499)" (#4535)" This reverts commit 1065683. * Changed extract_tarfile input tarfile_path to str file path * Added type annotation for copy function Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
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.
Patching CVE-2007-4559
Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.
If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.