Taint tracking Suman Jana.

Slides:



Advertisements
Similar presentations
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, ThanassisAvgerinos,
Advertisements

ROP is Still Dangerous: Breaking Modern Defenses Nicholas Carlini et. al University of California, Berkeley USENIX Security 2014 Presenter: Yue Li Part.
Compiler Optimized Dynamic Taint Analysis James Kasten Alex Crowell.
1 InfoShield: A Security Architecture for Protecting Information Usage in Memory Georgia Tech Weidong Shi – Georgia Tech Josh Fryman – Intel Corporation.
2014 Network and Distributed System Security Symposium AppSealer: Automatic Generation of Vulnerability-Specific Patches for Preventing Component Hijecking.
Dec 5, 2007University of Virginia1 Efficient Dynamic Tainting using Multiple Cores Yan Huang University of Virginia Dec
Dynamic Taint Analysis for Automatic Detection, Analysis, and Signature Generation of Exploits on Commodity Software Paper by: James Newsome and Dawn Song.
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.
Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Gary Wassermann Zhendong Su.
LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan.
Software and Software Vulnerabilities. Synopsis Array overflows Stack overflows String problems Pointer clobbering. Dynamic memory management Integer.
1 RISE: Randomization Techniques for Software Security Dawn Song CMU Joint work with Monica Chew (UC Berkeley)
1 RAKSHA: A FLEXIBLE ARCHITECTURE FOR SOFTWARE SECURITY Computer Systems Laboratory Stanford University Hari Kannan, Michael Dalton, Christos Kozyrakis.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Dynamic Taint Analysis and Forward Symbolic Execution Ankush Tyagi.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Vulnerability-Specific Execution Filtering (VSEF) for Exploit Prevention on Commodity Software Authors: James Newsome, James Newsome, David Brumley, David.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Analyzing and Detecting Network Security Vulnerability Weekly report 1Fan-Cheng Wu.
Programmer's view on Computer Architecture by Istvan Haller.
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
Effective Real-time Android Application Auditing
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
EECS 583 – Class 21 Research Topic 3: Dynamic Taint Analysis University of Michigan December 5, 2012.
Jose Sanchez 1 o Tielei Wang†, TaoWei†, Zhiqiang Lin‡, Wei Zou†. o Purdue University & Peking University o Proceedings of NDSS'09: Network and Distributed.
Advanced Computer Architecture Lab University of Michigan USENIX Security ’03 Slide 1 High Coverage Detection of Input-Related Security Faults Eric Larson.
Execution of an instruction
Exploitation possibilities of memory related vulnerabilities
Exploit Defenses: ASLR, W X, TaintCheck Brad Karp UCL Computer Science CS GZ03 / th December, 2007.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
Highly Scalable Distributed Dataflow Analysis Joseph L. Greathouse Advanced Computer Architecture Laboratory University of Michigan Chelsea LeBlancTodd.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
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.
Lecture 7 Rootkits Hoglund/Butler (Chapter 5-6). Avoiding detection Two ways rootkits can avoid detection –Modify execution path of operating system to.
Writing an Assembly-language program MIPS assembly language using MARS: MIPS Assembler and Runtime Simulator CS-2710 Dr. Mark L. Hornick 1.
Constraint Framework, page 1 Collaborative learning for security and repair in application communities MIT site visit April 10, 2007 Constraints approach.
Optimistic Hybrid Analysis
Content Coverity Static Analysis Use cases of Coverity Examples
Module: Software Engineering of Web Applications
Introduction to Operating Systems
Control Unit Lecture 6.
Pinpointing Vulnerabilities
CSC 495/583 Topics of Software Security Stack Overflows (2)
Secure Software Development: Theory and Practice
MobiSys 2017 Symbolic Execution of Android Framework with Applications to Vulnerability Discovery and Exploit Generation Qiang Zeng joint work with Lannan.
Web Programming– UFCFB Lecture 17
Authors: James Newsome, Dawn Song
High Coverage Detection of Input-Related Security Faults
Introduction to Operating Systems
Edward J. Schwartz, Thanassis Avgerinos, David Brumley
SUDS: An Infrastructure for Creating Bug Detection Tools
Detecting Targeted Attacks Using Shadow Honeypots
Software Security Lesson Introduction
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
Format String.
CSC 495/583 Topics of Software Security Format String Bug (2) & Heap
Effective and Efficient memory Protection Using Dynamic Tainting
Morgan Kaufmann Publishers Memory Hierarchy: Cache Basics
Introduction to Static Analyzer
IntScope: Automatically Detecting Integer overflow vulnerability in X86 Binary Using Symbolic Execution Tielei Wang, TaoWei, ZhingiangLin, weiZou Purdue.
Understanding and Preventing Buffer Overflow Attacks in Unix
Exploitation Part 1.
Dynamic Binary Translators and Instrumenters
Lecture 20: Representing Data Elements
Computer Architecture and System Programming Laboratory
Return-to-libc Attacks
Sampling Dynamic Dataflow Analyses
Presentation transcript:

Taint tracking Suman Jana

Dynamic Taint Analysis Track information flow through a program at runtime Identify sources of taint – “TaintSeed” What are you tracking? Untrusted input Sensitive data Taint Policy – “TaintTracker” Propagation of taint Identify taint sinks – “TaintAssert” Taint checking Special calls: Jump statements, Format strings, etc. Outside network

TaintCheck (Newsome et al.) Performed on x86 binary No need for source Implemented using Valgrind skin X86 -> Valgrind’s Ucode Taint instrumentation added Ucode -> x86 Sources -> TaintSeed Taint Policy -> TaintTracker Sinks -> TaintAssert Add on “Exploit Analyzer”

TaintCheck (Newsome et al.) TaintSeed: Mark untrusted data as tainted TaintTracker: Track each instruction, propagate taint TaintAssert: Check is tainted data is used dangerously

TaintSeed Marks any data from untrusted sources as “tainted” Each byte of memory has a four-byte shadow memory that stores a pointer to a Taint data structure if that location is tainted Else store a NULL pointer

TaintTracker Tracks each instruction that manipulates data in order to determine whether the result is tainted. When the result of an instruction is tainted by one of the operands, TaintTracker sets the shadow memory of the result to point to the same Taint data structure as the tainted operand.

TaintAssert & Exploit Analyzer Checks whether tainted data is used in ways that its policy defines as illegitimate Exploit Analyzer Backtrace chain of taint structures: provides useful information about how the exploit happened, and what the exploit attempts to do Useful to generate exploit fingerprints Transfer control to sandbox for analysis

Automatic Signature Generation Find value used to override return address – typically fixed value in the exploit code

Taint Analysis in Action

Δ τ t = IsUntrusted(src) Input get_input(src)↓ t Var Val tainted untainted Δ Var Val x = get_input( ) y = x + 42 … goto y x 7 Input is tainted Tainted Var τ TaintSeed Input t = IsUntrusted(src) get_input(src)↓ t x T

Data derived from user input is tainted Δ Var Val x 7 tainted untainted x = get_input( ) y = x + 42 … goto y y 49 Data derived from user input is tainted Tainted T Var x τ TaintTracker BinOp t1 = τ[x1] , t2 = τ[x2] x1 + x2 ↓ t1 v t2 y T

Pgoto(ta) = ¬ ta (Must be true to execute) Δ Var Val x 7 y 49 tainted untainted x = get_input( ) y = x + 42 … goto y Policy Violation Detected Tainted T Var x y τ TaintAssert Pgoto(ta) = ¬ ta (Must be true to execute)

Jumping to overwritten return address x = get_input( ) y = … … goto y Jumping to overwritten return address … strcpy(buffer,argv[1]) ; return ;

Policy Considerations?

Δ μ τ τμ Memory Load Variables Memory Var Val x 7 Addr Val 7 42 Tainted T Var x τ Tainted F/T? Addr 7 τμ

Problem: Memory Addresses Δ Var Val x = get_input( ) y = load( x ) … goto y x 7 μ Addr Val 7 42 All values derived from user input are tainted?? Tainted? F Addr 7 τμ

Jump target could be any untainted memory cell value Policy 1: Taint depends only on the memory cell Δ Var Val x = get_input( ) y = load( x ) … goto y Undertainting Failing to identify tainted values - e.g., missing exploits x 7 Jump target could be any untainted memory cell value μ Addr Val 7 42 Taint Propagation Tainted F Addr 7 τμ Load v = Δ[x] , t = τμ[v] load(x) ↓ t

Address expression is tainted Policy 2: If either the address or the memory cell is tainted, then the value is tainted Memory printa printb x = get_input( ) y = load(jmp_table + x % 2 ) … goto y Overtainting Unaffected values are tainted - e.g., exploits on safe inputs Address expression is tainted jmp_table Policy Violation? Taint Propagation Load v = Δ[x] , t = τμ[v], ta = τ[x] load(x) ↓ t v ta

General Challenge: State-of-the-Art is not perfect for all programs Undertainting: Policy may miss taint Overtainting: Policy may wrongly detect taint

TaintCheck Evaluation

Effectiveness of TaintCheck False Negatives Use control flow to change value without gathering taint Example: if (x == 0) y=0; else if (x == 1) y=1; Equivalent to x=y; Tainted index into a hardcoded table Policy – value translation is not tainted Enumerating all sources of taint False Positives Vulnerable code? Sanity Checks not removing taint Requires fine-tuning Taint sanitization problem Want your data to be cleaned before it hits the sink

Effectiveness of TaintCheck Does TaintCheck raise false alerts for existing code? network programs: apache, ATPhttpd, bftpd, cfingerd, and named client programs: ssh and firebird non-network programs: gcc, ls, bzip2, make, latex, vim, emacs, and bash Networked programs: 158K+ DNS queries No false +ves All client and non-network programs (tainted data is stdin): Only vim and firebird caused false +ves (data from config files used as offset to jump address)

TaintCheck - Attack Detection Synthetic Exploits Buffer overflow -> function pointer Buffer overflow -> format string Format string -> info leak Actual Exploits 3 real world examples

TaintCheck Performance Performance overhead for Apache