SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
Self-defending software:
                 g
    Automatically patching
  errors in deployed software
               Michael Ernst
            University of Washington
              Joint work with:
 Saman Amarasinghe, Jonathan Bachrach,
Michael C bi Sung Ki S
Mi h l Carbin, S      Kim, Samuel Ll Larsen,
Carlos Pacheco, Jeff Perkins, Martin Rinard,
 Frank Sh
 F k Sherwood, St li Sidi l
                d Stelios Sidiroglou, G
                                      Greg
   Sullivan, Weng-Fai Wong, Yoav Zibin
Problem: Your code has bugs
      and vulnerabilities
        d   l    bili i
• Attack detectors exist
  – Code injection, memory errors (buffer overrun)
• Reaction:
  – Crash the application
     •   Loss of data
     •   Overhead of restart
     •   Attack recurs
     •   Denial of service
  – Automatically patch the application
ClearView:
    Security for legacy software
    S    it f l           ft
Requirements:
1. Protect against unknown vulnerabilities
2. Preserve f
2 P          functionality
                 ti   lit
3. Commercial & legacy software
1. Unknown vulnerabilities
• Proactively prevent attacks via unknown
  vulnerabilities
  – “Zero day exploits”
     Zero-day exploits
  – No pre-generated signatures
  – No hard-coded fixes
       hard coded
  – No time for human reaction
  – W k for bugs as well as attacks
    Works f b           ll     tt k
2. Preserve functionality
• Maintain continuity: application
  continues to operate despite attacks
• For applications that require high availability
  – Important for mission-critical applications
  – Web servers, air traffic control, communications
• Technique: create a patch
  ( p
  (repair the application)
               pp        )
  – Patching is a valuable option for your toolbox
3. Commercial/legacy software
• No modification to source or executables
• No cooperation required from developers
  –CCannot assume b ilt i survivability f t
          t         built-in   i bilit features
  – No source information (no debug symbols)
• x86 Windows binaries
Learn from success and failure
• Normal executions show what the application
  is supposed to do

• Each attack (or failure) provides information
  about the underlying vulnerability
• R
  Repairs i
       i improve over ti time
  – Eventually, the attack is rendered harmless
  – Similar to an immune system
• Detect all attacks (of given types)
  – Prevent negative consequences
  – First few attacks may crash the application
all executions   Detect, learn, repair
                                                      [Lin Ernst
                                                      [Li & E t 2003]
                                           Pluggable detector,
              Attack                       does not depend on learning
             detector
   normal                attacks
executions               (or bugs)

                                     • Learn normal behavior (constraints)
             Learning                  from successful runs
                                     • Check constraints during attacks

                 predictive                • True on every good run
                 constraints               • False during every attack

             Repair                     • Patch to re-establish constraints
                                        • Evaluate and distribute patches

                 patch                     Restores normal behavior
A deployment of ClearView
                                                   Community machines



         Server

   (Server may be
      replicated,
   distributed, etc.)




Threat model does not (yet!)
include malicious nodes

                        Encrypted, authenticated
                        communication
Learning normal behavior
                                                Community machines
  Observe normal behavior
  Generalize observed behavior
        Server

 …
 copy_len ≤ buff_size
 …




Server generalizes      Clients send
(merges results)        inference results   Clients do local inference
Attack detection & suppression
                                              Community machines



     Server




Detectors used in our research:
   – Code injection (Memory Firewall)
   – Memory corruption (Heap Guard)
Many other possibilities exist
                                        Detector collects information
                                        and terminates application
Learning attack behavior
                                                           Community machines
    What was the effect of the attack?


           Server




                        Clients send difference in
Server correlates       behavior: violated constraints Instrumentation continuously
constraints to attack                                  evaluates learned behavior
Repair
                                     Community machines
 Propose a set of patches for each
 behavior that predicts the attack
               p
       Server

  Predictive: copy len ≤ buff_size
                py_
 Candidate patches:
 1. Set copy_len = buff_size
 2. Set copy len = 0
          py_
 3. Set buff_size = copy_len
 4. Return from procedure




Server generates
a set of patches
Repair
                                      Community machines
Distribute patches to the community


     Server
Ranking:
Patch 1:
P t h1 0
Patch 2: 0
Patch 3: 0
…
Repair
                                                    Community machines
  Evaluate patches
  Success = no detector is triggered
                              gg
         Server
   Ranking:
   Patch 3: 5
   P t h 3 +5
   Patch 2: 0
   Patch 1: -5
   …




                       When attacked, clients
                       send outcome to server   Detector is still
Server ranks patches
                                                running on clients
Repair
                                           Community machines
Redistribute the best patches


     Server
Ranking:
Patch 3: 5
P t h 3 +5
Patch 2: 0                 Patch 3
Patch 1: -5
…




                Server redistributes the
                most effective patches
Outline
•   Overview
•   Learning normal behavior
•   Learning attack b h i
    L    i    tt k behavior
•   Repair: propose and evaluate patches
•   Evaluation: adversarial Red Team exercise
•   Conclusion
Learning normal behavior
                                                Community machines
  Generalize observed behavior


        Server

 …
 copy_len ≤ buff_size
 …




                        Clients send
Server generalizes
                        inference results
(merges results)                            Clients do local inference
Dynamic invariant detection
• Daikon generalizes observed program executions
   Candidate constraints:                   Remaining candidates:
    copy_len < buff_size    Observation:     copy_len < buff_size
    copy_len ≤ buff_size    copy_len: 22     copy_len ≤ buff_size
    copy_len = b ff i
         l     buff_size    buff_size: 42
                              ff             copy_len = b ff i
                                                  l     buff_size
    copy_len ≥ buff_size                     copy_len ≥ buff_size
    copy_len > buff_size                     copy_len > buff_size
    copy len ≠ buff_size
      py_                                    copy len ≠ buff_size
                                               py_



• Many optimizations for accuracy and speed
  – Data structures, code analysis, statistical tests, …
• We further enhanced the technique
                                q
Quality of inference results
• Not sound
  – Overfitting if observed executions are not representative
• Not complete
  – Templates are not exhaustive
• Useful!
• Unsoundness is not a hindrance
  – Does not affect attack detection
  – For repair, mitigated by the correlation step
  – Continued learning improves results
Outline
•   Overview
•   Learning normal behavior
•   Learning attack b h i
    L    i    tt k behavior
•   Repair: propose and evaluate patches
•   Evaluation: adversarial Red Team exercise
•   Conclusion
Detecting attacks (or bugs)
Goal: detect problems close to their source
Code injection (Determina Memory Firewall)
  –T i
   Triggers if control j
                   t l jumps t code th t was not
                             to d that         t
   in the original executable
Memory corruption (H
M            ti (Heap G d)
                      Guard)
  – Triggers if sentinel values are overwritten
These have low overhead and no false
 positives
Other detectors are possible
Learning from failures
Each attack provides information about the
 underlying vulnerability
  – That it exists
  – Where it can be exploited
  – How the exploit operates
  – What repairs are successful
Attack detection & suppression
                       Community machines



  Server




                   Detector collects information
                   and terminates application
Learning attack behavior
                                                Community machines
  Where did the attack happen?

                          scanf
        Server
                          read_input
                          p
                          process_record
                                 _
                          main




Detector maintains
a shadow call stack



                      Client sends attack
                      info to server        Detector collects information
                                            and terminates application
Learning attack behavior
                                                         Community machines
   Extra checking in attacked code
   Check the learned constraints
          Server

     scanf
     read_input
     process_record
     main




Server generates          Server sends instru-
instrumentation for       mentation to all clients
targeted code locations                              Clients install instrumentation
Learning attack behavior
                                                            Community machines
    What was the effect of the attack?


           Server

  Predictive:
  copy_len ≤ buff_size




                         Clients send difference in
Server correlates        behavior: violated constraints Instrumentation continuously
constraints to attack                                   evaluates inferred behavior
Correlating attacks & constraints
Check constraints only at attack sites
  – Low overhead
A constraint is predictive of an attack if:
  – The constraint is violated iff the attack occurs
Create repairs for each predictive constraint
  – Re-establish normal behavior
Outline
•   Overview
•   Learning normal behavior
•   Learning attack b h i
    L    i    tt k behavior
•   Repair: propose and evaluate patches
•   Evaluation: adversarial Red Team exercise
•   Conclusion
Repair
                                        Community machines
  Distribute patches to the community
  Success = no detector is triggered
                              gg
         Server
   Ranking:
   Patch 1:
   P t h1 0
   Patch 2: 0
   Patch 3: 0
   …




Patch evaluation uses
additional detectors
(e.g., crash, difference in attack)
Attack example
• Target: JavaScript system routine (written in C++)
  – C t it argument to a C++ object, calls a virtual method
    Casts its        tt    C     bj t   ll    it l     th d
  – Does not check type of the argument
• Attack supplies an “object” whose virtual table
                      object
  points to attacker-supplied code
• Predictive constraint at the method call:
  – JSRI address target is one of a known set
• Possible repairs:
  – Call one of the known valid methods
  – Skip over the call
       p
  – Return early
Repair example
if (! ( py_len ≤ buff_size))
   ( (copy                ))
   copy_len = buff_size;

• The repair checks the predictive constraint
  – If constraint is not violated, no need to repair
  – If constraint i violated, an attack is (probably) underway
           t i t is i l t d         tt k i ( b bl ) d
• The patch does not depend on the detector
  – Should fix the problem before the detector is triggered


• Repair is not identical to what a human would write
  – Unacceptable to wait for human response
Example constraints & repairs
v1 ≤ v2
   if (!(v1≤v2)) v1 = v2;
v≥c
   if (!(v≥c)) v = c;
v ∈ { c1, c2, c3 }
   if (!(v==c1 || v==c2 || v==c3)) v = ci;
Return from enclosing procedure
   if (!(…)) return;
Modify a use: convert “call *v” to
   if (…) call *v;
                     Constraint on v (not negated)
Evaluating a patch
• In-field evaluation
   – No attack detector is triggered
   – No other behavior deviations
      • E g crash application invariants
        E.g., crash,
• Pre-validation, before distributing the patch:
   • Replay the attack
      +   No
          N need t wait f a second attack
                 d to    it for       d tt k
      +   Exactly reproduce the problem
      –   Expensive to record log; log terminates abruptly
      –   Need to prevent irrevocable effects
      –   Delays distribution of good patches
   • Run the program’s test suite
      – May be too sensitive
      – Not available for commercial software
Outline
•   Overview
•   Learning normal behavior
•   Learning attack b h i
    L    i    tt k behavior
•   Repair: propose and evaluate patches
•   Evaluation: adversarial Red Team exercise
•   Conclusion
Red Team
• Red Team attempts to break our system
  – Hired by DARPA; 10 engineers
• Red Team created 10 Firefox exploits
  – Each exploit is a webpage
  – Firefox executes arbitrary code
  – Malicious JavaScript, GC errors, stack
    smashing, heap buffer overflow, uninitialized
    memory
Rules of engagement
• Firefox 1.0
  – ClearView may not be tuned to known
    vulnerabilities
  –FFocus on most security-critical components
                    t  it    iti l          t
     • No access to a community for learning
• Red Team has access to all ClearView
  materials
  – Source code, documents, learned invariants, …
ClearView was successful
• Detected all attacks prevented all exploits
               attacks,
• For 7/10 vulnerabilities, generated a patch
  that maintained functionality
    – No observable deviation from desired behavior
    – Aft an average of 4.9 minutes and 5.4 attacks
      After            f49 i t          d 5 4 tt k
•   Handled polymorphic attack variants
•   Handled simultaneous & intermixed attacks
•   No false positives
•   Low overhead for detection & repair
3 un repaired vulnerabilities
    un-repaired
Consequence: Application crashes when
  attacked. No exploit occurs.

1. ClearView was mis-configured: didn’t try
   repairs in all procedures on the stack
2. Learning suite was too small: a needed
   constraint was not statistically significant
3. A needed constraint was not built into
   Daikon
Outline
•   Overview
•   Learning normal behavior
•   Learning attack b h i
    L    i    tt k behavior
•   Repair: propose and evaluate patches
•   Evaluation: adversarial Red Team exercise
•   Conclusion
Limitations
ClearView might fail to repair an error:
  – Only fixes errors for which a detector exists
  – Daikon might not learn a needed constraint
  – Predictive constraint may be too far from error
  – Built-in repairs may not be sufficient
               p       y
ClearView might degrade the application:
  – Patch may impair functionality
             y p                 y
  – Attacker may subvert patch
  – Malicious nodes may induce bad p
                       y           patches
Bottom line: Red Team tried unsuccessfully
Related work
• Attack detection: ours are mostly standard
  – Distributed: Vigilante [Costa], live monitoring
    [Kıcıman], statistical bug isolation [Liblit]
• L
  Learning
       i
  – FSMs of system calls for anomaly detection
  – Invariants: [Lin], [Demsky], Gibraltar [Baliga]
                [Lin] [Demsky]
  – System configuration: FFTV [Lorenzoli],
    Dimmunix [Jula]
               [     ]
• Repair & failure tolerance
  – Checkpoint and replay: Rx [Qin], microreboot
    [Candea]
    [C d ]
  – Failure-oblivious [Rinard], ASSURE [Sidiroglou]
Credits
•   Saman Amarasinghe      •   Jeff Perkins
•   Jonathan Bachrach      •   Martin Rinard
•   Michael Carbin         •   Frank Sherwood
•   Michael Ernst          •   Stelios Sidiroglou
•   Sung Kim               •   Greg Sullivan
•   Samuel Larsen          •   Weng-Fai Wong
•   Carlos Pacheco         •   Yoav Zibin
Subcontractor: Determina, Inc.
Funding: DARPA (PM: Lee Badger)
Red Team: SPARTA, Inc.
Contributions
ClearView: framework for patch generation
  – Pluggable detection, learning, repair
1.
1 Protects against unknown vulnerabilities
  – Learns from success
  – Learns from failure: what, where, how
  – Learning focuses effort where it is needed
2.
2 Preserves functionality: repairs the
   vulnerability
3.
3 Commercial software: Windows binaries
Evaluation via a Red Team exercise

Más contenido relacionado

Similar a Self-defending software: Automatically patching errors in deployed software (SOSP 2009)

NextGen Endpoint Security for Dummies
NextGen Endpoint Security for DummiesNextGen Endpoint Security for Dummies
NextGen Endpoint Security for DummiesAtif Ghauri
 
Reducing Application Risk: minimizing your web application's attack surface
Reducing Application Risk: minimizing your web application's attack surfaceReducing Application Risk: minimizing your web application's attack surface
Reducing Application Risk: minimizing your web application's attack surfaceSecurity Innovation
 
Vulnerability Management: What You Need to Know to Prioritize Risk
Vulnerability Management: What You Need to Know to Prioritize RiskVulnerability Management: What You Need to Know to Prioritize Risk
Vulnerability Management: What You Need to Know to Prioritize RiskAlienVault
 
Pinpointing Vulnerabilities (Ravel)
Pinpointing Vulnerabilities (Ravel)Pinpointing Vulnerabilities (Ravel)
Pinpointing Vulnerabilities (Ravel)Yue Chen
 
Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...
Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...
Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...Zhen Huang
 
Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...Phil Agcaoili
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an..."Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...SegInfo
 
Embeddable Antivirus engine with high granularity
Embeddable Antivirus engine with high granularityEmbeddable Antivirus engine with high granularity
Embeddable Antivirus engine with high granularityAntiy Labs
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPLnitinscribd
 
FUEL_USERS_GROUP
FUEL_USERS_GROUPFUEL_USERS_GROUP
FUEL_USERS_GROUPWill Pearce
 
2020 11-15 marcin ludwiszewski - purple, red, blue and others - rainbow team...
2020 11-15 marcin ludwiszewski - purple, red, blue  and others - rainbow team...2020 11-15 marcin ludwiszewski - purple, red, blue  and others - rainbow team...
2020 11-15 marcin ludwiszewski - purple, red, blue and others - rainbow team...Marcin Ludwiszewski
 
USPS CISO Academy - Vulnerability Management
USPS CISO Academy - Vulnerability ManagementUSPS CISO Academy - Vulnerability Management
USPS CISO Academy - Vulnerability ManagementJim Piechocki
 
Application Assessment Techniques
Application Assessment TechniquesApplication Assessment Techniques
Application Assessment TechniquesDenim Group
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101dc612
 
Detecting Evasive Malware in Sandbox
Detecting Evasive Malware in SandboxDetecting Evasive Malware in Sandbox
Detecting Evasive Malware in SandboxRahul Mohandas
 

Similar a Self-defending software: Automatically patching errors in deployed software (SOSP 2009) (20)

NextGen Endpoint Security for Dummies
NextGen Endpoint Security for DummiesNextGen Endpoint Security for Dummies
NextGen Endpoint Security for Dummies
 
Reducing Application Risk: minimizing your web application's attack surface
Reducing Application Risk: minimizing your web application's attack surfaceReducing Application Risk: minimizing your web application's attack surface
Reducing Application Risk: minimizing your web application's attack surface
 
Vulnerability Management: What You Need to Know to Prioritize Risk
Vulnerability Management: What You Need to Know to Prioritize RiskVulnerability Management: What You Need to Know to Prioritize Risk
Vulnerability Management: What You Need to Know to Prioritize Risk
 
Pinpointing Vulnerabilities (Ravel)
Pinpointing Vulnerabilities (Ravel)Pinpointing Vulnerabilities (Ravel)
Pinpointing Vulnerabilities (Ravel)
 
Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...
Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...
Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Respo...
 
Sa03 tactics
Sa03 tacticsSa03 tactics
Sa03 tactics
 
Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an..."Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
 
Embeddable Antivirus engine with high granularity
Embeddable Antivirus engine with high granularityEmbeddable Antivirus engine with high granularity
Embeddable Antivirus engine with high granularity
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
 
FALCON.pptx
FALCON.pptxFALCON.pptx
FALCON.pptx
 
FUEL_USERS_GROUP
FUEL_USERS_GROUPFUEL_USERS_GROUP
FUEL_USERS_GROUP
 
2020 11-15 marcin ludwiszewski - purple, red, blue and others - rainbow team...
2020 11-15 marcin ludwiszewski - purple, red, blue  and others - rainbow team...2020 11-15 marcin ludwiszewski - purple, red, blue  and others - rainbow team...
2020 11-15 marcin ludwiszewski - purple, red, blue and others - rainbow team...
 
USPS CISO Academy - Vulnerability Management
USPS CISO Academy - Vulnerability ManagementUSPS CISO Academy - Vulnerability Management
USPS CISO Academy - Vulnerability Management
 
Application Assessment Techniques
Application Assessment TechniquesApplication Assessment Techniques
Application Assessment Techniques
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
 
Computer Engineer Master Project
Computer Engineer Master ProjectComputer Engineer Master Project
Computer Engineer Master Project
 
Detecting Evasive Malware in Sandbox
Detecting Evasive Malware in SandboxDetecting Evasive Malware in Sandbox
Detecting Evasive Malware in Sandbox
 
Continuous Integration & the Release Maturity Model
Continuous Integration & the Release Maturity Model Continuous Integration & the Release Maturity Model
Continuous Integration & the Release Maturity Model
 

Más de Sung Kim

DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningSung Kim
 
Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)Sung Kim
 
Time series classification
Time series classificationTime series classification
Time series classificationSung Kim
 
Tensor board
Tensor boardTensor board
Tensor boardSung Kim
 
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...Sung Kim
 
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Sung Kim
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesSung Kim
 
Crowd debugging (FSE 2015)
Crowd debugging (FSE 2015)Crowd debugging (FSE 2015)
Crowd debugging (FSE 2015)Sung Kim
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSung Kim
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Sung Kim
 
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)Sung Kim
 
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...Sung Kim
 
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)Sung Kim
 
Source code comprehension on evolving software
Source code comprehension on evolving softwareSource code comprehension on evolving software
Source code comprehension on evolving softwareSung Kim
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test GenerationSung Kim
 
Survey on Software Defect Prediction
Survey on Software Defect PredictionSurvey on Software Defect Prediction
Survey on Software Defect PredictionSung Kim
 
MSR2014 opening
MSR2014 openingMSR2014 opening
MSR2014 openingSung Kim
 
Personalized Defect Prediction
Personalized Defect PredictionPersonalized Defect Prediction
Personalized Defect PredictionSung Kim
 
STAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSung Kim
 
Transfer defect learning
Transfer defect learningTransfer defect learning
Transfer defect learningSung Kim
 

Más de Sung Kim (20)

DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
 
Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)
 
Time series classification
Time series classificationTime series classification
Time series classification
 
Tensor board
Tensor boardTensor board
Tensor board
 
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
 
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
 
Crowd debugging (FSE 2015)
Crowd debugging (FSE 2015)Crowd debugging (FSE 2015)
Crowd debugging (FSE 2015)
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
 
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
 
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
 
Source code comprehension on evolving software
Source code comprehension on evolving softwareSource code comprehension on evolving software
Source code comprehension on evolving software
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
 
Survey on Software Defect Prediction
Survey on Software Defect PredictionSurvey on Software Defect Prediction
Survey on Software Defect Prediction
 
MSR2014 opening
MSR2014 openingMSR2014 opening
MSR2014 opening
 
Personalized Defect Prediction
Personalized Defect PredictionPersonalized Defect Prediction
Personalized Defect Prediction
 
STAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash Reproduction
 
Transfer defect learning
Transfer defect learningTransfer defect learning
Transfer defect learning
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Self-defending software: Automatically patching errors in deployed software (SOSP 2009)

  • 1. Self-defending software: g Automatically patching errors in deployed software Michael Ernst University of Washington Joint work with: Saman Amarasinghe, Jonathan Bachrach, Michael C bi Sung Ki S Mi h l Carbin, S Kim, Samuel Ll Larsen, Carlos Pacheco, Jeff Perkins, Martin Rinard, Frank Sh F k Sherwood, St li Sidi l d Stelios Sidiroglou, G Greg Sullivan, Weng-Fai Wong, Yoav Zibin
  • 2. Problem: Your code has bugs and vulnerabilities d l bili i • Attack detectors exist – Code injection, memory errors (buffer overrun) • Reaction: – Crash the application • Loss of data • Overhead of restart • Attack recurs • Denial of service – Automatically patch the application
  • 3. ClearView: Security for legacy software S it f l ft Requirements: 1. Protect against unknown vulnerabilities 2. Preserve f 2 P functionality ti lit 3. Commercial & legacy software
  • 4. 1. Unknown vulnerabilities • Proactively prevent attacks via unknown vulnerabilities – “Zero day exploits” Zero-day exploits – No pre-generated signatures – No hard-coded fixes hard coded – No time for human reaction – W k for bugs as well as attacks Works f b ll tt k
  • 5. 2. Preserve functionality • Maintain continuity: application continues to operate despite attacks • For applications that require high availability – Important for mission-critical applications – Web servers, air traffic control, communications • Technique: create a patch ( p (repair the application) pp ) – Patching is a valuable option for your toolbox
  • 6. 3. Commercial/legacy software • No modification to source or executables • No cooperation required from developers –CCannot assume b ilt i survivability f t t built-in i bilit features – No source information (no debug symbols) • x86 Windows binaries
  • 7. Learn from success and failure • Normal executions show what the application is supposed to do • Each attack (or failure) provides information about the underlying vulnerability • R Repairs i i improve over ti time – Eventually, the attack is rendered harmless – Similar to an immune system • Detect all attacks (of given types) – Prevent negative consequences – First few attacks may crash the application
  • 8. all executions Detect, learn, repair [Lin Ernst [Li & E t 2003] Pluggable detector, Attack does not depend on learning detector normal attacks executions (or bugs) • Learn normal behavior (constraints) Learning from successful runs • Check constraints during attacks predictive • True on every good run constraints • False during every attack Repair • Patch to re-establish constraints • Evaluate and distribute patches patch Restores normal behavior
  • 9. A deployment of ClearView Community machines Server (Server may be replicated, distributed, etc.) Threat model does not (yet!) include malicious nodes Encrypted, authenticated communication
  • 10. Learning normal behavior Community machines Observe normal behavior Generalize observed behavior Server … copy_len ≤ buff_size … Server generalizes Clients send (merges results) inference results Clients do local inference
  • 11. Attack detection & suppression Community machines Server Detectors used in our research: – Code injection (Memory Firewall) – Memory corruption (Heap Guard) Many other possibilities exist Detector collects information and terminates application
  • 12. Learning attack behavior Community machines What was the effect of the attack? Server Clients send difference in Server correlates behavior: violated constraints Instrumentation continuously constraints to attack evaluates learned behavior
  • 13. Repair Community machines Propose a set of patches for each behavior that predicts the attack p Server Predictive: copy len ≤ buff_size py_ Candidate patches: 1. Set copy_len = buff_size 2. Set copy len = 0 py_ 3. Set buff_size = copy_len 4. Return from procedure Server generates a set of patches
  • 14. Repair Community machines Distribute patches to the community Server Ranking: Patch 1: P t h1 0 Patch 2: 0 Patch 3: 0 …
  • 15. Repair Community machines Evaluate patches Success = no detector is triggered gg Server Ranking: Patch 3: 5 P t h 3 +5 Patch 2: 0 Patch 1: -5 … When attacked, clients send outcome to server Detector is still Server ranks patches running on clients
  • 16. Repair Community machines Redistribute the best patches Server Ranking: Patch 3: 5 P t h 3 +5 Patch 2: 0 Patch 3 Patch 1: -5 … Server redistributes the most effective patches
  • 17. Outline • Overview • Learning normal behavior • Learning attack b h i L i tt k behavior • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion
  • 18. Learning normal behavior Community machines Generalize observed behavior Server … copy_len ≤ buff_size … Clients send Server generalizes inference results (merges results) Clients do local inference
  • 19. Dynamic invariant detection • Daikon generalizes observed program executions Candidate constraints: Remaining candidates: copy_len < buff_size Observation: copy_len < buff_size copy_len ≤ buff_size copy_len: 22 copy_len ≤ buff_size copy_len = b ff i l buff_size buff_size: 42 ff copy_len = b ff i l buff_size copy_len ≥ buff_size copy_len ≥ buff_size copy_len > buff_size copy_len > buff_size copy len ≠ buff_size py_ copy len ≠ buff_size py_ • Many optimizations for accuracy and speed – Data structures, code analysis, statistical tests, … • We further enhanced the technique q
  • 20. Quality of inference results • Not sound – Overfitting if observed executions are not representative • Not complete – Templates are not exhaustive • Useful! • Unsoundness is not a hindrance – Does not affect attack detection – For repair, mitigated by the correlation step – Continued learning improves results
  • 21. Outline • Overview • Learning normal behavior • Learning attack b h i L i tt k behavior • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion
  • 22. Detecting attacks (or bugs) Goal: detect problems close to their source Code injection (Determina Memory Firewall) –T i Triggers if control j t l jumps t code th t was not to d that t in the original executable Memory corruption (H M ti (Heap G d) Guard) – Triggers if sentinel values are overwritten These have low overhead and no false positives Other detectors are possible
  • 23. Learning from failures Each attack provides information about the underlying vulnerability – That it exists – Where it can be exploited – How the exploit operates – What repairs are successful
  • 24. Attack detection & suppression Community machines Server Detector collects information and terminates application
  • 25. Learning attack behavior Community machines Where did the attack happen? scanf Server read_input p process_record _ main Detector maintains a shadow call stack Client sends attack info to server Detector collects information and terminates application
  • 26. Learning attack behavior Community machines Extra checking in attacked code Check the learned constraints Server scanf read_input process_record main Server generates Server sends instru- instrumentation for mentation to all clients targeted code locations Clients install instrumentation
  • 27. Learning attack behavior Community machines What was the effect of the attack? Server Predictive: copy_len ≤ buff_size Clients send difference in Server correlates behavior: violated constraints Instrumentation continuously constraints to attack evaluates inferred behavior
  • 28. Correlating attacks & constraints Check constraints only at attack sites – Low overhead A constraint is predictive of an attack if: – The constraint is violated iff the attack occurs Create repairs for each predictive constraint – Re-establish normal behavior
  • 29. Outline • Overview • Learning normal behavior • Learning attack b h i L i tt k behavior • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion
  • 30. Repair Community machines Distribute patches to the community Success = no detector is triggered gg Server Ranking: Patch 1: P t h1 0 Patch 2: 0 Patch 3: 0 … Patch evaluation uses additional detectors (e.g., crash, difference in attack)
  • 31. Attack example • Target: JavaScript system routine (written in C++) – C t it argument to a C++ object, calls a virtual method Casts its tt C bj t ll it l th d – Does not check type of the argument • Attack supplies an “object” whose virtual table object points to attacker-supplied code • Predictive constraint at the method call: – JSRI address target is one of a known set • Possible repairs: – Call one of the known valid methods – Skip over the call p – Return early
  • 32. Repair example if (! ( py_len ≤ buff_size)) ( (copy )) copy_len = buff_size; • The repair checks the predictive constraint – If constraint is not violated, no need to repair – If constraint i violated, an attack is (probably) underway t i t is i l t d tt k i ( b bl ) d • The patch does not depend on the detector – Should fix the problem before the detector is triggered • Repair is not identical to what a human would write – Unacceptable to wait for human response
  • 33. Example constraints & repairs v1 ≤ v2 if (!(v1≤v2)) v1 = v2; v≥c if (!(v≥c)) v = c; v ∈ { c1, c2, c3 } if (!(v==c1 || v==c2 || v==c3)) v = ci; Return from enclosing procedure if (!(…)) return; Modify a use: convert “call *v” to if (…) call *v; Constraint on v (not negated)
  • 34. Evaluating a patch • In-field evaluation – No attack detector is triggered – No other behavior deviations • E g crash application invariants E.g., crash, • Pre-validation, before distributing the patch: • Replay the attack + No N need t wait f a second attack d to it for d tt k + Exactly reproduce the problem – Expensive to record log; log terminates abruptly – Need to prevent irrevocable effects – Delays distribution of good patches • Run the program’s test suite – May be too sensitive – Not available for commercial software
  • 35. Outline • Overview • Learning normal behavior • Learning attack b h i L i tt k behavior • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion
  • 36. Red Team • Red Team attempts to break our system – Hired by DARPA; 10 engineers • Red Team created 10 Firefox exploits – Each exploit is a webpage – Firefox executes arbitrary code – Malicious JavaScript, GC errors, stack smashing, heap buffer overflow, uninitialized memory
  • 37. Rules of engagement • Firefox 1.0 – ClearView may not be tuned to known vulnerabilities –FFocus on most security-critical components t it iti l t • No access to a community for learning • Red Team has access to all ClearView materials – Source code, documents, learned invariants, …
  • 38. ClearView was successful • Detected all attacks prevented all exploits attacks, • For 7/10 vulnerabilities, generated a patch that maintained functionality – No observable deviation from desired behavior – Aft an average of 4.9 minutes and 5.4 attacks After f49 i t d 5 4 tt k • Handled polymorphic attack variants • Handled simultaneous & intermixed attacks • No false positives • Low overhead for detection & repair
  • 39. 3 un repaired vulnerabilities un-repaired Consequence: Application crashes when attacked. No exploit occurs. 1. ClearView was mis-configured: didn’t try repairs in all procedures on the stack 2. Learning suite was too small: a needed constraint was not statistically significant 3. A needed constraint was not built into Daikon
  • 40. Outline • Overview • Learning normal behavior • Learning attack b h i L i tt k behavior • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion
  • 41. Limitations ClearView might fail to repair an error: – Only fixes errors for which a detector exists – Daikon might not learn a needed constraint – Predictive constraint may be too far from error – Built-in repairs may not be sufficient p y ClearView might degrade the application: – Patch may impair functionality y p y – Attacker may subvert patch – Malicious nodes may induce bad p y patches Bottom line: Red Team tried unsuccessfully
  • 42. Related work • Attack detection: ours are mostly standard – Distributed: Vigilante [Costa], live monitoring [Kıcıman], statistical bug isolation [Liblit] • L Learning i – FSMs of system calls for anomaly detection – Invariants: [Lin], [Demsky], Gibraltar [Baliga] [Lin] [Demsky] – System configuration: FFTV [Lorenzoli], Dimmunix [Jula] [ ] • Repair & failure tolerance – Checkpoint and replay: Rx [Qin], microreboot [Candea] [C d ] – Failure-oblivious [Rinard], ASSURE [Sidiroglou]
  • 43. Credits • Saman Amarasinghe • Jeff Perkins • Jonathan Bachrach • Martin Rinard • Michael Carbin • Frank Sherwood • Michael Ernst • Stelios Sidiroglou • Sung Kim • Greg Sullivan • Samuel Larsen • Weng-Fai Wong • Carlos Pacheco • Yoav Zibin Subcontractor: Determina, Inc. Funding: DARPA (PM: Lee Badger) Red Team: SPARTA, Inc.
  • 44. Contributions ClearView: framework for patch generation – Pluggable detection, learning, repair 1. 1 Protects against unknown vulnerabilities – Learns from success – Learns from failure: what, where, how – Learning focuses effort where it is needed 2. 2 Preserves functionality: repairs the vulnerability 3. 3 Commercial software: Windows binaries Evaluation via a Red Team exercise