blob: 60bc0a96c1683010f960605285c9d246da82a5d6 [file] [log] [blame] [view]
Kevin Plyboncea94cf2019-09-12 18:18:371# Fuzz testing in Chromium
aizatskya6f86292016-03-18 00:22:242
Kevin Plybon8824b2fa2019-08-30 21:42:463[go/chrome-fuzzing](https://goto.google.com/chrome-fuzzing)
aizatsky88a677d2016-03-18 23:18:244
Kevin Plyboncea94cf2019-09-12 18:18:375[Fuzzing] is a testing technique that feeds auto-generated inputs to a piece
6of target code in an attempt to crash the code. It's one of the most effective
7methods we have for finding security and stability issues (see
8[go/fuzzing-success](http://go/fuzzing-success)). You can learn more about the
9benefits of fuzzing at [go/why-fuzz](http://go/why-fuzz).
aizatskya6f86292016-03-18 00:22:2410
Max Moroz74aad9132019-07-26 21:11:5711This documentation covers the in-process guided fuzzing approach employed by
12different fuzzing engines, such as [libFuzzer] or [AFL]. To learn more about
13out-of-process fuzzers, please refer to the [Blackbox fuzzing] page in the
14ClusterFuzz documentation.
aizatskya6f86292016-03-18 00:22:2415
Max Moroz74aad9132019-07-26 21:11:5716[TOC]
aizatskya6f86292016-03-18 00:22:2417
Max Moroz74aad9132019-07-26 21:11:5718## Getting Started
aizatskya6f86292016-03-18 00:22:2419
Max Moroz74aad9132019-07-26 21:11:5720In Chromium, you can easily create and submit fuzz targets. The targets are
21automatically discovered by buildbots, built with different fuzzing engines,
22then uploaded to the distributed [ClusterFuzz] fuzzing system to run at scale.
aizatskya6f86292016-03-18 00:22:2423
Max Moroz74aad9132019-07-26 21:11:5724Create your first fuzz target and submit it by stepping through our [Getting
25Started Guide].
aizatskya6f86292016-03-18 00:22:2426
Max Moroz74aad9132019-07-26 21:11:5727## Advanced Topics
28
Kevin Plybon8824b2fa2019-08-30 21:42:4629* [Improving fuzz target efficiency].
30* [Creating a fuzz target that expects a protobuf] instead of a byte stream as
31 input.
Max Moroz74aad9132019-07-26 21:11:5732
Max Moroz4a8415a2019-08-02 17:46:5133 *** note
Kevin Plybon8824b2fa2019-08-30 21:42:4634 **Note:** You can also fuzz code that needs multiple mutated
Max Moroz74aad9132019-07-26 21:11:5735 inputs, or to generate inputs defined by a grammar.
Max Moroz4a8415a2019-08-02 17:46:5136 ***
37
Kevin Plybon8824b2fa2019-08-30 21:42:4638* [Reproducing bugs] found by libFuzzer/AFL and reported by ClusterFuzz.
Mark Brand453081ca2020-06-08 08:46:0639* [Fuzzing mojo interfaces] using automatically generated libprotobuf-mutator fuzzers.
Max Moroz74aad9132019-07-26 21:11:5740
41## Further Reading
42
Kevin Plybon8824b2fa2019-08-30 21:42:4643* [LibFuzzer integration] with Chromium and ClusterFuzz.
44* [AFL integration] with Chromium and ClusterFuzz.
45* [Detailed references] for other integration parts.
46* Writing fuzzers for the [non-browser parts of Chrome OS].
aizatskya6f86292016-03-18 00:22:2447
aizatsky9c8c5b02016-03-30 22:09:0948## Trophies
Kevin Plybon8824b2fa2019-08-30 21:42:4649* [Issues automatically filed] by ClusterFuzz.
50* [Issues filed manually] after running fuzz targets.
51* [Bugs found in PDFium] by manual fuzzing.
52* [Bugs found in open-source projects] with libFuzzer.
aizatsky9c8c5b02016-03-30 22:09:0953
Max Moroz74aad9132019-07-26 21:11:5754## Other Links
55* [Guided in-process fuzzing of Chrome components] blog post.
56* [ClusterFuzz Stats] for fuzz targets built with AddressSanitizer and
57 libFuzzer.
aizatsky68551322016-08-06 00:21:1858
Max Moroz74aad9132019-07-26 21:11:5759[AFL]: http://lcamtuf.coredump.cx/afl/
Kevin Plybon8824b2fa2019-08-30 21:42:4660[AFL integration]: AFL_integration.md
Max Moroz74aad9132019-07-26 21:11:5761[Blackbox fuzzing]: https://google.github.io/clusterfuzz/setting-up-fuzzing/blackbox-fuzzing/
Kevin Plybon8824b2fa2019-08-30 21:42:4662[Bugs found in open-source projects]: http://llvm.org/docs/LibFuzzer.html#trophies
63[Bugs found in PDFium]: https://bugs.chromium.org/p/pdfium/issues/list?can=1&q=libfuzzer&colspec=ID+Type+Status+Priority+Milestone+Owner+Summary&cells=tiles
Max Moroz74aad9132019-07-26 21:11:5764[ClusterFuzz]: https://clusterfuzz.com/
Max Moroz13c23182018-11-17 00:23:2265[ClusterFuzz Stats]: https://clusterfuzz.com/fuzzer-stats/by-fuzzer/fuzzer/libFuzzer/job/libfuzzer_chrome_asan
Kevin Plybon8824b2fa2019-08-30 21:42:4666[Creating a fuzz target that expects a protobuf]: libprotobuf-mutator.md
67[Detailed references]: reference.md
Max Moroz74aad9132019-07-26 21:11:5768[Fuzzing]: https://en.wikipedia.org/wiki/Fuzzing
Max Moroz3aa30e9a2020-06-25 23:46:3969[Fuzzing mojo interfaces]: ../../mojo/docs/mojolpm.md
Max Moroz74aad9132019-07-26 21:11:5770[Getting Started Guide]: getting_started.md
Max Moroz74aad9132019-07-26 21:11:5771[Guided in-process fuzzing of Chrome components]: https://security.googleblog.com/2016/08/guided-in-process-fuzzing-of-chrome.html
Kevin Plybon8824b2fa2019-08-30 21:42:4672[Improving fuzz target efficiency]: efficient_fuzzing.md
73[Issues automatically filed]: https://bugs.chromium.org/p/chromium/issues/list?sort=-modified&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&q=label%3AStability-LibFuzzer%2CStability-AFL%20label%3AClusterFuzz%20-status%3AWontFix%2CDuplicate&can=1
74[Issues filed manually]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3AStability-LibFuzzer+-label%3AClusterFuzz&sort=-modified&colspec=ID+Pri+M+Stars+ReleaseBlock+Component+Status+Owner+Summary+OS+Modified&x=m&y=releaseblock&cells=ids
75[non-browser parts of Chrome OS]: https://chromium.googlesource.com/chromiumos/docs/+/master/fuzzing.md
76[Reproducing bugs]: reproducing.md
Max Moroz13c23182018-11-17 00:23:2277[crbug.com/539572]: https://bugs.chromium.org/p/chromium/issues/detail?id=539572
Max Moroz74aad9132019-07-26 21:11:5778[go/fuzzing-success]: https://goto.google.com/fuzzing-success
Max Moroz13c23182018-11-17 00:23:2279[libFuzzer]: http://llvm.org/docs/LibFuzzer.html
Kevin Plybon8824b2fa2019-08-30 21:42:4680[libFuzzer integration]: libFuzzer_integration.md