-
Notifications
You must be signed in to change notification settings - Fork 20
Many issues uncovered by fuzzing #10
Comments
can you test the latest version? i fixed some bugs but i'm not sure whether it can pass the fuzzy test now |
It's still vulnerable. It's quite trivial to test; clone a copy of the compfuzz repository, then do something like for source in path/to/compfuzz/libraries/zling/codecs/zling/decompress/crashes; do
path/to/libzling/build/zling_demo d "$source" /dev/null;
done It's fine if zling fails (most of the archives are probably invalid), but not if it crahes. You should also test against a copy of zling compiled with AddressSanitizer (just add -fsanitize=address to your compiler flags for clang or gcc), and/or run them in valgrind. |
i made some fix and now it won't crash on compfuzz, if you run with valgrind, there may be some access on non-initialized memory, it should be acceptable |
That is laughable. Period. |
@richox On what? |
@lhmouse too young too simple, sometimes naive |
Okay, if I turn off ubsan it works. It would be nice if there were a way to initialize that memory, even if it's off by default (perhaps behind an #ifdef?). UBSan and valgrind can pick up some real bugs, it would be a shame if false (kind of…) positives prevented them from being used. zling is already extremely slow for small buffers, I doubt memset()ting some memory would make much of a difference… When setting up another run of AFL I actually managed to find a crash in the compressor. Try compressing testimage.ppm at level 3 or 4. If ASan is enabled you should see something like
I don't usually bother fuzzing compressors, but after you fix this maybe I should try it with zling. |
I've been running AFL against libzling for ~ 15 hours (* 4 instances), no crashes. I think the issues in the decompressor are fixed. |
@nemequ the encoder bug is fixed. |
I reported many issues which cause zling to crash on decompression found by AFL (via e-mail on 2015-02-11). They are still unfixed, and I think enough time has elapsed that it is better to disclose them publicly.
They have been uploaded to https://github.com/nemequ/compfuzz/tree/master/libraries/zling/codecs/zling/decompress/crashes
Some of them may require AddressSanitizer (or possibly a similar tool, such as valgrind) in order to trigger the crash on a specific machine. Some are probably exploitable, all are potential vectors for a DoS attack.
The text was updated successfully, but these errors were encountered: