https://github.com/codeintelligencetesting/protobuf-mutator-example
An example showing how libprotobuf-mutator can be used with cifuzz
https://github.com/codeintelligencetesting/protobuf-mutator-example
Last synced: 8 months ago
JSON representation
An example showing how libprotobuf-mutator can be used with cifuzz
- Host: GitHub
- URL: https://github.com/codeintelligencetesting/protobuf-mutator-example
- Owner: CodeIntelligenceTesting
- Created: 2024-06-05T17:22:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-12T12:27:15.000Z (over 1 year ago)
- Last Synced: 2025-03-11T10:48:48.037Z (9 months ago)
- Language: C++
- Size: 7.81 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# protobuf-mutator-example
This example project shows how `libprotobuf-mutator` can be used with `cifuzz` to fuzz C++ code. The fuzzer input in this scenario is a protobuf message that is defined in `test/mutator_data.proto`. In the fuzz test `test/fuzztest.cpp`, we are using the `DEFINE_PROTO_FUZZER` macro to define a fuzz test that receives mutated protobuf messages from the `libprotobuf-mutator`. In addition to that, a post processor is defined in `test/post_processor.cpp` to ensure that mutated protobuf messages keep certain properties.
### Build and run the fuzz test
```sh
cifuzz run fuzztest
```
The fuzzer should be able to find the bug in less than a minute.
### View the crashing input
All fuzzer inputs are stored in text form so that analyzing a crashing input is easy:
```sh
> cat .cifuzz-findings/quirky_puma/crashing-input
config1: true
config2: -7654
packets {
flags: 8
}
packets {
flags: 8
}
packets {
flags: 8
}
packets {
flags: 4227858431
data: "BUG"
}
```