-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Description
Given any .sol input from standard input that contains invalid UTF-8 (which will frequently be produced by byte-mutating fuzzers like AFL), solfuzzer fails like this:
Testing compiler with optimizer.
terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_3::detail::type_error'
what(): [json.exception.type_error.316] invalid UTF-8 byte at index 35: 0x80
Aborted
This looks like a crash to the fuzzer, so produces lots of spurious crashes and an annoying burden for triage. The solc executable does not crash on such inputs, as far as I can see. This isn't a major problem, fuzzing still works, but it definitely imposes a cost (of 9 million executions of solfuzzer in one fuzzing run, over 3 million have been crashes due to this UTF-8 issue, and with a larger starting corpus especially the crash set is composed of a huge number of ways to reach this uninteresting non-bug crash).
This is on the latest solc/solidity (0.8.24 github main branch)
Steps to Reproduce
Just run solfuzzer on an input like:
contract test {
f\200^@ction g() pu\203lic { f(); }
}
build/test/tools/solfuzzer < crash.sol
Metadata
Metadata
Assignees
Labels
Type
Projects
Status