Fuzzing

In
For the purpose of security, input that crosses a trust boundary is often the most useful.[1] For example, it is more important to fuzz code that handles a file uploaded by any user than it is to fuzz the code that parses a configuration file that is accessible only to a privileged user.
History
The term "fuzz" originates from a 1988 class project
According to Prof. Barton Miller, "In the process of writing the project description, I needed to give this kind of testing a name. I wanted a name that would evoke the feeling of random, unstructured data. After trying out several ideas, I settled on the term fuzz."[4]
A key contribution of this early work was simple (almost simplistic) oracle. A program failed its test if it crashed or hung under the random input and was considered to have passed otherwise. While test oracles can be challenging to construct, the oracle for this early fuzz testing was simple and universal to apply.
In April 2012, Google announced ClusterFuzz, a cloud-based fuzzing infrastructure for security-critical components of the
In September 2014,
In April 2015, Hanno Böck showed how the fuzzer AFL could have found the 2014 Heartbleed vulnerability.)
In August 2016, the
In September 2016, Microsoft announced Project Springfield, a cloud-based fuzz testing service for finding security critical bugs in software.[16]
In December 2016, Google announced OSS-Fuzz which allows for continuous fuzzing of several security-critical open-source projects.[17]
At Black Hat 2018, Christopher Domas demonstrated the use of fuzzing to expose the existence of a hidden RISC core in a processor.[18] This core was able to bypass existing security checks to execute Ring 0 commands from Ring 3.
In September 2020,
Early random testing
Testing programs with random inputs dates back to the 1950s when data was still stored on punched cards.[22] Programmers would use punched cards that were pulled from the trash or card decks of random numbers as input to computer programs. If an execution revealed undesired behavior, a bug had been detected.
The execution of random inputs is also called random testing or monkey testing.
In 1981, Duran and Ntafos formally investigated the effectiveness of testing a program with random inputs.[23][24] While random testing had been widely perceived to be the worst means of testing a program, the authors could show that it is a cost-effective alternative to more systematic testing techniques.
In 1983, Steve Capps at Apple developed "The Monkey",[25] a tool that would generate random inputs for classic Mac OS applications, such as MacPaint.[26] The figurative "monkey" refers to the infinite monkey theorem which states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will eventually type out the entire works of Shakespeare. In the case of testing, the monkey would write the particular sequence of inputs that would trigger a crash.
In 1991, the crashme tool was released, which was intended to test the robustness of Unix and
Types
A fuzzer can be categorized in several ways:[28][1]
- A fuzzer can be generation-based or mutation-based depending on whether inputs are generated from scratch or by modifying existing inputs.
- A fuzzer can be dumb (unstructured) or smart (structured) depending on whether it is aware of input structure.
- A fuzzer can be white-, grey-, or black-box, depending on whether it is aware of program structure.
Reuse of existing input seeds
A mutation-based fuzzer leverages an existing corpus of seed inputs during fuzzing. It generates inputs by modifying (or rather
A generation-based fuzzer generates inputs from scratch. For instance, a smart generation-based fuzzer[31] takes the input model that was provided by the user to generate new inputs. Unlike mutation-based fuzzers, a generation-based fuzzer does not depend on the existence or quality of a corpus of seed inputs.
Some fuzzers have the capability to do both, to generate inputs from scratch and to generate inputs by mutation of existing seeds.[32]
Aware of input structure
Typically, fuzzers are used to generate inputs for programs that take structured inputs, such as a
A smart (model-based,[32] grammar-based,[31][33] or protocol-based[34]) fuzzer leverages the input model to generate a greater proportion of valid inputs. For instance, if the input can be modelled as an abstract syntax tree, then a smart mutation-based fuzzer[33] would employ random transformations to move complete subtrees from one node to another. If the input can be modelled by a formal grammar, a smart generation-based fuzzer[31] would instantiate the production rules to generate inputs that are valid with respect to the grammar. However, generally the input model must be explicitly provided, which is difficult to do when the model is proprietary, unknown, or very complex. If a large corpus of valid and invalid inputs is available, a grammar induction technique, such as Angluin's L* algorithm, would be able to generate an input model.[35][36]
A dumb fuzzer
Aware of program structure
Typically, a fuzzer is considered more effective if it achieves a higher degree of
A black-box fuzzer[37][33] treats the program as a black box and is unaware of internal program structure. For instance, a random testing tool that generates inputs at random is considered a blackbox fuzzer. Hence, a blackbox fuzzer can execute several hundred inputs per second, can be easily parallelized, and can scale to programs of arbitrary size. However, blackbox fuzzers may only scratch the surface and expose "shallow" bugs. Hence, there are attempts to develop blackbox fuzzers that can incrementally learn about the internal structure (and behavior) of a program during fuzzing by observing the program's output given an input. For instance, LearnLib employs active learning to generate an automaton that represents the behavior of a web application.
A
A gray-box fuzzer leverages instrumentation rather than program analysis to glean information about the program. For instance, AFL and libFuzzer utilize lightweight instrumentation to trace basic block transitions exercised by an input. This leads to a reasonable performance overhead but informs the fuzzer about the increase in code coverage during fuzzing, which makes gray-box fuzzers extremely efficient vulnerability detection tools.[43]
Uses
Fuzzing is used mostly as an automated technique to expose
Exposing bugs
In order to expose bugs, a fuzzer must be able to distinguish expected (normal) from unexpected (buggy) program behavior. However, a machine cannot always distinguish a bug from a feature. In automated software testing, this is also called the test oracle problem.[45][46]
Typically, a fuzzer distinguishes between crashing and non-crashing inputs in the absence of
To make a fuzzer more sensitive to failures other than crashes, sanitizers can be used to inject assertions that crash the program when a failure is detected.[47][48] There are different sanitizers for different kinds of bugs:
- to detect memory related errors, such as AddressSanitizer),
- to detect race conditions and deadlocks (ThreadSanitizer),
- to detect undefined behavior (UndefinedBehaviorSanitizer),
- to detect memory leaks (LeakSanitizer), or
- to check control-flow integrity (CFISanitizer).
Fuzzing can also be used to detect "differential" bugs if a reference implementation is available. For automated regression testing,[49] the generated inputs are executed on two versions of the same program. For automated differential testing,[50] the generated inputs are executed on two implementations of the same program (e.g., lighttpd and httpd are both implementations of a web server). If the two variants produce different output for the same input, then one may be buggy and should be examined more closely.
Validating static analysis reports
Browser security
Modern web browsers undergo extensive fuzzing. The Chromium code of Google Chrome is continuously fuzzed by the Chrome Security Team with 15,000 cores.[52] For Microsoft Edge [Legacy] and Internet Explorer, Microsoft performed fuzzed testing with 670 machine-years during product development, generating more than 400 billion DOM manipulations from 1 billion HTML files.[53][52]
Toolchain
A fuzzer produces a large number of inputs in a relatively short time. For instance, in 2016 the Google OSS-fuzz project produced around 4
that automates otherwise manual and tedious tasks which follow the automated generation of failure-inducing inputs.Automated bug triage
Automated bug triage is used to group a large number of failure-inducing inputs by root cause and to prioritize each individual bug by severity. A fuzzer produces a large number of inputs, and many of the failure-inducing ones may effectively expose the same software bug. Only some of these bugs are security-critical and should be patched with higher priority. For instance the CERT Coordination Center provides the Linux triage tools which group crashing inputs by the produced stack trace and lists each group according to their probability to be exploitable.[54] The Microsoft Security Research Centre (MSEC) developed the "!exploitable" tool which first creates a hash for a crashing input to determine its uniqueness and then assigns an exploitability rating:[55]
- Exploitable
- Probably Exploitable
- Probably Not Exploitable, or
- Unknown.
Previously unreported, triaged bugs might be automatically
Automated input minimization
Automated input minimization (or test case reduction) is an automated
List of popular fuzzers
![]() | This section needs expansion. You can help by adding to it. (February 2023) |
The following is a list of fuzzers described as "popular", "widely used", or similar in the academic literature.[59][60]
Name | White/gray/black-box | Smart/dumb | Description | Written in | License |
---|---|---|---|---|---|
Gray | Dumb | C | Apache 2.0 | ||
AFL++[63]
|
Gray | Dumb | C | Apache 2.0 | |
AFLFast[64] | Gray | Dumb | C | Apache 2.0 | |
Angora[65] | Gray | Dumb | C++ | Apache 2.0 | |
honggfuzz[66][67] | Gray | Dumb | C | Apache 2.0 | |
QSYM[68] | [?] | [?] | [?] | [?] | |
SymCC[69] | White[70] | [?] | C++ | GPL, LGPL | |
T-Fuzz[71] | [?] | [?] | [?] | [?] | |
VUzzer[72] | [?] | [?] | [?] | [?] |
See also
- American fuzzy lop (fuzzer)
- Concolic testing
- Glitch
- Glitching
- Monkey testing
- Random testing
- Coordinated vulnerability disclosure
- Runtime error detection
- Security testing
- Smoke testing (software)
- Symbolic execution
- System testing
- Test automation
References
- ^ a b John Neystadt (February 2008). "Automated Penetration Testing with White-Box Fuzzing". Microsoft. Retrieved 2009-05-14.
- ^ Barton P. Miller (September 1988). "Fall 1988 CS736 Project List" (PDF). Computer Sciences Department, University of Wisconsin-Madison. Retrieved 2020-12-30.
- S2CID 14313707.
- ^ a b Miller, Barton (April 2008). "Foreword for Fuzz Testing Book". UW-Madison Computer Sciences. Retrieved 29 March 2024.
- ^ "Fuzz Testing of Application Reliability". University of Wisconsin-Madison. Retrieved 2020-12-30.
- ^ a b "Announcing ClusterFuzz". Retrieved 2017-03-09.
- ^ Perlroth, Nicole (25 September 2014). "Security Experts Expect 'Shellshock' Software Bug in Bash to Be Significant". The New York Times. Retrieved 25 September 2014.
- ^ Zalewski, Michał (1 October 2014). "Bash bug: the other two RCEs, or how we chipped away at the original fix (CVE-2014-6277 and '78)". lcamtuf's blog. Retrieved 13 March 2017.
- ZDNet. Retrieved 29 September 2014.
- ^ Böck, Hanno. "Fuzzing: Wie man Heartbleed hätte finden können (in German)". Golem.de (in German). Retrieved 13 March 2017.
- ^ Böck, Hanno. "How Heartbleed could've been found (in English)". Hanno's blog. Retrieved 13 March 2017.
- ^ "Search engine for the internet of things – devices still vulnerable to Heartbleed". shodan.io. Retrieved 13 March 2017.
- ^ "Heartbleed Report (2017-01)". shodan.io. Archived from the original on 23 January 2017. Retrieved 10 July 2017.
- ^ Walker, Michael. "DARPA Cyber Grand Challenge". darpa.mil. Retrieved 12 March 2017.
- ^ "Mayhem comes in first place at CGC". Retrieved 12 March 2017.
- ^ a b "Announcing Project Springfield". 2016-09-26. Retrieved 2017-03-08.
- ^ a b c d "Announcing OSS-Fuzz". Retrieved 2017-03-08.
- ^ Christopher Domas (August 2018). "GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUs". Retrieved 2018-09-03.
- ^ "Microsoft: Windows 10 is hardened with these fuzzing security tools – now they're open source". ZDNet. September 15, 2020.
- ^ "Microsoft open-sources fuzzing test framework". InfoWorld. September 17, 2020.
- ^ microsoft/onefuzz, Microsoft, 2024-03-03, retrieved 2024-03-06
- ^ Gerald M. Weinberg (2017-02-05). "Fuzz Testing and Fuzz History". Retrieved 2017-02-06.
- ISBN 9780897911467.
- S2CID 17208399.
- ISBN 978-0596007195.
- ^ "Macintosh Stories: Monkey Lives". Folklore.org. 1999-02-22. Retrieved 2010-05-28.
- ^ "crashme". CodePlex. Retrieved 2021-05-21.
- ISBN 978-0-321-44611-4.
- S2CID 52854851.
- ^ Rebert, Alexandre; Cha, Sang Kil; Avgerinos, Thanassis; Foote, Jonathan; Warren, David; Grieco, Gustavo; Brumley, David (2014). "Optimizing Seed Selection for Fuzzing" (PDF). Proceedings of the 23rd USENIX Conference on Security Symposium: 861–875.
- ^ a b c Patrice Godefroid; Adam Kiezun; Michael Y. Levin. "Grammar-based Whitebox Fuzzing" (PDF). Microsoft Research.
- ^ S2CID 5809364.
- ^ a b c "Peach Fuzzer". Retrieved 2017-03-08.
- ^ Greg Banks; Marco Cova; Viktoria Felmetsger; Kevin Almeroth; Richard Kemmerer; Giovanni Vigna. SNOOZE: Toward a Stateful NetwOrk prOtocol fuzZEr. Proceedings of the Information Security Conference (ISC'06).
- Bibcode:2016arXiv160801723B.
- ^ "VDA Labs - Evolutionary Fuzzing System". Archived from the original on 2015-11-05. Retrieved 2009-05-14.
- ^ September 19, 2018)
- ^ a b Vijay Ganesh; Tim Leek; Martin Rinard (2009-05-16). "Taint-based directed whitebox fuzzing". IEEE. Proceedings of the ACM SIGSOFT International Conference on Software Engineering (ICSE'09).
- S2CID 11898088.
- ^ Patrice Godefroid; Michael Y. Levin; David Molnar (2008-02-08). "Automated Whitebox Fuzz Testing" (PDF). Proceedings of Network and Distributed Systems Symposium (NDSS'08).
- S2CID 15927031.
- ^ Nick Stephens; John Grosen; Christopher Salls; Andrew Dutcher; Ruoyu Wang; Jacopo Corbetta; Yan Shoshitaishvili; Christopher Kruegel; Giovanni Vigna (2016-02-24). Driller: Augmenting. Fuzzing Through Selective Symbolic Execution (PDF). Proceedings of Network and Distributed Systems Symposium (NDSS'16).
- S2CID 3344888.
- doi:10.1109/32.62448.
- .
- S2CID 7165993.
- ^ "Clang compiler documentation". clang.llvm.org. Retrieved 13 March 2017.
- ^ "GNU GCC sanitizer options". gcc.gnu.org. Retrieved 13 March 2017.
- S2CID 7506576.
- ^ McKeeman, William M. (1998). "Differential Testing for Software" (PDF). Digital Technical Journal. 10 (1): 100–107. Archived from the original (PDF) on 2006-10-31.
- S2CID 17344927.
- ^ a b Sesterhenn, Eric; Wever, Berend-Jan; Orrù, Michele; Vervier, Markus (19 Sep 2017). "Browser Security WhitePaper" (PDF). X41D SEC GmbH.
- ^ "Security enhancements for Microsoft Edge (Microsoft Edge for IT Pros)". Microsoft. 15 Oct 2017. Retrieved 31 August 2018.
- ^ "CERT Triage Tools". CERT Division of the Software Engineering Institute (SEI) at Carnegie Mellon University (CMU). Retrieved 14 March 2017.
- ^ "Microsoft !exploitable Crash Analyzer". CodePlex. Retrieved 14 March 2017.
- ^ "Test Case Reduction". 2011-07-18.
- ^ "IBM Test Case Reduction Techniques". 2011-07-18. Archived from the original on 2016-01-10. Retrieved 2011-07-18.
- ISSN 0098-5589. Retrieved 14 March 2017.
- S2CID 227230949.
- ISBN 978-1-939133-24-3.
- ^ Hazimeh, Herrera & Payer 2021, p. 1: "We evaluate seven widely-used mutation-based fuzzers (AFL, ...)".
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, ...".
- ^ Hazimeh, Herrera & Payer 2021, p. 1: "We evaluate seven widely-used mutation-based fuzzers (..., AFL++, ...)".
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, AFLFast, ...".
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, ..., Angora, ...".
- ^ Hazimeh, Herrera & Payer 2021, p. 1: "We evaluate seven widely-used mutation-based fuzzers (..., honggfuzz, ...)".
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, ..., Honggfuzz, ...".
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, ..., QSYM, ...".
- ^ Hazimeh, Herrera & Payer 2021, p. 1: "We evaluate seven widely-used mutation-based fuzzers (..., and SymCC-AFL)".
- ^ Hazimeh, Herrera & Payer 2021, p. 14.
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, ..., T-Fuzz, ...".
- ^ Li et al. 2021, p. 1: "Using UniFuzz, we conduct in-depth evaluations of several prominent fuzzers including AFL, ..., and VUzzer64.".
Further reading
- Nappa, A.; Blázquez, E. (2023). Fuzzing Against the Machine: Automate Vulnerability Research with Emulated IoT Devices on Qemu. Packt Publishing, Limited. ISBN 9781804614976. A comprehensive guide on automated vulnerability research with emulated IoT devices.
- Zeller, Andreas; Gopinath, Rahul; Böhme, Marcel; Fraser, Gordon; Holler, Christian (2019). The Fuzzing Book. Saarbrücken: CISPA + Saarland University. A free, online, introductory textbook on fuzzing.
- Ari Takanen, Jared D. DeMott, Charles Miller, Fuzzing for Software Security Testing and Quality Assurance, 2008, ISBN 978-1-59693-214-2
- Michael Sutton, Adam Greene, and Pedram Amini. Fuzzing: Brute Force Vulnerability Discovery, 2007, ISBN 0-321-44611-9.
- H. Pohl, Cost-Effective Identification of Zero-Day Vulnerabilities with the Aid of Threat Modeling and Fuzzing, 2011
- Fabien Duchene, Detection of Web Vulnerabilities via Model Inference assisted Evolutionary Fuzzing, 2014, PhD Thesis
- Bratus, S., Darley, T., Locasto, M., Patterson, M.L., Shapiro, R.B., Shubina, A., Beyond Planted Bugs in "Trusting Trust": The Input-Processing Frontier, IEEE Security & Privacy Vol 12, Issue 1, (Jan-Feb 2014), pp. 83–87—Basically highlights why fuzzing works so well: because the input is the controlling program of the interpreter.
External links
- Fuzzing Project, includes tutorials, a list of security-critical open-sourceprojects, and other resources.
- University of Wisconsin Fuzz Testing (the original fuzz project) Source of papers and fuzz software.
- Designing Inputs That Make Software Fail, conference video including fuzzy testing
- Building 'Protocol Aware' Fuzzing Frameworks