Closed 5225225 closed 3 years ago
Thanks for reporting it!
by the way, you don't need the UTF-8 check in the fuzzer, you can
fuzz_target!(|data: &str| {
let _ = bcrypt::hash(data, 4);
});
the type just needs to implement arbitrary::Arbitrary
which &str does. (See: https://rust-fuzz.github.io/book/cargo-fuzz/structure-aware-fuzzing.html)
This also speeds up the fuzzing since on UTF-8 error, it can still return some amount of the &str, it doesn't completely waste that input.
Oh I didn't know that, thanks!
gives a stack trace of
A malformed hash seems unlikely as an DoS vector, but the code seems to be checking for other forms of errors in the hash, so it shouldn't panic here.