-
Notifications
You must be signed in to change notification settings - Fork 26
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
Panic on malformed input #27
Comments
@Shnatsel could you try to minify that example in some way? 100 kb is a bit large, I'm sure it can be triggered by a shorter example. |
minimized_testcase.ogg.gz courtesy of AFL testcase minimization mode |
@Shnatsel thanks! |
@Shnatsel that file gives me an error and not a a panic. It says |
You probably haven't disabled checksum verification in |
Then I'd get a hash mismatch error. I actually can reproduce the panic with the 100kb example. @Shnatsel this is what I did: |
Hmm, in that case something is probably off with afl instrumentation. I have noticed that it detects considerably less distinct paths that cargo-fuzz (libfuzzer) even though they should be using pretty much the same thing to instrument binaries. |
@Shnatsel any news with a new minimal reproducable example? |
I've narrowed it down to 21kb so far. I'll see if I can reduce it further. |
I'm afraid 14kb is as small as I can get it. lewton_#27_min_testcase.ogg.gz AFL's testcase minimization mode produces a non-crashing file for whatever reason (this is probably a bug in AFL.rs), and cargo-fuzz cannot be used because lewton allocates enormous amounts of virtual memory, which causes address sanitizer to freak out on pretty much any malformed input. |
Ah, turns out the enormous allocations were throwing off AFL too. After I've disabled all memory limits |
The bug is fixed now, still working on a regression test. |
Okay, using this file now instead: 27_really_minimized_testcase_crcfix.ogg.zip |
I have recently discovered that previous fuzzing attempts on lewton (namely the lewton target in https://github.com/rust-fuzz/targets) were using the OGG stream API and did not disable CRC32 check in
ogg
crate. This caused almost any fuzzer input to be rejected due to crc32 mismatch, rendering fuzzers useless.I have patched the ogg crate to disable crc32 check during fuzzing. After this honggfuzz-rs has immediately discovered an input that causes an out-of-bounds access in lewton. Thanks to Rust's memory safety guarantees this is not a critical security issue (like it would be in C), but it could still be used to perform a denial-of-service attack.
The panic message is
index out of bounds: the len is 128 but the index is 1023
at line 1098 inaudio.rs
. The file triggering the crash is attached, I had to gzip it so that github would accept the upload. You should be able to reproduce the crash by disabling crc32 in unconditionally in a local copy ofogg
crate and feeding this file to lewton.My fuzzing setup is available at https://github.com/Shnatsel/lewton-fuzz, more info on using it can be found in the rust-fuzz/targets issue. This panic is blocking any further fuzzing attempts. I will run another round of fuzzing once this panic is resolved.
The text was updated successfully, but these errors were encountered: