Faster Fuzzing: Reinitialization with Deep Neural Models

Nicole Nichols, Mark Raugas, Robert Jasper, Nathan Hilliard

Abstract

We improve the performance of the American Fuzzy Lop (AFL) fuzz testing framework by using Generative Adversarial Network (GAN) models to reinitialize the system with novel seed files. We assess performance based on the temporal rate at which we produce novel and unseen code paths. We compare this approach to seed file generation from a random draw of bytes observed in the training seed files. The code path lengths and variations were not sufficiently diverse to fully replace AFL input generation. However, augmenting native AFL with these additional code paths demonstrated improvements over AFL alone. Specifically, experiments showed the GAN was faster and more effective than the LSTM and out-performed a random augmentation strategy, as measured by the number of unique code paths discovered. GAN helps AFL discover 14.23% more code paths than the random strategy in the same amount of CPU time, finds 6.16% more unique code paths, and finds paths that are on average 13.84% longer. Using GAN shows promise as a reinitialization strategy for AFL to help the fuzzer exercise deep paths in software.

Introduction

Fuzz testing is a critical technique for discovering software vulnerabilities by feeding programs a high volume of mutated inputs to trigger crashes or unexpected behavior. American Fuzzy Lop (AFL) is the industry standard for coverage-guided fuzzing, but it often reaches a performance plateau. Because AFL relies on random mutations of existing seed files, it can struggle to generate the specific, complex inputs required to reach "deep" code paths where the most dangerous bugs often reside.

This paper proposes a reinitialization strategy to overcome this limitation. Instead of allowing AFL to run indefinitely with its own mutations, we periodically augment the process with high-quality synthetic seeds generated by deep learning models. By learning the underlying structure of successful inputs, these models provide the fuzzer with "smarter" starting points, enabling it to explore new areas of the program's state space.

Methodology

The researchers compared three distinct approaches for generating new seed files to augment the AFL process:

  1. LSTM (Long Short-Term Memory): A character-level recurrent neural network trained to predict the next byte in a sequence.
  2. GAN (Generative Adversarial Network): A setup where a Generator network creates synthetic seeds and a Discriminator network attempts to distinguish them from real, successful AFL seeds.
  3. Random Baseline: A control group that draws random bytes from the existing seed files.
Statistical properties of the initial AFL seed corpus versus synthetic seeds generated by LSTM and GAN models.

As shown in Figure 1, the neural models attempt to capture the latent structure of the training corpus. While the GAN-generated seeds are fewer in number than the original AFL corpus, they maintain a high degree of uniqueness and length, which is crucial for effective downstream mutation by AFL.

Experimental Setup

The approach was evaluated using ethkey, a C++ utility from the Ethereum project. To generate training data, AFL was run on 200 CPU cores for 72 hours, accumulating a corpus of 38,384 unique seed files. The performance of the GAN, LSTM, and Random strategies was then measured by their ability to discover new paths when starting from this initial corpus.

Results and Discussion

The experimental results demonstrate that GAN-based augmentation is significantly more effective than both the LSTM and random strategies.

Performance metrics for novel path discovery, comparing the GAN and LSTM strategies against a random baseline.

Key results from the evaluation (summarized in Figure 3) include:

  • Increased Coverage: The GAN-based approach found 6.16% more unique code paths overall compared to the random baseline.
  • Improved Efficiency: The GAN discovered new code paths 14.23% faster than the random strategy in the same amount of CPU time.
  • Deeper Reach: Code paths discovered by the GAN were, on average, 13.84% longer than those found by the random strategy, suggesting the fuzzer reached deeper into the program's logic.
  • Training Performance: GANs were much faster to train, taking only 30 minutes compared to the LSTM’s 14 hours.

The GAN successfully learned the latent structure of valid inputs for ethkey without manual rules, producing inputs that were "legal" enough to pass initial checks but "novel" enough to trigger new code.

Conclusion

Augmenting AFL with GAN-generated seeds provides a significant performance boost, particularly in reaching deep code paths. While the neural models do not yet replace AFL's mutation engine, they serve as an excellent reinitialization tool to help the fuzzer break out of local optima. Future work will explore Reinforcement Learning to provide models with direct feedback on path discovery and testing on more diverse software targets.

Summary updated

Abstract

We improve the performance of the American Fuzzy Lop (AFL) fuzz testing framework by using Generative Adversarial Network (GAN) models to reinitialize the system with novel seed files. We assess performance based on the temporal rate at which we produce novel and unseen code paths. We compare this approach to seed file generation from a random draw of bytes observed in the training seed files. The code path lengths and variations were not sufficiently diverse to fully replace AFL input generation. However, augmenting native AFL with these additional code paths demonstrated improvements over AFL alone. Specifically, experiments showed the GAN was faster and more effective than the LSTM and out-performed a random augmentation strategy, as measured by the number of unique code paths discovered. GAN helps AFL discover 14.23% more code paths than the random strategy in the same amount of CPU time, finds 6.16% more unique code paths, and finds paths that are on average 13.84% longer. Using GAN shows promise as a reinitialization strategy for AFL to help the fuzzer exercise deep paths in software.
BibTeX
@misc{nichols2017faster,
  author = {Nicole Nichols and Mark Raugas and Robert Jasper and Nathan Hilliard},
  title = {{Faster Fuzzing: Reinitialization with Deep Neural Models}},
  year = {2017},
  eprint = {1711.02807},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.02807},
}
Figure