Overview
BandFuzz is a novel collaborative fuzzing framework that uses a Multi-Armed Bandit (MAB) machine learning model to intelligently allocate resources among multiple fuzzers. By accounting for "branch difficulty" rather than just raw code coverage, it achieves state-of-the-art performance and won first place in the 2024 SBFT worldwide fuzzing competition.
The Challenge of Collaborative Fuzzing
Fuzz testing—the process of feeding random data into programs to find bugs—has hit a plateau. While individual fuzzers like AFL++ are highly effective, they rely on specific design assumptions that do not always hold true for every program. "Collaborative fuzzing" emerged to solve this by combining multiple fuzzers, but existing frameworks face two major hurdles:
- Resource Greed: Many require running multiple fuzzers in parallel, demanding massive computational power.
- Short-sighted Allocation: Frameworks that do manage resources often use "greedy" algorithms. They pick the fuzzer that performed best in the last five minutes, ignoring those that might be doing the "heavy lifting" of unlocking complex code paths that take longer to explore.
Methodology
The authors introduce BandFuzz, which treats collaborative fuzzing as a reinforcement learning problem. The framework intelligently schedules different fuzzers to maximize long-term coverage gains.
Core Components
- Customized Thompson Sampling: BandFuzz uses this Multi-Armed Bandit algorithm to decide which fuzzer to run next. It balances exploration (trying different fuzzers to see their potential) with exploitation (using the fuzzer that currently provides the best results).
- Branch Difficulty Metric: Instead of just rewarding a fuzzer for finding any new code, BandFuzz rewards it based on the time required to discover a branch. If a branch takes a long time to find, it’s considered "difficult," and the fuzzer that finally cracks it receives a higher reward.
- Real-time Seed Synchronization: A central interface maintains a global seed pool. When one fuzzer finds an interesting input, it is immediately shared with all others, preventing redundant work.
- Auto-cycle Mechanism: To ensure fairness, BandFuzz dynamically adjusts the number of execution cycles for each fuzzer based on its average execution time, ensuring that "slow" fuzzers aren't unfairly penalized compared to "fast" ones within a fixed time budget.
Evaluation and Results
The framework was evaluated using industry-standard benchmarks including FuzzBench, the Fuzzer Test Suite (FTS), and the SBFT 2024 Competition.
Key Results
- Superior Coverage: BandFuzz outperformed ten popular individual fuzzers (including AFL++, Angora, and MOpt) on FuzzBench.
- Beating the State-of-the-Art: In head-to-head tests on FTS, BandFuzz achieved a 16% improvement in average branch coverage over
autofz, the previous leading collaborative framework. - Real-World Victory: BandFuzz won first place in the SBFT 2024 Fuzzing Competition, achieving a mutation score that was 14% higher than the second-place finisher.
- Efficiency: It achieves these results using the same computational resources (a single CPU core) as a standard individual fuzzer.
Key Insights
- Global vs. Local Optimization: Greedy resource allocation is sub-optimal. A fuzzer might seem "unproductive" for a while because it is struggling with a complex check, but once it breaks through, it may unlock a massive new area of the program. BandFuzz’s MAB model captures this long-term impact.
- Stability through Ensembles: BandFuzz is more stable than individual tools. If a specific fuzzer performs poorly on a particular target, the framework shifts resources to a better-suited tool.
- The "Warm-up" Trade-off: BandFuzz sometimes starts slower than individual fuzzers because the ML model needs time to "learn" which fuzzer is best for the target. However, it consistently overtakes them in the long run.
Conclusion and Future Work
While BandFuzz represents a significant step forward, the authors acknowledge areas for growth. Currently, it does not include "hybrid" fuzzers due to synchronization complexities. Future work involves expanding to other languages like Rust or Go and exploring "adversarial" bandit models (like EXP3) to better handle the non-stationary nature of fuzzing rewards.
Summary updated