Rule-based static analysis of network protocol implementations

Today's software systems communicate over the Internet using standard protocols that have been heavily scrutinized, providing some assurance of resistance to malicious attacks and general robustness. However, the software that implements those protocols may still contain mistakes, and an incorrect implementation could lead to vulnerabilities even in the most well-understood protocol. The goal of this work is to close this gap by introducing a new technique for checking that a C implementation of a protocol matches its description in an RFC or similar standards document. We present a static (compile-time) source code analysis tool called Pistachio that checks C code against a rule-based specification of its behavior. Rules describe what should happen during each round of communication, and can be used to enforce constraints on ordering of operations and on data values. Our analysis is not guaranteed sound due to some heuristic approximations it makes, but has a low false negative rate in practice when compared to known bug reports. We have applied Pistachio to implementations of SSH and RCP, and our system was able to find many bugs, including security vulnerabilities, that we confirmed by hand and checked against each project's bug databases.

[1]  Andre Scedrov,et al.  Formal analysis of Kerberos 5 , 2006, Theor. Comput. Sci..

[2]  Gary T. Leavens,et al.  JML: notations and tools supporting detailed design in Java , 2000 .

[3]  Sriram K. Rajamani,et al.  The SLAM project: debugging system software via static analysis , 2002, POPL '02.

[4]  John C. Mitchell,et al.  Multiset rewriting and the complexity of bounded security protocols , 2004, J. Comput. Secur..

[5]  John S. Baras,et al.  Modeling vulnerabilities of ad hoc routing protocols , 2003, SASN '03.

[6]  Andy Chou,et al.  A simple method for extracting models from protocol code , 2001, Proceedings 28th Annual International Symposium on Computer Architecture.

[7]  Gerard J. Holzmann,et al.  The Model Checker SPIN , 1997, IEEE Trans. Software Eng..

[8]  Patrice Godefroid,et al.  Model checking for programming languages using VeriSoft , 1997, POPL '97.

[9]  Sorin Lerner,et al.  ESP: path-sensitive program verification in polynomial time , 2002, PLDI '02.

[10]  Jan Vitek,et al.  Efficient intrusion detection using automaton inlining , 2005, 2005 IEEE Symposium on Security and Privacy (S&P'05).

[11]  Alexander Aiken,et al.  Flow-sensitive type qualifiers , 2002, PLDI '02.

[12]  Peter Oehlert,et al.  Violating Assumptions with Fuzzing , 2005, IEEE Secur. Priv..

[13]  Rajeev Alur,et al.  Verifying Network Protocol Implementations by Symbolic Refinement Checking , 2001, CAV.

[14]  Douglas E. Comer,et al.  Internetworking with TCP/IP, Volume 1: Principles, Protocols, and Architectures, Fourth Edition , 2000 .

[15]  Douglas Comer,et al.  Internetworking with TCP/IP , 1988 .

[16]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[17]  Sorin Lerner Path-Sensitive Program Veri cation in Polynomial Time , 2002 .

[18]  Bruno Blanchet,et al.  An efficient cryptographic protocol verifier based on prolog rules , 2001, Proceedings. 14th IEEE Computer Security Foundations Workshop, 2001..

[19]  Tatu Ylönen,et al.  The Secure Shell (SSH) Connection Protocol , 2006, RFC.

[20]  David A. Wagner,et al.  Finding User/Kernel Pointer Bugs with Type Inference , 2004, USENIX Security Symposium.

[21]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[22]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[23]  Gregorio Díaz,et al.  Automatic verification of the TLS handshake protocol , 2004, SAC '04.

[24]  Jeffrey S. Foster,et al.  Flow-insensitive type qualifiers , 2006, TOPL.

[25]  Catherine A. Meadows,et al.  The NRL Protocol Analyzer: An Overview , 1996, J. Log. Program..

[26]  Wang Yi,et al.  UPPAAL - a Tool Suite for Automatic Verification of Real-Time Systems , 1996, Hybrid Systems.

[27]  Boris Beizer,et al.  Software Testing Techniques , 1983 .

[28]  Andre Scedrov,et al.  Breaking and fixing public-key Kerberos , 2006, Inf. Comput..

[29]  Boris Beizer,et al.  Software testing techniques (2. ed.) , 1990 .

[30]  Keith A. Bartlett,et al.  A note on reliable full-duplex transmission over half-duplex links , 1969, Commun. ACM.

[31]  Dawson R. Engler,et al.  Model Checking Large Network Protocol Implementations , 2004, NSDI.

[32]  Douglas E. Comer,et al.  Internetworking with TCP/IP - Principles, Protocols, and Architectures, Fourth Edition , 1988 .

[33]  D. Engler,et al.  CMC: a pragmatic approach to model checking real code , 2002, OSDI '02.

[34]  Thomas A. Henzinger,et al.  Software Verification with BLAST , 2003, SPIN.

[35]  Lori A. Clarke,et al.  Verification of communication protocols using data flow analysis , 1996, SIGSOFT '96.

[36]  David A. Wagner,et al.  MOPS: an infrastructure for examining security properties of software , 2002, CCS '02.

[37]  Pieter H. Hartel,et al.  Timed model checking of security protocols , 2004, FMSE '04.

[38]  Jon Postel,et al.  Instructions to RFC Authors , 1997, RFC.

[39]  Nick Feamster,et al.  Detecting BGP configuration faults with static analysis , 2005 .

[40]  Dawson R. Engler,et al.  Bugs as deviant behavior: a general approach to inferring errors in systems code , 2001, SOSP.

[41]  Andrew D. Gordon,et al.  Verified Interoperable Implementations of Security Protocols , 2006, CSFW.

[42]  C. Tinelli,et al.  Darwin: A Theorem Prover for the Model Evolution Calculus , 2004 .

[43]  Alex Groce,et al.  Modular verification of software components in C , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[44]  Catherine A. Meadows,et al.  Analysis of the Internet Key Exchange protocol using the NRL Protocol Analyzer , 1999, Proceedings of the 1999 IEEE Symposium on Security and Privacy (Cat. No.99CB36344).

[45]  Iliano Cervesato Typed MSR: Syntax and Examples , 2001, MMM-ACNS.

[46]  Bart Jacobs,et al.  JML (poster session): notations and tools supporting detailed design in Java , 2000, OOPSLA '00.

[47]  Dawson R. Engler,et al.  A framework for model checking network protocols , 2004 .