Abstract
Deep learning (DL) libraries like TensorFlow and PyTorch are critical infrastructure, yet their complex input constraints make traditional fuzzing ineffective. Most random inputs fail validation checks, never reaching the core logic. SkipFuzz addresses this "validity wall" by employing an active learning framework that automatically learns API constraints. By treating the library as an oracle, SkipFuzz iteratively refines its understanding of valid input spaces. In evaluations, SkipFuzz discovered 43 new crashes in TensorFlow and PyTorch, leading to 13 unique CVEs, and significantly outperformed existing documentation-based and mining-based fuzzers in both API coverage and input diversity.
Introduction
Deep learning libraries are the foundation of modern AI, but their security is difficult to maintain. Traditional fuzzing—generating random inputs to find crashes—is often ineffective for DL APIs due to two primary challenges: the "Validity Wall" and redundancy. DL APIs require highly specific tensor shapes, data types, and value ranges. Random inputs are typically rejected by internal validation, failing to exercise the core library logic. Furthermore, even when valid inputs are found, fuzzers often generate redundant cases that waste resources without exploring new execution paths.
SkipFuzz overcomes these hurdles by learning API constraints "on the fly" through active learning, eliminating the need for manual documentation or extensive code mining.
Methods
SkipFuzz treats the target DL library as an oracle within an active learning loop. The system architecture, shown in Figure 1, illustrates how the fuzzer navigates the input space through three distinct phases: Random mode, Inference mode, and Valid input mode.
The framework operates through several key components:
- Input Categorization: Instead of raw bytes, SkipFuzz uses 92 property templates to group inputs into categories. These templates cover Type/Structure, Value, and Shape constraints, as detailed in Figure 2. This allows the fuzzer to reason about abstract input properties rather than specific values.
- Active Learner: This component poses "queries" to the library by selecting an input category and observing the outcome: Did the library accept it (valid), reject it with an error (invalid), or crash?
- Hypothesis Refinement: Based on these outcomes, SkipFuzz builds a mathematical model (a hypothesis) of the API's constraints. It then specifically chooses new inputs that will most effectively test and refine this hypothesis.
- Three-Phase Fuzzing: The process begins with Random Mode to find initial valid inputs, moves to Inference Mode to map out the boundaries of what the API allows, and concludes with Valid Input Generation to hammer the core logic with a diverse array of valid inputs.
Evaluation and Key Results
The researchers evaluated SkipFuzz against TensorFlow 2.7.0 and PyTorch 1.10 using seed inputs from official developer test suites. SkipFuzz was compared against state-of-the-art baselines: DocTer (documentation-based), FreeFuzz (mining-based), and DeepRel (relational-based).
SkipFuzz significantly outperformed existing tools across several metrics:
- Bug Discovery: It identified 43 new crashes, resulting in 13 unique CVEs (Common Vulnerabilities and Exposures).
- API Coverage: It generated valid inputs for 37% of tested APIs, outperforming DeepRel (30%) and DocTer (12%).
- Input Diversity: SkipFuzz covered 31% of possible input properties, nearly doubling the diversity of its closest competitors.
- Efficiency: Ablation studies confirmed that the active learning component is vital; removing it caused the number of detected crashes to plummet by over 60%.
Discussion and Insights
A key takeaway from SkipFuzz is that documentation is not a prerequisite for effective fuzzing. By observing library reactions, a tool can reverse-engineer rules more accurately than by relying on often-incomplete manuals. Furthermore, the results highlight that diversity in valid inputs is more critical than sheer volume. SkipFuzz’s success stems from its ability to explore a wide variety of unique input properties. Finally, the use of negative feedback (invalid responses) is crucial for pruning the search space and avoiding "dead ends."
Conclusion and Future Work
While SkipFuzz is highly effective, it is limited by its reliance on dynamic analysis; it can only learn constraints triggered during execution. The hypothesized models are also "under-approximations," potentially missing some valid input spaces. Future work includes expanding property templates to model complex inter-argument relationships and exploring hybrid approaches that combine active learning with static analysis to improve coverage of hidden code paths.
Summary updated