-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8314891: Additional Zip64 extra header validation #15650
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
Conversation
👋 Welcome back lancea! A progress list of the required criteria for merging this PR into |
@LanceAndersen The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
* and the CEN size, csize,LOC offset fields are set to 0xFFFFFFFF, the disk | ||
* starting number is set to 0xFFFF or when we have a valid Zip64 Extra header | ||
* size but missing the corresponding field. | ||
* @run junit MissingZIP64EntriesTest |
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.
Is this comment accurate? I think we should check 3 cases when the header extra len == 0, len == 8 and len ==16, but still do not contain all required information.
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.
Clarified the comment to make it a bit clearer and also added additional tests
* Value to set the Disk Start number offset CEN field to when the | ||
* actual value is stored in the Zip64 Extra Header | ||
*/ | ||
private static final int ZIP64_MAGICCOUNT = 0xFFFF; |
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.
private static final int ZIP64_MAGICCOUNT = 0xFFFF; | |
private static final int ZIP64_MAGICCOUNT = 0xFFFF; |
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.
Removed the extra space. thank you for pointing it out
@LanceAndersen This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
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.
Looks good to me Lance. I note that the extra checks aren't reversed via any sort of system property but given that this fix isn't planned for JDK update releases, that seems fine to me.
early testing by frameworks which create/modify custom zip files will be important.
@LanceAndersen This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 8274713.
Your commit was automatically rebased without conflicts. |
@LanceAndersen Pushed as commit 8274713. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
I noticed that this PR did not update |
Intentional, as this was a follow on to the updates which were done previously to the CEN work in August, this is follow on cleanup. Updates to ZipInputStream would be done separately under a separate PR or could be done via your work on 8303866 |
Hey @LanceAndersen, It was a common practice in obfuscation, to create zips with invalid headers. This change leads to a behavioral change that affects existing work processes. Would it be possible to add an system property to restore the old behavior? |
Please review this PR which improves the Zip64 extra header validation:
Throw a ZipException If the extra len field is 0 and :
-- size, csize, or loc offset are set to 0xFFFFFFFF
-- disk starting number is set to 0xFFFF
We have a valid size for the Zip64 extra header but we are missing the csize or loc fields if they are expected to be part of the header
Mach5 tiers 1-3 are clean
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15650/head:pull/15650
$ git checkout pull/15650
Update a local copy of the PR:
$ git checkout pull/15650
$ git pull https://git.openjdk.org/jdk.git pull/15650/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15650
View PR using the GUI difftool:
$ git pr show -t 15650
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15650.diff
Webrev
Link to Webrev Comment