Repository navigation
Apply zip bomb checks to encrypted temp ZIP processing - #1057
Merged
pjfanning merged 1 commit intoMay 11, 2026
Merged
Conversation
pjfanning
requested changes
May 9, 2026
| } | ||
|
|
||
| ZipArchiveEntry getNextEntry() throws IOException { | ||
| public ZipArchiveEntry getNextEntry() throws IOException { |
Member
There was a problem hiding this comment.
this can be public if it is needed to be public
jmestwa-coder
force-pushed
the
zip-bomb-check-encrypted-temp-zip
branch
from
May 11, 2026 14:08
6b3e938 to
db43a62
Compare
Contributor
Author
|
@pjfanning Thanks for the review. updated the patch with the visibility revert and formatting fix. |
pjfanning
reviewed
May 11, 2026
|
|
||
| ZipArchiveEntry ze; | ||
| while ((ze = zis.getNextEntry()) != null) { | ||
| while ((ze = zipStream.getNextEntry()) != null) { |
Member
There was a problem hiding this comment.
this doesn't seem right - shouldn't you call zis.getNextEntry? otherwise, what is the point of creating a ZipArchiveThresholdInputStream?
jmestwa-coder
force-pushed
the
zip-bomb-check-encrypted-temp-zip
branch
from
May 11, 2026 19:06
db43a62 to
d1760d1
Compare
Contributor
Author
|
@pjfanning updated the patch to restore traversal through zis.getNextEntry() and simplified the implementation accordingly. Please let me know if you'd prefer any further adjustments. |
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.
Summary
Apply existing zip-bomb protections to the encrypted temp ZIP processing path used by
AesZipFileZipEntrySource.Previously, this flow re-streamed attacker-controlled ZIP entries through
ZipArchiveInputStreamwithoutZipArchiveThresholdInputStreamenforcement, allowing highly compressed entries to bypass configured inflate-ratio checks during temporary encrypted ZIP creation.This change aligns the encrypted processing path with the existing ZIP security protections already used elsewhere in POI.
Changes
ZipArchiveThresholdInputStreamgetNextEntry()onZipArchiveThresholdInputStreamfor internal stream-based processing usageRegression Test
Added
rejectsZipBombInput()to verify:The test restores modified
ZipSecureFilesettings in afinallyblock to avoid leaking state across tests.