TL;DR
This paper introduces SmartSeed, a novel system that uses machine learning to automatically generate high-value seed files for fuzzing applications. By learning from existing crash-triggering inputs, SmartSeed significantly outperforms traditional seed selection methods, leading to the discovery of more bugs and new vulnerabilities with less effort.
What Problem Does This Paper Address?
Fuzzing is a powerful technique for finding software bugs by feeding an application a large number of malformed or unexpected inputs. The effectiveness of fuzzing heavily relies on the quality of the initial "seed" files used to start the mutation process. However, existing methods for selecting or generating these seed files are often inefficient, unstable, or not significantly better than random selection. This makes it challenging to efficiently discover critical vulnerabilities, especially for applications with complex or unstructured input formats. The authors aim to solve this by creating a system that can intelligently generate high-quality seeds automatically and efficiently.
Methods
SmartSeed employs a machine learning approach, specifically a Generative Adversarial Network (GAN) based on Wasserstein GAN (WGAN), to learn the characteristics of "valuable" input files.
- Training Data Collection: The process begins by collecting "valuable" input files. These are defined as files that trigger unique crashes or new execution paths in an application when fuzzed with standard tools like AFL.
- Raw Data Conversion: To handle diverse file formats and sizes, binary input files are converted into a uniform matrix representation. This involves encoding the binary data into Base64, then mapping characters to numbers, and finally grouping these numbers into larger decimal values to form matrices.
- Model Construction: A WGAN model is trained on these matrices. The generator learns to produce new matrices that mimic the characteristics of the valuable training data, while the discriminator tries to distinguish between real and generated data.
- Inverse Conversion: The generated matrices are then converted back into binary input files, which serve as the high-value seed set for fuzzing tools.
The system is designed to be generic, compatible with various fuzzing tools, and capable of generating seeds for applications with unstructured input formats.
Datasets
The authors evaluated SmartSeed on 12 open-source Linux applications with input formats including mp3, bmp, and flv. These applications were chosen because they are popular, have unstructured input formats, and are representative of real-world software. For training the SmartSeed model, they collected approximately 4,600 input files per format that were known to trigger unique crashes or paths.
Key Insights and Ideas
- "Valuable" seeds are key: The core idea is that not all inputs are equal; some are far more likely to trigger bugs. SmartSeed focuses on learning what makes these "valuable" seeds effective.
- Corrupted files can be good seeds: The authors observed that corrupted or malformed input files are often more effective at triggering crashes. SmartSeed's training process, which uses such files, helps it generate similar beneficial inputs.
- Execution speed isn't everything: Counter-intuitively, seeds that lead to faster execution don't necessarily find more bugs. SmartSeed's focus on "value" over raw speed proves more effective.
- Dense seed distribution is beneficial: Visualizations suggest that SmartSeed generates seeds that are more clustered and closer to known crash-triggering inputs, making them easier for fuzzers to mutate into bug-finding inputs.
Key Results
- Significant crash discovery: SmartSeed, when combined with AFL, discovered more than twice the unique crashes (1,096 total) compared to the best existing seed selection strategy.
- Improved path coverage: It also found 5,040 extra unique paths, indicating better exploration of the application's code.
- New vulnerabilities: SmartSeed helped identify 23 unique vulnerabilities, with 16 of them being previously unreported and assigned CVE IDs.
- Fast seed generation: SmartSeed can generate sufficient high-value seeds (e.g., 100 seeds) in just tens of seconds, making it highly efficient.
- Broad compatibility: SmartSeed demonstrated good compatibility with other popular fuzzing tools like AFLFast, honggfuzz, and VUzzer, often improving their performance.
Limitations and Future Work
The authors acknowledge that SmartSeed, in its current form, is designed for genetic algorithm-based fuzzing and is not directly applicable to generating highly-structured input files. They suggest future work could involve extending SmartSeed to handle such formats. Additionally, they propose exploring better generative models, investigating the optimal scope for different models, and conducting more extensive evaluations with a wider range of applications and input formats to further improve and validate the system.
Summary updated