TL;DR
This paper introduces a novel technique that enhances greybox fuzzing by systematically learning concrete input values from past executions instead of relying solely on random mutations. By using a lightweight linear approximation to minimize execution "costs" (such as the distance to flipping a branch condition), the approach increases path coverage by up to 3X and detects up to 38% more bugs—often orders of magnitude faster than traditional greybox fuzzing.
What Problem Does This Paper Address?
Software testing relies heavily on automated test case generation. At one end of the spectrum, whitebox fuzzing and dynamic symbolic execution (DSE) use heavy program analysis and constraint solvers to systematically explore code paths. While highly effective, they suffer from significant performance and scalability bottlenecks. At the other end, greybox fuzzing (like AFL) uses lightweight instrumentation to track code coverage and mutates inputs randomly (e.g., bit-flipping).
While greybox fuzzing is fast and practical, it struggles with "narrow checks"—conditional statements that are only satisfied by a tiny fraction of the input space (for example, if x == 42). The probability of a random mutation hitting exactly the right value is incredibly low, leaving deep or heavily guarded program paths completely un-fuzzed. The authors address this gap by introducing a data-driven way to guide greybox fuzzing through these narrow checks without incurring the heavy performance costs of whitebox analysis.
Methods
The authors propose Greybox Fuzzing with Learning. The core idea is to treat the program under test as a mathematical function mapping inputs to execution "costs" ($costs = f(inputs)$).
- Cost Metrics: The fuzzer instruments the program at runtime to calculate a cost metric for specific program states. For branch conditions, the cost represents how close an execution came to flipping the branch (e.g., for
if (l == r), the cost might be $|l - r|$). A cost of0means the target condition was successfully met. - Input Learner: Instead of using complex machine learning models or heavy constraint solvers, the fuzzer employs a remarkably simple strategy: it takes two explored inputs that differ by a single parameter and their corresponding costs, fits a straight line between them using basic algebra, and solves for the input value where the cost equals zero.
If the learned input successfully drives the program down a new path, it is added to the test suite. If the linear approximation fails (because the local program behavior is non-linear), the fuzzer gracefully falls back to traditional random mutations.
Datasets
The authors evaluated their approach on a suite of 26 real-world Ethereum smart contracts compiled to Ethereum Virtual Machine (EVM) bytecode. Smart contracts are an ideal target because they handle high-value crypto-assets and are prone to expensive exploits.
The benchmark suite includes highly popular community projects (like the ENS domain auction and Consensys wallets), historically hacked contracts (The DAO, Parity multisig wallet), and entries from the Underhanded Solidity Coding Contest (USCC).
Key Insights and Ideas
- The Power of Two-Point Linear Regression: One of the most surprising insights is that a simple linear approximation using just two data points is highly effective in practice. While programs are globally complex and non-linear, branch conditions evaluated locally often behave linearly with respect to input parameters.
- Fuzzing as a Data Generator: Fuzzers naturally generate millions of execution traces. This approach reframes fuzzing as a data-generation process for machine learning, leveraging otherwise discarded "failed" mutations to learn the mathematical relationships governing the program's control flow.
- Fail-Safe Architecture: Because the learning mechanism is tightly integrated into a standard greybox fuzzing loop, imprecise approximations do not break the tool; the fuzzer simply reverts to random mutations when learning fails, maintaining high throughput.
Key Results
The authors compared their enhanced fuzzer against a vanilla greybox fuzzer across 5-minute, 30-minute, and 3-hour time limits:
- Path Coverage: Learning increased path coverage in 24 out of 26 benchmarks within a 5-minute window, achieving up to a 3X increase in coverage for some contracts.
- Bug Detection: Over a 3-hour run, the fuzzer with learning found 91 bugs compared to 78 found by the vanilla fuzzer (a ~16% increase overall, and up to 38% more in shorter time frames). These included critical vulnerabilities like assertion violations, precondition failures, and unauthorized writes to arbitrary memory addresses.
- Speedups: The time-to-bug was drastically reduced. For instance, a critical vulnerability in benchmark 26 was found 600X faster using the learning-enhanced approach.
The step-by-step progression of how these inputs are systematically derived can be seen in the paper's running example table:
Limitations and Future Work
The primary limitation of this approach lies in cryptographic hashes. If a branch condition depends on a hash function (e.g., sha3(x) == 42), the cost function becomes highly discontinuous and chaotic. In these scenarios, linear approximation completely fails, resulting in a low learning success rate (as seen in benchmark 26, which heavily utilized cryptographic functions).
For future work, the authors plan to investigate more sophisticated cost metrics and alternative learning techniques, such as decision-tree learning, to better capture non-linear program structures.
Summary updated