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

Infinite loop occurs while decompressing zip multi-volume archive file #799

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

liuyipingali
Copy link

Problem-1

Decompress a zip multi-volume archive file without filename extension will cause an infinite loop.
payload: https://github.com/apache/commons-compress/blob/master/src/test/resources/COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01
change split_zip_created_by_zip.z01 filename to split_zip_created_by_zip, use minizip_cli to decompress this file(./minizip_cli -l /root/payloads/split_zip_created_by_zip) will cause an infinite loop.

Problem-2

Decompress multi-volume zip archive files in recover mode will cause an infinite loop.
payload: https://github.com/apache/commons-compress/blob/master/src/test/resources/COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.zip
split_zip_created_by_zip.zip, split_zip_created_by_zip.z01 and split_zip_created_by_zip.z02 are split zip files, put these files in a directory(do not need to change their file names). Note mz_zip.c line 1451 and line 1455(to call mz_zip_recover_cd function) , and use the patched minizip_cli to decompress split_zip_created_by_zip.zip(./minizip_cli -l /root/payloads/split_zip_created_by_zip.zip) will occur infinite loop.
I found this bug can only be triggered through mz_zip_recover_cd, split_zip_created_by_zip.zip not fail at mz_zip_read_cd, so if not note mz_zip.c can't trigger this bug. But if split_zip_created_by_zip.zip does not have a Central Directory, this bug can be triggered directly.

@liuyipingali
Copy link
Author

@nmoinvaz

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.

1 participant