-
Notifications
You must be signed in to change notification settings - Fork 80
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
Memory exhaustion and crash on malformed input #29
Comments
Thanks for the bug report! I think that using a |
I'm pretty sure |
Add test from fuzzing samples in image-rs#28, image-rs#29 and image-rs#31
Decoding any of the attached files triggers a crash with the following error message:
memory allocation of 136902082592 bytes failedAborted
tiff-oom-crashes.zip
The exact reproduction code can be found in #28. Found via AFL.rs, tested on
image-tiff
version 0.2.2Most decoding libraries face this issue at some point. This is usually solved by limiting the amount of allocated memory to some sane default, and letting people override it if they're really dealing with enormous amounts of data. In Rust we can easily allow the API user to override these limits via the builder pattern.
See https://libpng.sourceforge.io/decompression_bombs.html for more info on how a similar issue was solved in libpng. See also the Limits struct from flif crate.
The text was updated successfully, but these errors were encountered: