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

Possible speed improvement for PMC files #78

Closed
sagamusix opened this issue Jul 20, 2024 · 1 comment · Fixed by #79
Closed

Possible speed improvement for PMC files #78

sagamusix opened this issue Jul 20, 2024 · 1 comment · Fixed by #79

Comments

@sagamusix
Copy link
Collaborator

PMC files with additional delta encoding can cause slow decoding with some malformed files like this one: id%3A000068,src%3A000370,time%3A12372812415,execs%3A7946655230,op%3Ahavoc,rep%3A5.zip

The LH decompressor chickens out very quickly, but since there is no communication about the incomplete decompression, the delta step will process the entire output stream. If a PMC file claims to have a very large output (several hundred MB) but is only a few bytes large, the delta step will dominate the time to unpack the file. Maybe this could be improved so that the delta step only processes as much data as has been unpacked.

@temisu
Copy link
Owner

temisu commented Jul 23, 2024

Well, short streams are legitimate in the lh.library, thus they can't be immediately ruled out.

I simplified the processing and reduced the limits to allow only 128M files, which still should be plenty.

But yeah. Fuzzing found a real decompression bomb

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 a pull request may close this issue.

2 participants