HuntFUZZ: Enhancing error handling testing through clustering based fuzzing

Jin Wei, Ping Chen, Jun Dai, Xiaoyan Sun, Zhihao Zhang, Chang Xu, Yi WangJ. Comput. Secur 2024

Abstract

Testing error-handling logic is critical for software reliability but remains challenging because these code paths are rarely executed during normal operation. Traditional fuzzing and Software Fault Injection (SFI) techniques often suffer from inefficiencies due to redundant exploration of shared execution paths. This paper presents HuntFUZZ, an SFI-based fuzzing framework that leverages path correlation to cluster related error points. By optimizing concolic execution to solve constraints for shared paths once per cluster, HuntFUZZ significantly improves testing efficiency. Evaluation on 42 applications demonstrates a 38.9% increase in error coverage compared to state-of-the-art tools and the discovery of 7 new zero-day vulnerabilities in prominent software like OpenSSL and Bash.

Introduction

Software vulnerabilities frequently reside in error-handling logic—the "dark corners" of a codebase that manage failures like memory allocation errors or network drops. SFI-based fuzzing intentionally triggers these errors to test recovery code. However, existing tools treat error points as independent targets, leading to significant redundancy. For instance, multiple error points within the same conditional block require the fuzzer to repeatedly solve the same path constraints to reach them. This inefficiency hinders the discovery of deep-seated bugs.

Methodology

HuntFUZZ addresses these challenges through a "cluster-first" approach, integrating three novel modules into the fuzzing pipeline.

HuntFUZZ System Architecture

The framework operates as follows:

  1. Error Points Clustering: HuntFUZZ analyzes the program's Control Flow Graph (CFG) to group error points that share a common "parent" node within a defined distance. This prevents the fuzzer from wasting resources reaching the same logical neighborhood multiple times.
  2. Cluster Weight Calculation: Clusters are prioritized based on a weight that balances the potential reward (number of error points) against the cost (distance from the current execution path).
  3. Optimized Concolic Execution: To reduce the computational overhead of SMT solvers, HuntFUZZ uses concolic execution only to reach the longest common path of a cluster. Once the common parent node is reached, high-speed mutation is employed to explore individual error points within that cluster.
Clustering Error Points on a Control Flow Graph

Evaluation and Results

The researchers evaluated HuntFUZZ against 42 applications, including the UniBench suite, the EH-FUZZ dataset, and real-world programs like bash and gzip.

  • Bug Discovery: HuntFUZZ identified 162 known bugs and 7 unique zero-day vulnerabilities in high-profile projects such as OpenSSL, libtiff, and bash.
  • Efficiency and Coverage: HuntFUZZ achieved a 38.9% increase in error coverage over EH-FUZZ. In a test on SQLite, HuntFUZZ reached 2,000 error sequences in half the time required by its predecessor (8 hours vs. 16 hours).
  • Deep-State Testing: The framework is particularly effective at reaching "deep-state" error points (depth > 500 in the CFG), finding 22 such bugs where previous tools found only one.

Conclusion

HuntFUZZ demonstrates that exploiting path correlation through clustering can significantly enhance the efficiency of error-handling testing. By focusing concolic execution on shared paths, it reaches deeper code regions and uncovers vulnerabilities that traditional fuzzers miss. Future work includes extending this clustering logic to general-purpose fuzzing and improving automated root cause analysis for the discovered crashes.

Summary updated

BibTeX
@article{wei2024huntfuzz,
  author = {Jin Wei and Ping Chen and Jun Dai and Xiaoyan Sun and Zhihao Zhang and Chang Xu and Yi Wang},
  title = {{HuntFUZZ: Enhancing error handling testing through clustering based fuzzing}},
  journal = {J. Comput. Secur.},
  year = {2024},
}
Figure