Testing Static Analysis Tools Using Exploitable Buffer Overflows From

Testing Static Analysis Tools Using Exploitable Buffer Overflows From

Testing Static Analysis Tools using Exploitable Buffer Overflows from Open Source Code ∗ Misha Zitser Richard Lippmann Tim Leek D. E. Shaw Group MIT Lincoln Laboratory MIT Lincoln Laboratory New York, NY Lexington, MA Lexington, MA [email protected] [email protected] [email protected] ABSTRACT Five modern static analysis tools (ARCHER, BOON, Poly- Space C Verifier, Splint, and UNO) were evaluated using source code examples containing 14 exploitable buffer over- flow vulnerabilities found in various versions of Sendmail, BIND, and WU-FTPD. Each code example included a “BAD” case with and a “OK” case without buffer overflows. Buffer overflows varied and included stack, heap, bss and data buffers; access above and below buffer bounds; access us- ing pointers, indices, and functions; and scope differences between buffer creation and use. Detection rates for the “BAD” examples were low except for PolySpace and Splint which had average detection rates of 87% and 57%, respec- tively. However, average false alarm rates were high and roughly 50% for these two tools. On patched programs these Figure 1: Cumulative buffer overflow vulnerabilities two tools produce one warning for every 12 to 46 lines of found in BIND, WU-FTPD, and Sendmail server source code and neither tool accurately distinguished be- software since 1996 tween vulnerable and patched code. Categories and Subject Descriptors 1. INTRODUCTION D.2.4 [Software Engineering]: [Software/Program Verifi- The Internet is constantly under attack as witnessed by cation]; D.2.5 [Software Engineering]: [Testing and De- recent Blaster and Slammer worms that infected more than bugging]; K.4.4 [Computers and Society]: [Electronic 200,000 computers in a few hours [19, 25]. These, and many Commerce] past worms and attacks exploit buffer overflow vulnerabili- ties in server software. The term buffer overflow is used in General Terms this paper to describe all types of out-of-bound buffer ac- Measurement, Performance, Security, Verification cesses including accessing above the upper limit or below the lower limit of a buffer. Buffer overflow vulnerabilities often permit remote attack- Keywords ers to run arbitrary code on a victim server or to crash Security, buffer overflow, static analysis, evaluation, exploit, server software and perform a denial of service (DoS) attack. test, detection, false alarm, source code They account for roughly 1/3 of all the severe remotely ex- ploitable vulnerabilities listed in the NIST ICAT vulnerabil- ∗ This work was sponsored by the Advanced Research and ity database [22]. The often-suggested approach of patching Development Activity under Air Force Contract F19628-00- software as quickly as possible after buffer overflow vulner- C-0002. Opinions, interpretations, conclusions, and recom- mendations are those of the authors and are not necessarily abilities are announced is clearly not working given the ef- endorsed by the United States Government. fectiveness of recent worms. Figure 1 shows the dates that new remotely exploitable buffer overflow vulnerabilities were announced in three popular Internet server software applica- tions (BIND, WU-FTP, and Sendmail) and the cumulative Permission to make digital or hard copies of all or part of this work for number of these vulnerabilities. For just these three servers, personalCopyrig orht classroom2004 Asso useciati ison granted for Co withoutmputing feeMa providedchinery. thatACM copies ackn areow- there have been from one to six remotely exploitable buffer- notledges made that or distributedthis contribution for profit was or authored commercial or co-authored advantage andby a that contractor copies overflow vulnerabilities announced each year, no reduction bearor affiliate this notice of andthe theU.S. full Government. citation on theAs firstsuch, page. the ToGovernment copy otherwise, retains to a in the rate of new vulnerabilities, and a total of 24 vulnera- republish,nonexclusive, to post royalty-free on servers orright to redistributeto publish or to reproduce lists, requires this prior article, specific or to bilities published since 1996. permissionallow others and/or to do a so, fee. for Government purposes only. A detailed review of approaches that have been devel- SIGSOFT’04/FSE-12,SIGSOFT’04/FSE-12,Oct. Oct. 31–Nov. 31–Nov. 6, 6, 2004, 2004, Newport Newport Beach, Beach, CA, CA, USA. USA. CopyrightCopyright 2004 2004 ACM ACM 1-58113-855-5/04/0010 1-58113-855-5/04/0010...$5.00. ...$5.00. oped to counter buffer overflow exploits is available in [30]. 97 These include static analysis to discover and eliminate buffer Tools Analysis Strategy overflows during software development, dynamic analysis to ARCHER [29] Symbolic, interprocedural, discover buffer overflows during software testing, dynamic flow-sensitive analysis. prevention to detect buffer overflows when they occur af- BOON [27] Symbolic, interprocedural ter software has been deployed, and the use of memory-safe flow-insensitive analysis languages. Static analysis is the only approach that elimi- only strings. nates both buffer overflows and their effects and that can PolySpace Abstract interpretation, be applied to the vast amounts of open-source legacy C C Verifier [1] interprocedural, code in widely-used open-source software. Dynamic test- flow-sensitive. ing is expensive and almost always cannot exercise all code SPLINT [14] Lightweight static analysis, paths. Dynamic prevention approaches such as Stackguard, intraprocedural. CCured, and CRED [9, 11, 24, 23] detect some buffer over- UNO [15] Model checking, interprocedural, flows at run time, only to turn them into DoS attacks be- flow-sensitive. cause a program halts in order to prevent a buffer overflow. Similarly, safe languages such as Java, LISP, and ML check Table 1: Static Analysis tools used in the evaluation buffer accesses at runtime, raising exceptions at any out-of- bounds attempts. Many static analysis tools that detect buffer overflows in source code have been recently developed, but we are lected from open-source server software. A secondary goal of aware of no comprehensive evaluations. Most past evalu- this work was to characterize these in-the-wild buffer over- ations were performed by tool developers, use few exam- flows in terms of type (e.g. stack, heap, static data) and ples, and do not measure both detection and false alarm cause (e.g. improper signed/unsigned conversions, off-by- rates of tools [14, 15, 27, 29]. Although some studies apply one bounds check error, use of unsafe string function). A tools to large amounts of source code and find many buffer final goal was to provide a common collection of realistic overflows [29], the detection rate for in-the-wild exploitable examples that can be used to aid in the development of im- buffer overflows is still not known and the false alarm rate proved static analysis. is difficult to assess. We are aware of only three evaluations of tools that were 2. STATIC ANALYSIS TOOLS not performed by tool developers. A qualitative survey of Table 1 provides a summary of the five static analysis lexical analysis tools that detect use of functions often asso- tools used in this evaluation. Four are open-source tools ciated with buffer overflows is available in [20]. A single tool (ARCHER, BOON, SPLINT, UNO) and one is a commer- for detecting buffer overflows is evaluated in [21], described cial tool (PolySpace C Verifier). All perform in-depth sym- as “a tool created by David Wagner based upon the BANE bolic or abstract analysis of source code and all detect buffer toolkit.” Presumably, this is BOON [27]. While the authors overflows. Simpler lexical analysis tools such as RATS and comment about excessive false positives and false negatives, ITS4 [5, 26] were excluded from this study because they they do not attempt to quantify them. The study described have high false alarm rates and limited scope. in [16] is more objective. It compares Flawfinder, ITS4, ARCHER (ARray CHeckER) is a recently developed static RATS, Splint, and BOON on a testbed of 44 function invo- analysis tool that has found many memory access viola- cations, both safe and unsafe. They carefully count true pos- tions in LINUX kernel and other source code [29]. It uses itives and false positives for examples of “20 vulnerable func- a bottom-up inter-procedural analysis. After parsing the tions chosen from ITS4’s vulnerability database ... Secure source code into abstract syntax trees, an approximate call programming for Linux and UNIX HOWTO, and the whole graph is created to determine an order for examining func- [fvsn]printf family”. These examples contain no complex tions. Starting at the bottom of the call graph, symbolic control structures, instances of inter-procedural scope, or di- triggers are calculated to determine ranges for function pa- rect buffer accesses outside of string functions, and therefore rameters that result in memory access violations. These cannot represent complex buffer access patterns found in In- triggers are used to deduce new triggers for the callers, and ternet servers. However, this study is diagnostic. It exposes so on. Once the top-most caller is reached, if any of its trig- weaknesses in particular implementations (e.g. BOON can- gers are satisfied, a memory violation flag is raised. Error not discriminate between a good and a bad strcpy even in detection is conservative with overflows reported only with its simplest form). High detection/false alarm rates are re- strong evidence, and in some kind of rank order. Archer ported for the three purely lexical tools, Flawfinder, ITS4, employs “several heuristics to minimize the number of false and RATS, and lower detection/false alarm rates for the positives”, which likely hamper its ability to detect some more sophisticated Splint and BOON. They also do not re- classes of overflows accurately. The analysis is further lim- port the conditional probability of no false alarm in a cor- ited because function pointers are not modeled, heuristics rected program given a detection in the vulnerable version.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 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