Bouncer securing software by blocking bad input Miguel Castro Manuel Costa, Lidong Zhou, Lintao Zhang, and Marcus Peinado Microsoft Research.

Slides:



Advertisements
Similar presentations
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Advertisements

The Interface Definition Language for Fail-Safe C Kohei Suenaga, Yutaka Oiwa, Eijiro Sumii, Akinori Yonezawa University of Tokyko.
Overview Motivations Basic static and dynamic optimization methods ADAPT Dynamo.
Dec 5, 2007University of Virginia1 Efficient Dynamic Tainting using Multiple Cores Yan Huang University of Virginia Dec
Abhinn Kothari, 2009CS10172 Parth Jaiswal 2009CS10205 Group: 3 Supervisor : Huzur Saran.
1 S. Tallam, R. Gupta, and X. Zhang PACT 2005 Extended Whole Program Paths Sriraman Tallam Rajiv Gupta Xiangyu Zhang University of Arizona.
Bug Isolation via Remote Program Sampling Ben Liblit, Alex Aiken, Alice X.Zheng, Michael I.Jordan Presented by: Xia Cheng.
RUGRAT: Runtime Test Case Generation using Dynamic Compilers Ben Breech NASA Goddard Space Flight Center Lori Pollock John Cavazos University of Delaware.
Vigilante: End-to-End Containment of Internet Worms Paper by: Manuel Costa, Jon Crowcroft, Miguel Castro, Ant Rowstron, Lidong Zhou, Lintao Zhang, Paul.
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.
ReferencesReferences DiscussionDiscussion Vulnerability Example: SQL injection Auditing Tool for Eclipse LAPSE: a Security Auditing Tool for Eclipse IntroductionIntroductionResultsResults.
LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan.
1 Achieving Trusted Systems by Providing Security and Reliability (Research Project #22) Project Members: Ravishankar K. Iyer, Zbigniew Kalbarczyk, Jun.
Achieving Trusted Systems by Providing Security and Reliability Ravishankar K. Iyer, Zbigniew Kalbarczyk, Jun Xu, Shuo Chen, Nithin Nakka and Karthik Pattabiraman.
Vigilante: End-to-End Containment of Internet Worms Manuel Costa, Jon Crowcroft, Miguel Castro, Antony Rowstron, Lidong Zhou, Lintao Zhang, Paul Barham.
Vigilante: End-to-End Containment of Internet Worms M. Costa et al. (MSR) SOSP 2005 Shimin Chen LBA Reading Group.
1 RAKSHA: A FLEXIBLE ARCHITECTURE FOR SOFTWARE SECURITY Computer Systems Laboratory Stanford University Hari Kannan, Michael Dalton, Christos Kozyrakis.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Buffer Overflow Attacks. Memory plays a key part in many computer system functions. It’s a critical component to many internal operations. From mother.
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
Vulnerability-Specific Execution Filtering (VSEF) for Exploit Prevention on Commodity Software Authors: James Newsome, James Newsome, David Brumley, David.
Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin.
Stamping out worms and other Internet pests Miguel Castro Microsoft Research.
Dr. José M. Reyes Álamo 1.  The 80x86 memory addressing modes provide flexible access to memory, allowing you to easily access ◦ Variables ◦ Arrays ◦
Michael Ernst, page 1 Collaborative Learning for Security and Repair in Application Communities Performers: MIT and Determina Michael Ernst MIT Computer.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Chapter 6 Buffer Overflow. Buffer Overflow occurs when the program overwrites data outside the bounds of allocated memory It was one of the first exploited.
Computer Security and Penetration Testing
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Authors: Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookholt In ACM CCS’05.
Learning, Monitoring, and Repair in Application Communities Martin Rinard Computer Science and Artificial Intelligence Laboratory Massachusetts Institute.
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
Game Scripting by: Nicholas Haines. What is Scripting? Interpreted Language Interpreted Language –As the game runs.
Vigilante: End-to-End Containment of Internet Worms Authors : M. Costa, J. Crowcroft, M. Castro, A. Rowstron, L. Zhou, L. Zhang, and P. Barham In Proceedings.
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Presenter: Jianyong Dai Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookhot.
Christopher Kruegel University of California Engin Kirda Institute Eurecom Clemens Kolbitsch Thorsten Holz Secure Systems Lab Vienna University of Technology.
Stamping out worms and other Internet pests Miguel Castro Microsoft Research.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
1 A Plethora of Paths Eric Larson May 18, 2009 Seattle University.
Highly Scalable Distributed Dataflow Analysis Joseph L. Greathouse Advanced Computer Architecture Laboratory University of Michigan Chelsea LeBlancTodd.
Search Worms, ACM Workshop on Recurring Malcode (WORM) 2006 N Provos, J McClain, K Wang Dhruv Sharma
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
Paradyn Project Paradyn / Dyninst Week Madison, Wisconsin April 12-14, 2010 Binary Concolic Execution for Automatic Exploit Generation Todd Frederick.
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
Using Dynamic Compilers for Software Testing Ben Breech Lori Pollock John Cavazos.
Sampling Dynamic Dataflow Analyses Joseph L. Greathouse Advanced Computer Architecture Laboratory University of Michigan University of British Columbia.
Exploiting Instruction Streams To Prevent Intrusion Milena Milenkovic.
A Binary Agent Technology for COTS Software Integrity Anant Agarwal Richard Schooler InCert Software.
Convicting Exploitable Software Vulnerabilities: An Efficient Input Provenance Based Approach Zhiqiang Lin Xiangyu Zhang, Dongyan Xu Purdue University.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
MIT/Determina Application Communities, page 1 Approved for Public Release, Distribution Unlimited - Case 9649 Collaborative learning for security and repair.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Authors: Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookholt Cyber Defense.
A Framework For Trusted Instruction Execution Via Basic Block Signature Verification Milena Milenković, Aleksandar Milenković, and Emil Jovanov Electrical.
Memory Protection through Dynamic Access Control Kun Zhang, Tao Zhang and Santosh Pande College of Computing Georgia Institute of Technology.
Constraint Framework, page 1 Collaborative learning for security and repair in application communities MIT site visit April 10, 2007 Constraints approach.
Vigilante: End-to-End Containment of Internet Worms Manuel Costa Joint work with: Jon Crowcroft, Miguel Castro, Antony Rowstron, Lidong Zhou, Lintao Zhang,
Vigilante: End-to-End Containment of Internet Worms Manuel Costa, Jon Crowcroft, Miguel Castro, Antony Rowstron, Lidong Zhou, Lintao Zhang and Paul Barham.
Introduction to Compiler Construction
Olatunji Ruwase* Shimin Chen+ Phillip B. Gibbons+ Todd C. Mowry*
Secure Software Development: Theory and Practice
High Coverage Detection of Input-Related Security Faults
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
CSC-682 Advanced Computer Security
CS5123 Software Validation and Quality Assurance
Outline System architecture Current work Experiments Next Steps
Test Cases, Test Suites and Test Case management systems
Sampling Dynamic Dataflow Analyses
Presentation transcript:

Bouncer securing software by blocking bad input Miguel Castro Manuel Costa, Lidong Zhou, Lintao Zhang, and Marcus Peinado Microsoft Research

Software is vulnerable bugs are vulnerabilities attackers can exploit vulnerabilities –to crash programs –to gain control over the execution vulnerabilities are routinely exploited we keep finding new vulnerabilities

How we secure software today static analysis to remove vulnerabilities checks to prevent exploits –type-safe languages –unsafe languages with instrumentation but what do you do when a check fails? –(usually) no code to recover from failure –restarting may be the only option bad because programs are left vulnerable to –loss of data and low-cost denial of service attacks

Blocking bad input Bouncer filters check input when it is received filters block bad input before it is processed –example: drop TCP connection with bad message –input is bad if it can exploit a vulnerability most programs can deal with input errors programs keep working under attack –correctly because filters have no false positives –efficiently because filters have low overhead

Outline architecture symbolic execution symbolic summaries precondition slicing evaluation

program instrumented to detect attacks & log inputs program instrumented to detect attacks & generate trace generate filter conditions for sample generation of alternative exploits combine sample conditions conditionstrace filter new exploit sample exploit Bouncer architecture attacks

Example vulnerable code: char buffer[1024]; char p0 = 'A'; char p1 = 0; if (msg[0] > 0) p0 = msg[0]; if (msg[1] > 0) p1 = msg[1]; if (msg[2] == 0x1) { sprintf(buffer, "\\servers\\%s\\%c", msg+3, p0); StartServer(buffer, p1); } sample exploit:

Symbolic execution analyze trace to compute path conditions –execution with any input that satisfies path conditions follows the path in the trace –inputs that satisfy path conditions are exploits execution follows same path as with sample exploit use path conditions as initial filter –no false positives: only block potential exploits

Computing the path conditions start with symbolic values for input bytes: b 0,… perform symbolic execution along the trace keep symbolic state for memory and registers add conditions on symbolic state for: –branches: ensure same outcome –indirect control transfers: ensure same target –load/store to symbolic address: ensure same target

Example symbolic execution mov eax, msg movsx eax, [eax] cmp eax, 0 jle L movp0, al L: mov eax, msg movsx eax, [eax+1] cmpeax, 0 jleM mov p1, al M: symbolic state *msgb 0,b 1,…eax(movsx b 0 )eflags(cmp (movsx b 0 ) 0)p0b0b0 path conditions (jg (cmp (movsx b 0 ) 0)) [b 0 > 0]

Example symbolic execution mov eax, msg movsx eax, [eax] cmp eax, 0 jle L movp0, al L: mov eax, msg movsx eax, [eax+1] cmpeax, 0 jleM mov p1, al M: symbolic state *msgb 0,b 1,…eflags(cmp (movsx b 0 ) 0)p0b0b0 path conditions (jg (cmp (movsx b 0 ) 0)) [b 0 > 0] eax(movsx b 1 )

Example symbolic execution mov eax, msg movsx eax, [eax] cmp eax, 0 jle L movp0, al L: mov eax, msg movsx eax, [eax+1] cmpeax, 0 jleM mov p1, al M: symbolic state *msgb 0,b 1,…eflags(cmp (movsx b 1 ) 0)p0b0b0 path conditions (jg (cmp (movsx b 0 ) 0)) [b 0 > 0] eax(movsx b 1 ) and (jg (cmp (movsx b 1 ) 0)) [b 1 > 0]

Properties of path conditions path conditions can filter with no false positives b 0 > 0 Λ b 1 > 0 Λ b 2 = 1 Λ b 1503 = 0 Λ b i ≠ 0 for all 2 < i < 1503 they catch many exploit variants [Vigilante] but they usually have false negatives: –fail to block exploits that follow different path –example: they will not block exploits with b 0 ≤ 0 –attacker can craft exploits that are not blocked we generalize filters to block more attacks

Symbolic summaries symbolic execution in library functions –adds many conditions –little information to guide analysis to remove them symbolic summaries –use knowledge of library function semantics –replace conditions added during library calls –are generated automatically from a template template is written once for each function summary is computed by analyzing the trace

Example symbolic summary the vulnerability is in the call –sprintf(buffer, "\\servers\\%s\\%c", msg+3, p0) the symbolic summary is –b i ≠ 0 for all 2 < i < 1016 –it constrains the formatted string to fit in buffer –it is expressed as a condition on the input summary is computed by –using concrete and symbolic argument values –traversing trace backwards to find size of buffer

Pre-condition slicing analyze code and trace to compute a path slice: –slice is a subsequence of trace instructions whose execution is sufficient to exploit the vulnerability generalize filter using the slice –keep conditions added by instructions in slice –discard the other conditions –reduces false negative rate –does not introduce false positives

Computing the slice add instruction with the vulnerability to slice traverse trace backwards track dependencies for instructions in slice add instructions to slice when –branches: path from branch may not visit last slice instruction path to last slice instruction can change dependencies –other instructions: can change dependencies combination of static and dynamic analysis

Example char buffer[1024]; char p0 = 'A'; char p1 = 0; if (msg[0] > 0) p0 = msg[0]; if (msg[1] > 0) p1 = msg[1]; if (msg[2] == 0x1) { sprintf(buffer, "\\servers\\%s\\%c", msg+3, p0); StartServer(buffer, p1); }

Slicing example 1mov eax, msg 2movsx eax, [eax+1] 3cmpeax, 0 4jle6 5mov p1, al 6mov eax, msg 7movsx eax, [eax+2] 8cmp eax, 1 9jne N amovsx eax, p0 bmovecx, msg caddecx, 3 dpusheax # call sprintf epush ecx dependencies msg[3], msg[4], msg[5],…, ecx slice …,e,d,c msg,b,9,eflags,8,eax,7,msg[2],6

Example filter after each phase after symbolic execution b 0 > 0 Λ b 1 > 0 Λ b 2 = 1 Λ b 1503 = 0 Λ b i ≠ 0 for all 2 < i < 1503 after symbolic summary b 0 > 0 Λ b 1 > 0 Λ b 2 = 1 Λ b i ≠ 0 for all 2 < i < 1016 after slicing b 2 = 1 Λ b i ≠ 0 for all 2 < i < 1016 the last filter is optimal

Deployment scenarios distributed scenario –instrument production code to detect exploits –run Bouncer locally on each exploit we detect –deploy improved filter after processing an exploit centralized scenario –software vendor runs cluster to compute filters –vendor receives sample exploits from customers –run Bouncer iterations in parallel in the cluster

Evaluation implemented Bouncer prototype –detected memory corruption attacks with DFI –generated traces with Nirvana –used Phoenix to implement slicing evaluated Bouncer with four real vulnerabilities –SQL server, ghttpd, nullhttpd, and stunnel –started from sample exploit described in literature –ran iterations with search for alternative exploits –single machine; max experiment duration: 24h

Filter accuracy servicefalse positivesfalse negatives SQL serverno ghttpdnoyes nullhttpdnoyes stunnelno bouncer filters have no false positives perfect filters for two vulnerabilities

Conditions after each phase

Filter generation time

Throughput with filters

50 Mbits/sec

Conclusion filters block bad input before it is processed Bouncer filters have –low overhead –no false positives –no false negatives for some vulnerabilities programs keep running under attack a lot left to do