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

Add sanity checks before extracting zip #99

Closed
wants to merge 1 commit into from

Conversation

Jacalz
Copy link
Contributor

@Jacalz Jacalz commented Aug 11, 2023

A cleanup of #86 implementing my suggestion in #86 (comment).

A cleanup of psanford#86 implementing my suggestion in psanford#86 (comment).

Co-authored-by: Ramakrishnan Muthukrishnan <ram@leastauthority.com>
// Check that the extracted size is as expected.
actualUncompressedSize := uint64(0)
for _, f := range zr.File {
actualUncompressedSize += f.FileHeader.UncompressedSize64
Copy link
Owner

Choose a reason for hiding this comment

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

Assuming a malicious zip file, I doubt that we can trust the UncomressedSize64

@Jacalz Jacalz closed this Oct 17, 2023
@Jacalz Jacalz deleted the sanity-check-before-writes branch October 17, 2023 19:40
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.

2 participants