A Practical Dynamic Buffer Overflow Detector (CRED) Olatunji Ruwase Monica S. Lam Transmeta Corp. Stanford University Network and Distributed Security.

Slides:



Advertisements
Similar presentations
Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
Advertisements

The Interface Definition Language for Fail-Safe C Kohei Suenaga, Yutaka Oiwa, Eijiro Sumii, Akinori Yonezawa University of Tokyko.
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 11 – Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
Buffer Overflow Prevention ”\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e \x89\xe3\x50\x53\x50\x54\x53\xb0\x3b\x50\xcd\x80” Presented to CRAB April.
K. Salah1 Buffer Overflow The crown jewel of attacks.
Foundations of Network and Computer Security J J ohn Black Lecture #30 Nov 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks - F. Qin, C. Wang, Z. Li, H. Kim, Y. Zhou, Y. Wu (UIUC,
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
TaintCheck and LockSet LBA Reading Group Presentation by Shimin Chen.
Securing software by enforcing data-flow integrity Manuel Costa Joint work with: Miguel Castro, Tim Harris Microsoft Research Cambridge University of Cambridge.
Using DISE to Protect Return Addresses from Attack Marc L. Corliss, E Christopher Lewis, Amir Roth University of Pennsylvania.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science PLDI 2006 DieHard: Probabilistic Memory Safety for Unsafe Programming Languages Emery.
Quarantine: A Framework to Mitigate Memory Errors in JNI Applications Du Li , Witawas Srisa-an University of Nebraska-Lincoln.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2012.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 2006 Exterminator: Automatically Correcting Memory Errors Gene Novark, Emery Berger.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2013.
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
2012/02/07 1 John Wilander, Mariam Kamkar Linkopings Universitet Nick Nikiforakis, Yves Younan, Wouter Joosen Katholieke Universiteit Leuven.
Backwards-Compatible Array Bounds Checking for C with Very Low Overhead Dinakar Dhurjati and Vikram Adve ICSE 2006 Itay Polack
A Survey of Dynamic Techniques for Detecting Device Driver Errors Olatunji Ruwase LBA Reading Group 18 th May 2010.
Detection and Prevention of Buffer Overflow Exploit Cai Jun Anti-Virus Section Manager R&D Department Beijing Rising Tech. Corp. LTD.
Presentation of Failure- Oblivious Computing vs. Rx OS Seminar, winter 2005 by Lauge Wullf and Jacob Munk-Stander January 4 th, 2006.
Buffer Overflow Detection Stuart Pickard CSCI 297 June 14, 2005.
Buffer Overflow Maddikayala, jagadish. CSCI 5931 Web Security Prof. T. Andrew Yang Monday Feb. 23.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
Mitigation of Buffer Overflow Attacks
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
Advanced Computer Architecture Lab University of Michigan USENIX Security ’03 Slide 1 High Coverage Detection of Input-Related Security Faults Eric Larson.
Buffer Overflow Attack-proofing by Transforming Code Binary Gopal Gupta Parag Doshi, R. Reghuramalingam The University of Texas at Dallas 11/15/2004.
Overflow Examples 01/13/2012. ACKNOWLEDGEMENTS These slides where compiled from the Malware and Software Vulnerabilities class taught by Dr Cliff Zou.
The Fail-Safe C to Java translator Yuhki Kamijima (Tohoku Univ.)
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
Protecting C Programs from Attacks via Invalid Pointer Dereferences Suan Hsi Yong, Susan Horwitz University of Wisconsin – Madison.
Buffer overflow and stack smashing attacks Principles of application software security.
Sampling Dynamic Dataflow Analyses Joseph L. Greathouse Advanced Computer Architecture Laboratory University of Michigan University of British Columbia.
Dynamic Taint Analysis for Automatic Detection, Analysis, and Signature Generation of Exploits on Commodity Software Paper by: James Newsome and Dawn Song.
A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2013.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
Announcements You will receive your scores back for Assignment 2 this week. You will have an opportunity to correct your code and resubmit it for partial.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
Protecting C and C++ programs from current and future code injection attacks Yves Younan, Wouter Joosen and Frank Piessens DistriNet Department of Computer.
Software Security. Bugs Most software has bugs Some bugs cause security vulnerabilities Incorrect processing of security related data Incorrect processing.
Chapter 10 Buffer Overflow 1. A very common attack mechanism o First used by the Morris Worm in 1988 Still of major concern o Legacy of buggy code in.
Memory Protection through Dynamic Access Control Kun Zhang, Tao Zhang and Santosh Pande College of Computing Georgia Institute of Technology.
Content Coverity Static Analysis Use cases of Coverity Examples
Shellcode COSC 480 Presentation Alison Buben.
Mitigation against Buffer Overflow Attacks
Sabrina Wilkes-Morris CSCE 548 Student Presentation
YAHMD - Yet Another Heap Memory Debugger
Software Security Testing
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2016.
Ik-Soon Kim December 18, 2010 Embedded Software Platform Team
High Coverage Detection of Input-Related Security Faults
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
Format String.
CSC 495/583 Topics of Software Security Format String Bug (2) & Heap
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2011.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2009.
Introduction to Static Analyzer
CNT4704: Analysis of Computer Communication Network Special Topic: Buffer Overflow II: Defense Techniques Cliff Zou Fall 2011.
Presentation transcript:

A Practical Dynamic Buffer Overflow Detector (CRED) Olatunji Ruwase Monica S. Lam Transmeta Corp. Stanford University Network and Distributed Security Symposium. Feb 2004.

Buffer Overruns  50% of the 60 most severe vulnerabilities (posted on CERT/CC)  Over 60 % of CERT/CC advisories in 2003  Slammer, CodeRed, Blaster caused billions of dollars worth of damages  > $800K at Stanford for Blaster alone

Unsafe C Programs  Legacy software cannot be rewritten  Sound static analysis  Finds all errors + many false positives  Unsound static analysis  Finds less false positives, but not all errors  Must still insert dynamic tests, since bounds-checking is undecidable at compile time

Dynamic Overrun Checkers  Cannot catch all buffer overruns  Stackguard  Insert canary word  Can bypass by skipping canary word  Break existing code  Change pointer representation  Inefficient

Dynamic Bounds-Checking  Insert bounds checking automatically  Use static analysis to reduce overhead  Catching all errors  100% coverage  Effective optimization  10% coverage

State-of-the-art Checker  Referent objects [Jones and Kelly] p q derives  Objects and object table (splay tree)  In-bounds address  start, end of object  Given in-bounds pointer p to object o, derived pointer q must also point to o

Implementation  GNU C compiler patch  DLL of bounds checking functions for object table lookups and updates  DLL also includes bounds checking versions of C standard library functions  Instrumentation in GCC front end of non- copy pointer operations, object allocations and de-allocations  Splay tree improves object table lookups

Out-of-bounds Pointers  Ansi C and C++  Common idiom int A[10]; for (p = &A; p < &A + 10; p++) {…}  Can generate, test, but not deref one byte past buffer  Cannot generate, test, or deref any other out-of-bounds addresses

Jones and Kelly’s Solution  Pad all allocated objects by 1 byte  Pointers past one byte are replaced by “-2”  Subsequent non-copy use of “-2” pointer flagged as error

Experiment: 20 programs, 1.2 Mloc Pass KlocFail Kloc ccrypt4.4apache73.6 gzip5.8binutils596.5 monkey2.5bison25.1 polymorph0.4coreutils69.5 tar18.2enscript22.1 WsMp33.4gawk36.4 wu-ftpd18.3gnupg71.2 zlib8.3grep20.8 hypermail27.6 openssh43.4 openssl162.7 pgp4pine3.3 Total

Programs Not Ansi-C Compliant p q p’

Our solution to out-of-bounds (OOB) pointers  Unique OOB object created for every OOB pointer  Referent object and OOB value of pointer stored in OOB object  OOB pointer points to its own OOB object  OOB object table (hashtable)

Our solution to out-of-bound (OOB) pointers p q p’  Use OOB addr for computations and tests, but not dereference  OOB objects deleted as referent objects are deleted (no leaks) OOB object

Out-of-bounds pointers Uninstrumented execution {{ 1: char *p, *q, *r, *s; 2: 3: p = malloc(4); 4:q = p + 1; 5: s = p + 5; 6: r = s – 3; ……………… } p q r s referent object in-bounds padding out-of-bounds Addresses stack p = malloc(4) ; q = p + 1 ; s = p + 5 ; r = s – 3 ;

Instrumentation with Jones and Kelly Checker {{ 1: char *p, *q, *r, *s; 2: 3: p = malloc(4); 4:q = p + 1; 5: s = p + 5; 6: r = s – 3; ……………… } p q r s referent object in-bounds padding out-of-bounds Addresses s = (-2) p = malloc(4) ; q = p + 1 ; s = p + 5 ; r = s – 3 ; stack

Instrumentation with CRED {{ 1: char *p, *q, *r, *s; 2: 3: p = malloc(4); 4:q = p + 1; 5: s = p + 5; 6: r = s – 3; ……………… } p q r s referent object in-bounds padding out-of-bounds Addresses stack p = malloc(4) ; q = p + 1 ; s = p + 5 ; r = s – 3 ; objvalue OOB object

Optimization  Buffer overflow attacks caused by user supplied string data  Restrict bounds checking to only strings  Objects of all types maintained in object table to handle casts  Common downcasts to char pointers when copying data  Experimental results indicate effective protection and improved performance

Results  C Range Error Detector (CRED), built on Jones and Kelly’s implementation  Compatibility  Evaluation of full checking instrumentation  Rigorous evaluation using app test suites  Passed all the 1.2 M loc tests  Overflow bugs found in ssl, coreutils and bison test suites

Protection  Against attacks on  Gawk, gzip, hypermail, monkey, pgp4pine, polymorph, WsMp3  Against Wilander & Kamkar’s 20 tests  ProPolice passed 50%  StackGuard, StackShield, Libsafe and Libverify are worse

Performance

Conclusions  Focus of this work: Compatibility  Simplicity  correctness  thorough compatibility tests (1.2 M loc)  Buffer overruns in C programs can be detected dynamically  Can apply static analysis to reduce overhead

CRED is Open Source  Merged into publicly available GNU C bounds checking patch maintained by Herman ten Brugge  