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

Patch CVE-2007-4559 #2180

Merged
merged 12 commits into from
Jan 25, 2023
Merged

Patch CVE-2007-4559 #2180

merged 12 commits into from
Jan 25, 2023

Conversation

TrellixVulnTeam
Copy link
Contributor

@TrellixVulnTeam TrellixVulnTeam commented Jan 6, 2023

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.

Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for flagging this issue and opening a PR @TrellixVulnTeam !

At the moment almost all builds are breaking, so this can't be merged as is. Are you in a capacity to get the code in a mergeable state or do you need someone from the Kedro team to take over?

@ankatiyar ankatiyar self-assigned this Jan 12, 2023
ankatiyar and others added 3 commits January 12, 2023 11:38
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
@merelcht merelcht removed the request for review from idanov January 19, 2023 11:15
ankatiyar and others added 2 commits January 23, 2023 14:08
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 👍 I think we should also add this to the release notes.

for member in tar.getmembers():
member_path = path / member.name
if not _is_within_directory(path, member_path):
raise Exception("Attempted Path Traversal in Tar File")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know @TrellixVulnTeam added this exception message, but I think we can make it a bit clearer. Maybe something like "Failed to safely extract tar file"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
@deepyaman deepyaman changed the title CVE-2007-4559 Patch Patch CVE-2007-4559 Jan 24, 2023
Copy link
Contributor

@AhdraMeraliQB AhdraMeraliQB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch @TrellixVulnTeam on flagging this! And thanks @ankatiyar for finishing this up 🌟

ankatiyar and others added 3 commits January 25, 2023 12:53
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
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.

4 participants