-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add robustness checks in RAR3 formats #5654
Conversation
8bcf0af
to
7a9b789
Compare
This could be two commits. |
7a9b789
to
f5901a4
Compare
And is now. BTW I need to test this a bit more before merging. |
bdd1f78
to
3b92a40
Compare
3b92a40
to
67a244a
Compare
Added while investigating openwall#5653.
That code is no longer maintained (except by me lol). ClamAV is now using the official C++ version, just like hashcat.
Add more sanity checks/reject logic, that also helps robustness by avoiding out of bounds reads. Also adds a test asserting that the inflated size meets the expections. See openwall#5653.
67a244a
to
1c170b3
Compare
So #5653 wasn't a bug (except in hashcat it was) - but the extra tests added here just might add a little more early rejection 👍 and I'm sure ASan will be slightly less furious over the unrar code now. And in the end, this made me NOT want to replace the old ClamAV code with official unrar C++ code. The latter, as seen in hashcat, doesn't return a true or false like our current ClamAV code did to start with - and now with many more false (reject) conditions added by (the royal) us. |
Fixes #5653