Abstract
Fuzzing efficiency is often bottlenecked by the quality of the initial "seed" inputs used to start the testing process. This paper introduces a machine learning framework that uses Recurrent Neural Networks (RNNs) to predict unexplored execution paths and a Sequence-to-Sequence (Seq2seq) model to "back-translate" those paths into valid, high-quality seed files. By treating program execution as a language, the system significantly increases code coverage and bug discovery rates across complex file formats like PDFs.
Introduction
Fuzzing is a cornerstone of automated software testing, relying on the mutation of input data to trigger crashes or vulnerabilities. However, the effectiveness of a fuzzer is heavily dependent on its starting point: the seed corpus. If initial seeds only exercise a small portion of the code, the fuzzer often fails to reach deep logic where critical vulnerabilities may reside. This is particularly challenging for complex formats like PDFs, where random mutations often break the file's syntax before reaching new code paths.
The authors address this redundancy problem by modeling the correlation between specific file structures and the code paths they trigger. Instead of relying on random mutation, the proposed system intentionally generates seeds designed to explore unvisited territory by leveraging Natural Language Processing (NLP) techniques.
Methodology
The proposed framework operates in two primary phases: Learning and Generating.
- Data Preparation (Path Recording): Using dynamic instrumentation (Intel Pin), the system tracks the execution of a target program (e.g., a PDF viewer) as it processes an initial corpus. To handle the high dimensionality of execution traces, long sequences of basic blocks are compressed into "super-blocks."
- Path Generation: An RNN-based language model (Char-RNN) is trained on these execution paths. By learning the "language" of the program's execution, the model can predict new, valid sequences of basic blocks that have not yet been observed.
- Seed Generation (The "Translator"): A Seq2seq model is employed to map desired execution paths back into valid files. An Object Extractor identifies structural components from the original corpus, and the Seq2seq model learns which objects correlate to specific code paths, assembling new files (e.g., PDFs) designed to trigger the predicted paths.
Evaluation and Results
The framework was evaluated using an initial corpus of 43,684 PDF files against widely used viewers such as MuPDF, pdfium, and poppler. To test generalizability, the researchers also applied the system to libpng and freetype.
The results demonstrate a significant improvement over traditional seed selection. On MuPDF, the generated seeds covered 24.30% more execution paths and 2.40% more basic blocks than the original high-quality corpus. In head-to-head fuzzing trials, these ML-optimized seeds triggered 67 crashes—including two new CVE vulnerabilities—compared to only 32 crashes from the original seeds. The system also showed remarkable versatility, increasing path coverage for the freetype library by 53.90%.
Discussion and Conclusion
The core innovation of this work is the treatment of execution paths as a language, allowing the application of sophisticated NLP models to predict and reach new program states. By bridging the semantic gap between file structure and code execution, the framework bypasses the need for manual grammar definitions.
However, limitations remain. The system's performance is still tied to the diversity of the initial learning corpus. Furthermore, the computational cost of training RNN and Seq2seq models is non-trivial. Future work aims to integrate this targeted generation more tightly with mutation-based fuzzers like AFL to create a continuous feedback loop, further enhancing the depth and breadth of automated software testing.
Summary updated