Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVE-2007-4559 Patch #1898

Closed
wants to merge 1 commit into from
Closed

Conversation

TrellixVulnTeam
Copy link

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.

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 4, 2022
@openshift-ci openshift-ci bot requested review from eliorerz and osherdp November 4, 2022 06:20
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 4, 2022
@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2022

Hi @TrellixVulnTeam. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: TrellixVulnTeam
Once this PR has been reviewed and has the lgtm label, please assign tsorya for approval by writing /assign @tsorya in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@osherdp
Copy link
Contributor

osherdp commented Nov 4, 2022

Hi @TrellixVulnTeam!
First and foremost, thank you for looking out for this issue across lots of existing GitHub projects that are infected by it!

I wanted to let you know of a couple of comments I have for this process:

  • First, I'm not sure if it's possible to tag Kasimir Schulz in GitHub. For opensource projects it's more common to reach via GitHub discussion rather than continuing discussions via email (which has the tendency of creating a "split-brain": discussions in each media can lead to different conclusions)
  • We usually prefer a different style of code, and most importantly reducing code duplication. That's why I'm going to open a new PR (assuming you folks are too busy to respond reviews) which is a bit different. I understand you folks tried making it Python 2+3 compatible and also are not familiar with each open-source conventions for where to put utility functions etc., it's well understood and accepted
  • Because of the previous point, I think it will be better to introduce a new third-party library that does this check before running extract / extractall. Patched projects won't be bothered by code style, it's abstracted from them :)
  • Better yet, I don't understand why new cpython versions don't come with a new method safe_extract or something alike. Users of the old functions can have the same functionality as they had before, but anyone can move to the new variant based on the use-case
  • Lastly, I think you haven't caught all relevant uses. Please take a look at the PR I've created: sanitize tar archives due to CVE #1900

@osherdp osherdp closed this Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants