(Reworked) Add ability to limit output size for zip archives (against zip bombs)#117
(Reworked) Add ability to limit output size for zip archives (against zip bombs)#117serejke wants to merge 3 commits intocodehaus-plexus:masterfrom
Conversation
|
@serejke thanks. I'll take a look at the changes in the coming days. But there is one thing that I've noticed. Does it make sense to move the change to |
|
@plamentotev for sure, other archivers are vulnerable to bombs as well. The suggestion to move the change to
So the only good way to protect all archivers seems to be:
|
|
I believe this pull request can be applied separately. |
|
Sorry for the delay, I was busy. I agree with you. We can merge it for Zip archives and implement it later for the rest later and keep the backward compatibility. Would you please split this in 3 commits:
With all changes in single commit is a bit hard to track what is changed. Also there is some code formatting issues - the Apart from that I have single question - why the exception is thrown when |
|
|
|
Please disregard my last comment. The file is actually 11 bytes long. My bad |
b143094 to
bb22cd4
Compare
|
Done.
|
|
Thanks @serejke. I've corrected some minor formatting issues, added additional test case for when the zip size is equal to the size limit and merged it. |
Hello,
@satamas asked me to complete the pull-request #115, which had a couple of defects.
Actually, I decided to rewrite the implementation, so this new pull request deserves a separate review and #115 will be dissmissed.
What have been changed:
AbstractUnArchiverFile.sizeand replaced it withCountingInputStream.AbstractZipUnArchiver#execute()andAbstractZipUnArchiver#execute(String, File)by delegating to the latter.I tried to minimize diff of the files and keep code style. Let me know if something was missed.