NEZHA: Efficient Domain-Independent Differential Testing
Authors:
- Theofilos PetsiosTPTheofilos Petsios
- Adrian TangATAdrian Tang
- Salvatore StolfoSSSalvatore Stolfo
- Angelos D. KeromytisAKAngelos D. Keromytis
- Suman JanaSJSuman Jana
- 1 May 2017
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 615-632
Abstract
Differential testing uses similar programs as cross-referencing oracles to find semantic bugs that do not exhibit explicit erroneous behaviors like crashes or assertion failures. Unfortunately, existing differential testing tools are domain-specific and inefficient, requiring large numbers of test inputs to find a single bug. In this paper, we address these issues by designing and implementing NEZHA, an efficient input-format-agnostic differential testing framework. The key insight behind NEZHA's design is that current tools generate inputs by simply borrowing techniques designed for finding crash or memory corruption bugs in individual programs (e.g., maximizing code coverage). By contrast, NEZHA exploits the behavioral asymmetries between multiple test programs to focus on inputs that are more likely to trigger semantic bugs. We introduce the notion of δ-diversity, which summarizes the observed asymmetries between the behaviors of multiple test applications. Based on δ-diversity, we design two efficient domain-independent input generation mechanisms for differential testing, one gray-box and one black-box. We demonstrate that both of these input generation schemes are significantly more efficient than existing tools at finding semantic bugs in real-world, complex software. NEZHA's average rate of finding differences is 52 times and 27 times higher than that of Frankencerts and Mucerts, two popular domain-specific differential testing tools that check SSL/TLS certificate validation implementations, respectively. Moreover, performing differential testing with NEZHA results in 6 times more semantic bugs per tested input, compared to adapting state-of-the-art general-purpose fuzzers like American Fuzzy Lop (AFL) to differential testing by running them on individual test programs for input generation. NEZHA discovered 778 unique, previously unknown discrepancies across a wide variety of applications (ELF and XZ parsers, PDF viewers and SSL/TLS libraries), many of which constitute previously unknown critical security vulnerabilities. In particular, we found two critical evasion attacks against ClamAV, allowing arbitrary malicious ELF/XZ files to evade detection. The discrepancies NEZHA found in the X.509 certificate validation implementations of the tested SSL/TLS libraries range from mishandling certain types of KeyUsage extensions, to incorrect acceptance of specially crafted expired certificates, enabling man-in-the-middle attacks. All of our reported vulnerabilities have been confirmed and fixed within a week from the date of reporting.Keywords
This publication has 30 references indexed in Scilit:
- Guided differential testing of certificate validation in SSL/TLS implementations2015
- Program-Adaptive Mutational Fuzzing2015
- The most dangerous code in the world2012
- A security policy oracleACM SIGPLAN Notices, 2011
- Practical, Low-Effort Equivalence Verification of Real Code2011
- Identifying almost identical files using context triggered piecewise hashingDigital Investigation, 2006
- Execution Generated Test Cases: How to Make Systems Code Crash Itself2005
- Yesterday, my Program Worked. Today, it Does Not. Why?1999
- An empirical study of the reliability of UNIX utilitiesCommunications of the ACM, 1990
- Symbolic execution and program testingCommunications of the ACM, 1976