NEUZZ: Efficient Fuzzing with Neural Program Smoothing

Dongdong She, Kexin Pei, Dave Epstein, Junfeng Yang, Baishakhi Ray, Suman Jana

Abstract

Fuzzing has become the de facto standard technique for finding software vulnerabilities. However, even state-of-the-art fuzzers are not very efficient at finding hard-to-trigger software bugs. Most popular fuzzers use evolutionary guidance to generate inputs that can trigger different bugs. Such evolutionary algorithms, while fast and simple to implement, often get stuck in fruitless sequences of random mutations. Gradient-guided optimization presents a promising alternative to evolutionary guidance. Gradient-guided techniques have been shown to significantly outperform evolutionary algorithms at solving high-dimensional structured optimization problems in domains like machine learning by efficiently utilizing gradients or higher-order derivatives of the underlying function. However, gradient-guided approaches are not directly applicable to fuzzing as real-world program behaviors contain many discontinuities, plateaus, and ridges where the gradient-based methods often get stuck. We observe that this problem can be addressed by creating a smooth surrogate function approximating the target program's discrete branching behavior. In this paper, we propose a novel program smoothing technique using surrogate neural network models that can incrementally learn smooth approximations of a complex, real-world program's branching behaviors. We further demonstrate that such neural network models can be used together with gradient-guided input generation schemes to significantly increase the efficiency of the fuzzing process. Our extensive evaluations demonstrate that NEUZZ significantly outperforms 10 state-of-the-art graybox fuzzers on 10 popular real-world programs both at finding new bugs and achieving higher edge coverage. NEUZZ found 31 previously unknown bugs (including two CVEs) that other fuzzers failed to find in 10 real-world programs and achieved 3X more edge coverage than all of the tested graybox fuzzers over 24 hour runs. Furthermore, NEUZZ also outperformed existing fuzzers on both LAVA-M and DARPA CGC bug datasets.

Introduction

Fuzzing is the gold standard for finding software vulnerabilities by feeding a program millions of random inputs to trigger crashes. Most modern "graybox" fuzzers, such as AFL, rely on evolutionary algorithms. These tools mutate inputs, observe if they hit new code paths (edge coverage), and retain successful mutations for further iteration.

However, evolutionary fuzzers essentially operate by "guessing" in the dark. They struggle with complex program logic where only a very specific input—such as a 4-byte "magic number"—will trigger a new branch. While gradient-guided optimization is used in fields like machine learning to solve high-dimensional problems efficiently, it is not directly applicable to programs. Program behavior is inherently discrete and discontinuous; a single bit flip can cause a program to take a completely different path, creating "cliffs" and "plateaus" in the search space where gradients are useless.

Methods: Neural Program Smoothing

NEUZZ addresses the discontinuity problem by introducing Neural Program Smoothing. Instead of calculating gradients on the program itself, NEUZZ trains a surrogate model—a simple three-layer feed-forward Neural Network (NN)—to mimic the program's branching behavior.

The NEUZZ workflow: using neural networks to create a differentiable surrogate for gradient-guided input generation.

The NEUZZ Architecture

  1. Surrogate Modeling: The NN takes raw bytes of a test case as input and outputs a bitmap representing the control-flow edges exercised. Because NNs are differentiable by design, they provide a "smooth" approximation of the program's discrete landscape.
  2. Gradient-Guided Mutation: NEUZZ calculates the gradient of the NN's output with respect to the input bytes. This identifies which bytes are most influential for reaching new, untaken branches. By following the sign of the gradient, the fuzzer knows whether to increase or decrease a byte's value to flip a specific branch condition.
  3. Incremental Learning: As new code areas are discovered, the NN is periodically retrained using an incremental learning scheme. This prevents the model from "forgetting" old behaviors while adapting to newly explored program logic.
Visualization of program smoothing: (a) original discrete behavior, (b) initial NN approximation, and (c) refined model for gradient-guided bug discovery.

Evaluation and Key Results

The researchers evaluated NEUZZ against 10 state-of-the-art fuzzers using three major benchmarks: 10 real-world programs (e.g., libjpeg, libxml2), the LAVA-M bug dataset, and 50 binaries from the DARPA Cyber Grand Challenge (CGC).

NEUZZ significantly outperformed all baseline fuzzers in both speed and depth:

  • New Vulnerabilities: NEUZZ discovered 31 previously unknown bugs in mature, real-world programs, resulting in two new CVEs.
  • Superior Coverage: It achieved 3x more edge coverage than the best-performing graybox fuzzers over a 24-hour period.
  • Efficiency: On the LAVA-M dataset, NEUZZ found more bugs in 5 hours than most other fuzzers found in much longer runs. In the CGC benchmark, it uncovered bugs in 31 out of 50 binaries, outperforming specialized tools like Driller (25 bugs) and AFL (21 bugs).

Conclusion

NEUZZ demonstrates that neural networks are naturally suited as "universal smoothers" for program analysis. By transforming discrete program logic into a differentiable surface, NEUZZ overcomes the "magic number" wall that stymies traditional evolutionary fuzzers. Future work may involve exploring more sophisticated optimization techniques, such as Newton's method, and applying smoothing to other aspects of automated software testing.

Summary updated

BibTeX
@inproceedings{she2019neuzz,
  author = {Dongdong She and Kexin Pei and Dave Epstein and Junfeng Yang and Baishakhi Ray and Suman Jana},
  title = {{NEUZZ: Efficient Fuzzing with Neural Program Smoothing}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2019},
  url = {https://openreview.net/forum?id=Q80Adv1LzGX},
}
Figure