Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to provide dictionaries and seed corpus to fuzzers #114

Open
AMS21 opened this issue Jan 10, 2023 · 6 comments
Open

Document how to provide dictionaries and seed corpus to fuzzers #114

AMS21 opened this issue Jan 10, 2023 · 6 comments

Comments

@AMS21
Copy link

AMS21 commented Jan 10, 2023

Hi, first of all thanks for all the awesome work you've put into this project really appreciate it.

For several of my fuzzers I've created dictionaries and/or have large number of sample files which I obviously would like the fuzzers to take advantage of.

I've looked through the documentation here but was not able to find the answers there so maybe someone here can help me.

@oliverchang
Copy link
Collaborator

@jonathanmetzman can you help answer this?

@jonathanmetzman
Copy link
Collaborator

Hi, first of all thanks for all the awesome work you've put into this project really appreciate it.

No problem!

For several of my fuzzers I've created dictionaries and/or have large number of sample files which I obviously would like the fuzzers to take advantage of.

I've looked through the documentation here but was not able to find the answers there so maybe someone here can help me.

Good point we should document this.
Basically you need to put the dictionary/seed corpus (zip containing sample files) next to your fuzzers.
For example: if youre fuzzer is called png_parser_fuzzer, your $OUT directory should look like this:

png_parser_fuzzer
png_parser_fuzzer_seed_corpus.zip
png_parser_fuzzer.dict

@AMS21
Copy link
Author

AMS21 commented Jan 13, 2023

Thanks for the quick response. That's exactly what I was looking for.

Keeping this issue open to track the missing documentation then.

@AMS21 AMS21 changed the title Providing dictionaries and/or sample files to fuzzers Document how to provide dictionaries and seed corpus to fuzzers Jan 13, 2023
@securitykernel
Copy link
Contributor

securitykernel commented Feb 25, 2023

This is both already documented in OSS-Fuzz's New project guide > Efficient fuzzing section, which ClusterFuzzLite's docs link to from Build integration > Efficient fuzzing, so I think this issue can be closed. This is probably due to the code base being the same for OSS-Fuzz and CFL in this regard.

To provide a corpus for my_fuzzer, put my_fuzzer_seed_corpus.zip file next to the fuzz target’s binary in $OUT during the build.
...
Put your dict file in $OUT. If the dict filename is the same as your target binary name (i.e. %fuzz_target%.dict), it will be automatically used.

I too, sometimes find it hard to find the right information from the docs due to the similarities between OSS-Fuzz and ClusterFuzzLite, but I don't think this is easy to overcome. For example, searching for dictionary or seed on the CFL docs gives no useful results. Maybe in the efficient fuzzing section, we could change:

To improve your fuzz target ability to find bugs faster, please read this section.

to:

To improve your fuzz target ability to find bugs faster, e.g., by providing a seed corpus or dictionaries, please read this section.

@AMS21
Copy link
Author

AMS21 commented Feb 25, 2023

Good point. I agree

@jonathanmetzman
Copy link
Collaborator

I think this info should be more front and center though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants