Introduction
Software fuzzing is a critical security testing technique that involves bombarding programs with malformed data to identify vulnerabilities. Traditional tools, such as American Fuzzy Lop (AFL), rely on heuristic or random mutations—like bit-flipping—to generate test cases. While effective, these "blind" methods often produce "garbage" inputs that are immediately rejected by a program's initial sanity checks, wasting computational resources. FuzzCoder addresses this inefficiency by training Large Language Models (LLMs) to predict "fruitful" mutation locations and strategies, effectively teaching them the "art" of breaking software.
Methodology
FuzzCoder reformulates the fuzzing process as a sequence-to-sequence (seq2seq) task. Instead of performing random mutations, the system uses a fine-tuned LLM to analyze hexadecimal byte sequences and predict optimal (position, strategy) pairs.
The framework supports 12 distinct mutation strategies derived from traditional fuzzers, including bit-flipping (1, 2, or 4 bits), arithmetic operations, and boundary-case integer replacement. To enable this "byte-level literacy," the authors created the Fuzz-Instruct dataset, which consists of approximately 30,000 supervised fine-tuning (SFT) pairs. These pairs were harvested from successful historical fuzzing runs where mutations led to new code coverage or crashes. By training on this "success history," models like DeepSeek-Coder and CodeQwen learn to recognize the underlying grammar of binary files, such as targeting metadata headers in JPEGs rather than raw pixel data.
Evaluation and Results
The performance of FuzzCoder was evaluated using Fuzz-Bench, a benchmark of eight diverse programs handling formats like ELF, XML, MP3, and various image types. The study focuses on the Effective Proportion of Mutation (EPM) and Input Gain (the discovery of new execution paths).
The experimental results demonstrate significant improvements over traditional AFL baselines:
- Crash Detection: In the
MP3GAINbenchmark, the DeepSeek-Coder variant of FuzzCoder discovered 230 crashes, compared to only 68 by the original AFL. - Code Coverage: FuzzCoder consistently achieved higher line and branch coverage. For example, in
READ_ELFtests, average coverage improved from ~8.4% (AFL) to ~15.6% (FuzzCoder). - Path Discovery: As illustrated in the Input Gain chart, FuzzCoder variants often doubled or tripled the path discovery rate of heuristic-based baselines across nearly all datasets, particularly in complex formats like
LINT_XMLandREAD_ELF.
Discussion and Limitations
Despite its success, FuzzCoder introduces new challenges, primarily regarding inference latency. Generating mutations via an LLM is computationally more expensive than simple bit-flipping. Therefore, the "intelligence" of the mutation must be high enough to justify the additional time spent. Furthermore, the model's effectiveness is currently dependent on the quality of the initial "seed" mutations provided during training. Future research will focus on "mixture-of-adapter" strategies to enhance instruction tuning and applying the framework to proprietary file formats where human-defined mutation rules are unavailable.
Summary updated