Skip to main content
QUICK REVIEW

[Paper Review] Building Fast Fuzzers

Rahul Gopinath, Andreas Zeller|arXiv (Cornell University)|Nov 18, 2019
Software Testing and Debugging TechniquesComputer Science43 references9 citations
TL;DR

This paper presents F1, a high-performance grammar fuzzer that achieves speeds up to 300 times faster than existing grammar-based fuzzers like Dharma by applying optimization techniques from functional programming and virtual machine implementation. By modeling grammar generation as a functional program and compiling it to a custom virtual machine, F1 attains throughput exceeding 100 MB/s—surpassing even random fuzzers—while ensuring syntactically valid inputs.

ABSTRACT

Fuzzing is one of the key techniques for evaluating the robustness of programs against attacks. Fuzzing has to be effective in producing inputs that cover functionality and find vulnerabilities. But it also has to be efficient in producing such inputs quickly. Random fuzzers are very efficient, as they can quickly generate random inputs; but they are not very effective, as the large majority of inputs generated is syntactically invalid. Grammar-based fuzzers make use of a grammar (or another model for the input language) to produce syntactically correct inputs, and thus can quickly cover input space and associated functionality. Existing grammar-based fuzzers are surprisingly inefficient, though: Even the fastest grammar fuzzer Dharma still produces inputs about a thousand times slower than the fastest random fuzzer. So far, one can have an effective or an efficient fuzzer, but not both. In this paper, we describe how to build fast grammar fuzzers from the ground up, treating the problem of fuzzing from a programming language implementation perspective. Starting with a Python textbook approach, we adopt and adapt optimization techniques from functional programming and virtual machine implementation techniques together with other novel domain-specific optimizations in a step-by-step fashion. In our F1 prototype fuzzer, these improve production speed by a factor of 100--300 over the fastest grammar fuzzer Dharma. As F1 is even 5--8 times faster than a lexical random fuzzer, we can find bugs faster and test with much larger valid inputs than previously possible.

Motivation & Objective

  • Address the critical performance bottleneck in grammar-based fuzzing, where existing tools are orders of magnitude slower than random fuzzers despite higher effectiveness.
  • Enable fast, effective fuzzing by combining functional programming optimizations with virtual machine compilation techniques to accelerate grammar-based input generation.
  • Close the gap between effectiveness (via grammar-aware inputs) and efficiency (via high-speed generation), making grammar fuzzing practical for large-scale and performance-sensitive testing.
  • Demonstrate that grammar-based fuzzing can be both highly effective and as fast as, or faster than, purely random fuzzing by rethinking the implementation stack from a systems programming perspective.

Proposed method

  • Model grammar-based input generation as a pure functional program, enabling application of functional programming optimizations such as defunctionalization and supercompilation.
  • Compile the grammar fuzzer into a custom virtual machine (VM) with both direct and context-threaded execution, reducing interpretation overhead.
  • Treat the random number stream as a sequence of opcodes for the VM, allowing deterministic and composable control over the fuzzer’s behavior and path exploration.
  • Apply domain-specific optimizations, including memoization and early termination, to reduce redundant computation during grammar expansion.
  • Use a two-phase compilation pipeline: first, transform the grammar into a functional intermediate representation; second, compile it to optimized VM code for high-speed execution.
  • Leverage superoptimization techniques on the generated VM code to further reduce instruction count and improve runtime performance, though this is left for future work.

Experimental results

Research questions

  • RQ1Can grammar-based fuzzing achieve performance comparable to random fuzzing while maintaining syntactic correctness?
  • RQ2To what extent can optimization techniques from functional programming and virtual machine implementation improve the speed of grammar-based fuzzer generation?
  • RQ3How can a grammar fuzzer be rearchitected as a functional program and compiled to a virtual machine to achieve high throughput?
  • RQ4What performance gains are possible by treating random number streams as opcodes for a domain-specific virtual machine in fuzzing?
  • RQ5Can the combination of functional programming abstractions and VM compilation close the performance gap between grammar-based and random fuzzers?

Key findings

  • F1 achieves a 100–300× speedup over the fastest existing grammar fuzzer, Dharma, demonstrating that high-performance grammar fuzzing is feasible.
  • F1 generates inputs at over 100 MB/s, which is 5–8× faster than a lexical random fuzzer, making it the fastest known fuzzer for generating syntactically valid inputs.
  • The fuzzer's performance surpasses that of random fuzzers despite the added complexity of grammar-aware generation, proving that efficiency and effectiveness are no longer mutually exclusive.
  • The use of functional programming techniques such as defunctionalization and supercompilation enables significant performance improvements through static analysis and code transformation.
  • The virtual machine abstraction allows for efficient execution and opens the door to further optimization via superoptimization, which is shown to be highly applicable to the generated VM code.
  • The entire system is implemented as self-contained Jupyter notebooks, ensuring full reproducibility and extensibility for future research and tool development.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.