Fuzzing. #372
Replies: 3 comments 3 replies
-
Yes, type it up and lets see it - start small and we can build on it. I have been using https://github.com/jesperpedersen/libfaults during early development for something similar. |
Beta Was this translation helpful? Give feedback.
-
Hi, this seems a bit harder than it looks, Specifically I wanted to test if the configuration parsers are safe, the problem is the api doesn't expose any way for raw parsing of characters. Using libfuzzer, we specifically have code like #include <stdint.h>
#include <stddef.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){
} Where data is randomly generated bytes. This one is already compiling and running(although needs clang for compiling) But then we have coverage testing where I provide it with a seed corpus, which for our case is contents of a valid file which then the fuzzer modifies it randomly and passes it to the reader. A tutorial can be found here |
Beta Was this translation helpful? Give feedback.
-
Okay managed to get it to work, https://github.com/collinsonindo/pgagroal/tree/fuzzer Fuzzer code is at https://github.com/collinsonindo/pgagroal/blob/fuzzer/fuzz/target.c Needs a clang compiler to work, gcc doesn't support to compile
And then which will use some seeds as a starting point. Output should be a lot of
But it should run. Is there a reason we print to stdout on no configuration instead of logging? |
Beta Was this translation helpful? Give feedback.
-
It would be nice if we could test the library for resilience against arbitrary input.
I've tried to eyeball the code that does parsing looking for something that may be a potential risk but so far found none.
But would be better if that was automated.
I propose something like libfuzzer and calling the cli endpoints with maliciously crafted input files to see if it triggers any issues
Would a CI running libfuzzer be a welcome pull request?
Beta Was this translation helpful? Give feedback.
All reactions