Smart Greybox Fuzzing

Smart Greybox Fuzzing

Smart Greybox Fuzzing Van-Thuan Pham∗ Marcel Bohme¨ y Andrew E. Santosa∗ Alexandru Razvan˘ Caciulescu˘ z Abhik Roychoudhury∗ ∗National University of Singapore, Singapore [email protected], santosa [email protected] [email protected] yMonash University, Australia [email protected] zUniversity Politehnica of Bucharest, Romania [email protected] Abstract—Coverage-based greybox fuzzing (CGF) is one of the flows. Subsequently, the mutated inputs which are deemed most successful methods for automated vulnerability detection. sufficiently new are submitted for further investigation, at Given a seed file (as a sequence of bits), CGF randomly flips, which point they are mutated further to explore more inputs. deletes or bits to generate new files. CGF iteratively constructs The aim is to enhance greater behavioral coverage, and to (and fuzzes) a seed corpus by retaining those generated files expose more vulnerabilities in a limited time budget. which enhance coverage. However, random bitflips are unlikely One of the most significant and well-known limitations to produce valid files (or valid chunks in files), for applications of CGF is its lack of input structure awareness. The mutation processing complex file formats. operators of CGF work on the bit-level representation of In this work, we introduce smart greybox fuzzing (SGF) the seed file. Random bits are flipped, deleted, added, or which leverages a high-level structural representation of the copied from the same or from a different seed file. Yet, seed file to generate new files. We define innovative mutation many security-critical applications and libraries will pro- operators that work on the virtual file structure rather than on cess highly structured inputs, such as image, audio, video, the bit level which allows SGF to explore completely new input database, document, or spreadsheet files. Finding vulnerabil- domains while maintaining file validity. We introduce a novel ities effectively in applications processing such widely used validity-based power schedule that enables SGF to spend more formats is of imminent need. Mutations of the bit-level file time generating files that are more likely to pass the parsing representation are unlikely to effect any structural changes on the file that are necessary to effectively explore the vast stage of the program, which can expose vulnerabilities much yet sparse domain of valid program inputs. More likely than deeper in the processing logic. not arbitrary bit-level mutations of a valid file will result in Our evaluation demonstrates the effectiveness of SGF. On an invalid file that is rejected by the program’s parser before several libraries that parse structurally complex files, our tool reaching the data processing portion of the program. AFLSMART explores substantially more paths (up to 200%) To tackle this problem, two main approaches have been and exposes more vulnerabilities than baseline AFL. Our proposed that are based on dictionaries [30] and dynamic tool AFLSMART has discovered 42 zero-day vulnerabilities taint analysis [25]. Michał Zalewski, the creator of AFL, in widely-used, well-tested tools and libraries; so far 17 CVEs introduced the dictionary, a lightweight technique to inject were assigned. interesting byte sequences or tokens into the seed file during mutation at random locations. Zalewski’s main concern [35] 1. Introduction was that a full support of input awareness might come at a cost of efficiency or usability, both of which are AFL’s secret Coverage-based greybox fuzzing (CGF) is a popular and to success. AFL benefits tremendously from a dictionary arXiv:1811.09447v1 [cs.CR] 23 Nov 2018 effective approach for software vulnerability detection. As when it needs to come up with magic numbers or chunk opposed to blackbox approaches which suffer from a lack of identifiers to explore new paths. Rawat et al. [25] leverage knowledge about the application, and whitebox approaches dynamic taint analysis [26] and control flow analysis to infer which incur high overheads due to program analysis and the locations and the types of the input data based on which constraint solving, greybox approaches use lightweight code their tool (VUZZER) knows where and how to mutate the instrumentation. The American Fuzzy Lop (AFL) fuzzer input effectively. However, both the dictionary and taint- [31] and its extensions [1], [2], [7], [17], [18], [21], [27] based approaches do not solve our primary problem: to constitute the most widely-used embodiment of CGF. mutate the high-level structural representation of the file CGF technology proceeds by input space exploration via rather than its bit-level representation. For instance, neither mutation. Starting with seed inputs, it mutates them using a a dictionary nor an inferred program feature help in adding pre-defined set of generic mutation operators (such as bit- or deleting complete chunks from a file. flips). Control flows exercised by the mutated inputs are then In contrast to CGF, smart blackbox fuzzers [15], [38] examined to determine whether they are sufficiently “inter- are already input-structure aware and leverage a model of esting”. The lightweight program instrumentation helps the the file format to construct new valid files from existing fuzzer make this judgment on the novelty of the control valid files. For instance, Peach [38] uses an input model to disassemble valid files and to reassemble them to new number of bugs exposed. One of us spent five working days valid files, to delete chunks, and to modify important data to develop 10 file format specifications (as Peach Pits [38]) values. LangFuzz [15] leverages a context-free grammar for which were used to fuzz all 16 subject programs. Hence, JavaScript (JS) to extract code fragments from JS files and once developed, file format specifications can be reused to reassemble them to new JS files. However, awareness across programs as well as for different versions of the same of input structure alone is insufficient and the coverage- program. feedback of a greybox fuzzer is urgently needed – as shown In summary, the main contribution of our work is to by our experiments with Peach. In our experiments Peach make greybox fuzzing input format-aware. Given an input performs much worse even than AFL, our baseline greybox format specification (e.g., a Peach Pit [38]), our smart fuzzer. Our detailed investigation revealed that Peach does greybox fuzzer derives a structural representation of the seed not reuse the generated inputs that improve coverage for file, called virtual structure, and leverages our novel smart further test input generation. For instance, if Peach generated mutation operators to modify the virtual file structure in a WAV-file with a different (interesting) number of channels, addition to the file’s bit sequence during the generation of that file could not be used to generate further WAV-files with new input files. We propose smart mutation operators, which the newly discovered program behaviour. Without coverage- are likely to preserve the satisfaction w.r.t. a file format feedback interesting files will not be retained for further specification. During the greybox fuzzing search, our tool fuzzing. On the other hand, retaining all generated files AFLSMART measures the degree of validity of the inputs would hardly be economical. produced with respect to the file format specification. It In this paper, we introduce smart greybox fuzzing prioritizes valid inputs over invalid ones, by enabling the (SGF)—which leverages a high-level structural representa- fuzzer to explore more mutations of a valid file as opposed tion of the seed file to generate new files—and investigate to an invalid one. As a result, our smart fuzzer largely the impact on fuzzer efficiency and usability. We define explores the restricted space of inputs which are valid as innovative mutation operators that work on the virtual struc- per the file format specification, and attempts to locate ture of the file rather than on the bit level. These structural vulnerabilities in the file processing logic by running inputs mutation operators allow SGF to explore completely new in- in this restricted space. We conduct extensive evaluation on put domains while maintaining the validity of the generated well-tested subjects processing complex file formats such as files. We introduce a novel validity-based power schedule PNG and WAV. Our experiments demonstrate that the smart that assigns more energy to seeds with a higher degree of mutation operators and the validity-based power schedule validity and enables SGF to spend more time generating introduced by us, increases the effectiveness of fuzzing both files that are more likely to pass the parsing stage of the in terms of path coverage and vulnerabilities found within a program to discover vulnerabilities deep in the processing time limit of 24 hours. These results also demonstrate that logic of the program. the additional effectiveness in our smart fuzzer AFLSMART We implement AFLSMART, a robust yet efficient and is not achieved by sacrificing the efficiency of greybox easy-to-use smart greybox fuzzer based on AFL, a popular fuzzing and AFL. and very successful CGF. AFLSMART integrates the input- structure component of Peach with the coverage-feedback 2. Motivating Example component of AFL. Hence, in our evaluation we compare against both as baseline techniques. Our evaluation demon- strates that AFLSMART, within a given time limit of 24 2.1. The WAVE File Format hours, can double the zero-day bugs found. AFLSMART dis- covers 33 bugs (8 CVEs assigned) while the baseline (AFL Most file systems store information as a long string of and its extension AFLFAST [2]) can detect only 16 bugs, zeros and ones—a file. It is the task of the program to make in large, widely-used, and well-fuzzed open-source soft- sense of this sequence of bits, i.e., to parse the file, and to ware projects, such as FFmpeg, LibAV, LibPNG, Wavpack, extract the relevant information.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    16 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us