A Feature-Oriented Corpus for Understanding, Evaluating and Improving Fuzz Testing

Xiaogang Zhu, Xiaotao Feng, Tengyun Jiao, Sheng Wen, Yang Xiang, Seyit Camtepe, Jingling XuearXiv 2019

TL;DR

This paper introduces FEData, a synthetic corpus for fuzz testing that moves beyond simple bug counts to evaluate fuzzers based on specific "search-hampering features" like magic values and execution path complexity. By using FEData to pinpoint why certain fuzzers fail, the authors discovered a critical flaw in the popular AFLFast fuzzer—a state called "cycle explosion"—and developed AFLFast+, an improved version that maintains speed while significantly increasing bug-finding reliability.

What Problem Does This Paper Address?

Fuzzing has become a cornerstone of automated security testing, yet evaluating new fuzzing algorithms remains surprisingly unscientific. Typically, a new fuzzer is run against a set of real-world programs, and its success is measured solely by the number of unique crashes it finds.

The problem? Real-world programs are "black boxes." If a fuzzer fails to find a bug, we don't know why. Was it blocked by a complex checksum? Was the state space too large? Did it fail to guess a "magic value" (a specific constant like 0x1234 required to pass a check)? Without knowing the internal challenges of the benchmark, researchers can draw ambiguous or even incorrect conclusions about a fuzzer's true capabilities.

Methods

The authors propose a "feature-oriented" approach to corpus generation. Instead of just collecting buggy code, they built a framework to synthesize programs with precisely controlled obstacles.

  1. FEData Framework: To keep the synthetic code somewhat realistic, the tool extracts Function Call Graphs (FCGs) from ~18,000 real-world C projects on GitHub.
  2. Feature Injection: It then simplifies these structures and injects four specific "search-hampering features" into a unique "Bug Path":
  3. Dataflow length: The number of inputs required to trigger the bug.
  4. Execution path count: The total number of possible paths, which defines the "search space" size.
  5. Magic values: Specific constants that must be matched exactly to proceed.
  6. Checksums: Complex calculations that guard code blocks.
  7. AFLFast+: Using FEData, the authors identified that AFLFast often falls into a "cycle explosion" state in deep programs, where its energy-saving heuristics cause it to stop generating new inputs entirely. They developed AFLFast+ by implementing a lower bound on energy assignment, preventing the fuzzer from stalling.
Figure 2: The procedure for evaluating fuzzers. Policies limit the way to run fuzz testing. The performance of a fuzzer can be evaluated based on the metrics, which is mainly determined by the capability of solving challenges.

Datasets

  • FEData (New): A prototype synthetic corpus generated from GitHub C projects. It includes specialized subsets, such as 90 binaries with varying path counts and 15 binaries specifically designed with magic value challenges.
  • Comparison Baselines: The paper discusses existing corpora like LAVA/LAVA-M, DARPA CGC, and NIST SAMATE, noting that while they provide bugs, they don't quantify the specific features that make those bugs hard to find.

Key Insights and Ideas

  • The "Why" Matters More Than the "How": By isolating features, FEData can explain why a fuzzer like Driller might beat AFL on one program but lose on another. If a bug isn't hidden behind a magic value, Driller's expensive concolic execution engine is just wasted overhead.
  • Cycle Explosion Discovery: This is the paper's "aha moment." AFLFast is designed to spend less time on frequent paths to find new ones faster. However, in complex programs, this can lead to a death spiral where every path is assigned near-zero "energy," causing the fuzzer to cycle through its queue without actually testing anything new.
  • Bug Paths vs. Noise Paths: FEData ensures that only one unique path leads to the bug, while all other "noise paths" are guaranteed to be bug-free. This allows for perfectly accurate bug counting, avoiding the common pitfall where multiple crashes are actually caused by the same underlying bug.
Figure 3: An example of the bug path and noise paths. The bug path is A →B →C →D which can trigger the bug. The noise paths cannot reach the bug, such as A →B →H → G →E. ‘T’ means True and ‘F’ means False.

Key Results

  • AFLFast vs. AFL: FEData confirmed that while AFLFast finds paths faster, it often finds fewer total bugs in deep programs. In one experiment with magic values, AFL found 7 bugs while AFLFast found 0 due to cycle explosion.
  • AFLFast+ Superiority: The improved AFLFast+ found 88 bugs in the path-searching experiment, compared to 77 by the original AFLFast, all while maintaining the same high execution speed.
  • Magic Value Resilience: In the magic value test where original AFLFast failed completely, AFLFast+ successfully detected 5 bugs, proving that preventing cycle explosion is key to handling complex program logic.
Figure 1: Two program examples that have different num- bers of magic values to protect bugs. It may lead to a wrong conclusion if fuzzers such as Driller and AFL are evaluated on program (A). Driller outperforms AFL only on program (B) since bug is hidden behind two magic value challenges.

Limitations and Future Work

  • Fuzzer Variety: The current evaluation only covers AFL-based fuzzers. The authors acknowledge the need to test FEData against fuzzers specifically designed for magic values (like Driller or T-Fuzz) and checksums (like TaintScope).
  • Realism Trade-offs: To maintain control over features, FEData sacrifices some of the messy complexity of real-world software. Future work involves adding more functional logic to "noise paths" to better mimic real applications.
  • Bug Complexity: The current bugs are relatively simple (CWE-761). The authors suggest that future versions should include more complex logic bugs to challenge advanced directed fuzzers.

Summary updated

BibTeX
@misc{zhu2019feature,
  author = {Xiaogang Zhu and Xiaotao Feng and Tengyun Jiao and Sheng Wen and Yang Xiang and Seyit Camtepe and Jingling Xue},
  title = {{A Feature-Oriented Corpus for Understanding, Evaluating and Improving Fuzz Testing}},
  year = {2019},
  eprint = {1905.01405},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.01405},
}
Figure