Since differential fuzzing is strongest when different programming languages are involved, I’d like to fuzz cpp code against python code.
Solution: Use sockets to establish a TCP client/server connection.
- Server - a python file which listens and accepts client communications from the fuzz target, performs the required operations in python and sends back the computed python output as a response back to the client.
- Client - A fuzzing harness which can send requests to the python server to perform certain operations, receives python output computed in the server file and compares cpp output with the python output to see if they match.
Since this requires a slight architectural change in the fuzzing harness to allow python subprocesses, I’d like to know if this solution is acceptable.
Additional context I’ve implemented a prototype which performs cross-language differential fuzzing of chacha20 on this branch and would love to hear opinions/feedback on how to proceed.
Test instructions
- Start server:
python3 src/test/fuzz/script.py
- Run the fuzz test:
FUZZ=crypto_diff_fuzz_pychacha20 src/test/fuzz/fuzz