Lucas Davi University of Duisburg-Essen, Germany ICRI-SC Associated Researcher

Similar documents
Bit Flips in Memory Rowhammer Attacks and Defenses

CIS-331 Exam 2 Fall 2015 Total of 105 Points Version 1

Security of Embedded Systems

CIS-331 Fall 2013 Exam 1 Name: Total of 120 Points Version 1

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1

4. Specifications and Additional Information

HAFIX: Hardware-Assisted Flow Integrity Extension

Three Decades of Runtime Attacks

CIS-331 Spring 2016 Exam 1 Name: Total of 109 Points Version 1

CIS-331 Fall 2014 Exam 1 Name: Total of 109 Points Version 1

Stephen Checkoway, Lucas Davi, Alexandra Dmitrienko, Ahmad-Reza Sadeghi, Hovav Shacham, Marcel Winandy. ACM CCS 2010, Chicago, USA

Selected background on ARM registers, stack layout, and calling convention

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1

C1098 JPEG Module User Manual

Breaking Active-Set Backward-Edge CFI

It s a TRaP: Table Randomization and Protection against Function-Reuse Attacks

The cache is 4-way set associative, with 4-byte blocks, and 16 total lines

Hardware-assisted Security: So Close yet So Far

BlackBox. Lightweight Security Monitoring for COTS Binaries. Byron Hawkins and Brian Demsky University of California, Irvine, USA

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1

ECHO Process Instrumentation, Inc. Modbus RS485 Module. Operating Instructions. Version 1.0 June 2010

Gateway Ascii Command Protocol

Triple DES and AES 192/256 Implementation Notes

Advanced Systems Security: Program Diversity

ZN-DN312XE-M Quick User Guide

Control-Flow Attacks and Defenses

Inject malicious code Call any library functions Modify the original code

July Registration of a Cyrillic Character Set. Status of this Memo

DBK24. Isolated Digital Output Chassis. Overview

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

ID: Cookbook: urldownload.jbs Time: 23:23:00 Date: 11/01/2018 Version:

Control-Flow Hijacking: Are We Making Progress? Mathias Payer, Purdue University

Acquirer JCB EMV Test Card Set

APPLESHARE PC UPDATE INTERNATIONAL SUPPORT IN APPLESHARE PC

Module: Return-oriented Programming. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

6.1 Font Types. Font Types

ATRIUM: Runtime Attestation Resilient Under Memory Attacks

Defeating Return-Oriented Rootkits with Return-less Kernels

Securing Legacy Software against Real-World Code-Reuse Exploits: Utopia, Alchemy, or Possible Future?

First Data Dual Interface EMV Test Card Set. Version 1.20

First Data EMV Test Card Set. Version 1.30

TEST DVD-VIDEO/ DVD-ROM For Checking DVD Players, DVD Recorders and DVD Drives TDH-940

First Data EMV Test Card Set. Version 2.00

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

Mitigating Code-Reuse Attacks with. Tyler Bletsch, Xuxian Jiang, Vince Freeh Dec. 9, 2011

CDR File Information. Comments Direct PCM

Fundamentals of Cryptography

Module: Return-oriented Programming. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Hash Constant C Determinants leading to collisionfree

6. Specifications & Additional Information

UNH-IOL MIPI Alliance Test Program

Acquirer JCB Dual Interface EMV Test Card Set

Here is a C function that will print a selected block of bytes from such a memory block, using an array-based view of the necessary logic:

CIS-331 Final Exam Fall 2015 Total of 120 Points. Version 1

Subversive-C: Abusing and Protecting Dynamic Message Dispatch

Just-in-Time Code Reuse

ENGI 8868/9877 Computer and Communications Security III. BLOCK CIPHERS. Symmetric Key Cryptography. insecure channel

Advanced Systems Security: Control-Flow Integrity

Digital Lighting Systems, Inc.

Problem 3. (12 points):

First Data DCC Test Card Set. Version 1.30

EDR Report Information

Module: Advanced Program Vulnerabilities and Defenses. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

ID: Cookbook: browseurl.jbs Time: 19:37:50 Date: 11/05/2018 Version:

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

One subset of FEAL, called FEAL-NX, is N round FEAL using a 128-bit key without key parity.

CIS-331 Final Exam Spring 2016 Total of 120 Points. Version 1

A survey of Hardware-based Control Flow Integrity (CFI)

Digital Lighting Systems, Inc. CD400-DMX DMX512 Four Channel Dimmer and Switch module

VM7000A PAPERLESS RECORDER COMMUNICATION FUNCTION OPERATION MANUAL

CSCI 454/554 Computer and Network Security. Topic 3.1 Secret Key Cryptography Algorithms

Readactor: Practical Code Randomization Resilient to Memory Disclosure

Technical Specification. Third Party Control Protocol. AV Revolution

Enhanced Play Fair Cipher

Autodesk AutoCAD DWG-AC1021 Heap Corruption

Sandboxing Untrusted Code: Software-Based Fault Isolation (SFI)

Physical Unclonable Functions-based Linear Encryption against Code Reuse Attacks

Information Security Research and Education at Aalto. N. Asokan

SoK: Eternal War in Memory

Interac USA Interoperability EMV Test Card Set

Applications. Cloud. See voting example (DC Internet voting pilot) Select * from userinfo WHERE id = %%% (variable)

2-Type Series Pressurized Closures

PCL ISO 8859/5 Latin/Cyrillic

CPSC213/2014W1 Midterm EXTRA Practice

Runtime attacks are major threats to today's applications Control-flow of an application is compromised at runtime Typically, runtime attacks include

Systems/DBG Debugger Version 2.20

Modbus Register Map: InRow ACRD60x / ACRC60x

AIT 682: Network and Systems Security

10. RS-232C communication

CS 537: Introduction to Operating Systems Fall 2015: Midterm Exam #1

Register Map: Ecoflair Indirect Air Economizer

VM7000A PAPERLESS RECORDER COMMUNICATION FUNCTION OPERATION MANUAL

Digital Lighting Systems, Inc.

Secret Key Systems (block encoding) Encrypting a small block of text (say 64 bits) General considerations for cipher design:

Scan Results - ( Essentials - Onsharp )

ETSI TS V ( )

Here is a C function that will print a selected block of bytes from such a memory block, using an array-based view of the necessary logic:

Digital Lighting Systems, Inc. PD405-DMX. Four Channel Dimmer and Switch Packs. DMX512 compatible. PD405-DMX-24DC DMX512 4 x 5 Amps Dimmer Pack

ID: Sample Name: MobaXterm_installer_10.5.msi Cookbook: defaultwindowsmsicookbook.jbs Time: 18:29:36 Date: 25/05/2018 Version: 22.0.

Transcription:

17 th May 2017, ICRI-SC Retreat, Darmstadt, Germany Can Systems ever be Protected against Run-time Attacks? Lucas Davi University of Duisburg-Essen, Germany ICRI-SC Associated Researcher

Motivation

Motivation App A App B

Motivation App A exploit bugs App B

Motivation App A exploit bugs App B App M inject malicious code

Motivation App A exploit bugs App B App M inject malicious code

Motivation App A exploit bugs App B App M inject malicious code Large attack surface for remote malware attacks and software exploits on embedded systems [Costin et al., USENIX Security 2014 and Chen et al., NDSS 2016 ]

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] A B C D E F Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] A B Basic Block ENTRY asm_ins, EXIT Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] C D E F Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] A B Basic Block ENTRY asm_ins, EXIT Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] C D E F Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] A B Basic Block ENTRY asm_ins, EXIT Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] C D E X F inject malicious code Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] Basic Block Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] A ENTRY asm_ins, EXIT B C D E corrupt code pointer X F inject malicious code Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] Basic Block Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] A ENTRY asm_ins, EXIT B C D E corrupt code pointer DEP X F inject malicious code Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] Basic Block Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] A ENTRY asm_ins, EXIT B C D E corrupt code pointer DEP X F inject malicious code Adversary Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] Basic Block Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] A ENTRY asm_ins, EXIT A C D B E corrupt code pointer C D B E DEP X F inject malicious code Adversary F Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] C D A B E Basic Block switch(opmode) ENTRY case recovery: C asm_ins, case op1: D EXIT case op2: E,F corrupt code pointer Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] C D A B E DEP X F inject malicious code Adversary F Memory write Program flow

Classification Control-Flow Attack [AlephOne, Phrack 1996] [Shacham, CCS 2007] C D A B E Basic Block switch(opmode) ENTRY case recovery: C asm_ins, case op1: D EXIT case op2: E,F corrupt code pointer Non-Control-Data Attack [Chen et al., USENIX Sec. 2005] [Carlini et al., USENIX Sec. 2015] C D A B E DEP X F inject malicious code Adversary corrupt data pointer/variable F Memory write Program flow

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] 19

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] A B C E D F 20

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] A B C E D F Memory Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] 21

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] D A E F B C Memory (randomized) Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] 22

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] D A E F B C Memory (randomized) Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] C E A B D F 23

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] D A E F B C Memory (randomized) Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] Label_3 C E Label_5 A B Label_1 Label_2 D F Label_6 Label_4 24

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] D A E F B C Memory (randomized) Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] Label_3 C E Label_5 A B Label_1 Label_2 D F Label_6 Label_4 25

Main Defense Techniques (Fine-grained) Code Randomization [Cohen 1993 & Larsen et al., SoK IEEE S&P 2014] D A E F B C Memory (randomized) Control-Flow Integrity (CFI) [Abadi et al., CCS 2005 & TISSEC 2009] Exit(B) == Label_5 Label_3 C E Label_5 A B Label_1 Label_2 D F Label_6 Label_4 26

Our Research on Return-Oriented Programming Attacks Jump-Oriented Programming with Checkoway et al. CCS 2010 Just-in-time Code Reuse with Snow et al. IEEE S&P 2013 Stitching Gadgets Davi et al. USENIX Sec. 2013 COOP with Schuster et al. IEEE S&P 2015 Losing Control with Conti et al. CCS 2015

Our Research on Return-Oriented Programming Attacks Undermines Shadow Stacks Jump-Oriented Programming with Checkoway et al. Just-in-time Code Reuse with Snow et al. Stitching Gadgets Davi et al. COOP with Schuster et al. Losing Control with Conti et al. CCS 2010 IEEE S&P 2013 USENIX Sec. 2013 IEEE S&P 2015 CCS 2015

Our Research on Return-Oriented Programming Attacks Undermines Shadow Stacks Jump-Oriented Programming with Checkoway et al. Just-in-time Code Reuse with Snow et al. Stitching Gadgets Davi et al. COOP with Schuster et al. Losing Control with Conti et al. CCS 2010 IEEE S&P 2013 USENIX Sec. 2013 IEEE S&P 2015 CCS 2015 Bypasses fine-grained code randomization (incl. ASLR)

Our Research on Return-Oriented Programming Attacks Undermines Shadow Stacks Attacks against Microsoft EMET Jump-Oriented Programming with Checkoway et al. Just-in-time Code Reuse with Snow et al. Stitching Gadgets Davi et al. COOP with Schuster et al. Losing Control with Conti et al. CCS 2010 IEEE S&P 2013 USENIX Sec. 2013 IEEE S&P 2015 CCS 2015 Bypasses fine-grained code randomization (incl. ASLR)

Our Research on Return-Oriented Programming Attacks Undermines Shadow Stacks Attacks against Microsoft EMET Jump-Oriented Programming with Checkoway et al. Just-in-time Code Reuse with Snow et al. Stitching Gadgets Davi et al. COOP with Schuster et al. Losing Control with Conti et al. CCS 2010 IEEE S&P 2013 USENIX Sec. 2013 IEEE S&P 2015 CCS 2015 Bypasses fine-grained code randomization (incl. ASLR) Limitations of Binary-CFI

Our Research on Return-Oriented Programming Attacks Undermines Shadow Stacks Attacks against Microsoft EMET Bypasses Google s Forward-Edge CFI Jump-Oriented Programming with Checkoway et al. Just-in-time Code Reuse with Snow et al. Stitching Gadgets Davi et al. COOP with Schuster et al. Losing Control with Conti et al. CCS 2010 IEEE S&P 2013 USENIX Sec. 2013 IEEE S&P 2015 CCS 2015 Bypasses fine-grained code randomization (incl. ASLR) Limitations of Binary-CFI

HAFIX: Hardware Flow Integrity Extensions [O. Arias, L. Davi, M. Hanreich, Y. Jin, P. Koeberl, D. Paul, A.-R. Sadeghi, D. Sullivan, DAC 2015, Best Paper]

State 0 Normal Execution Big Picture

Big Picture State 0 Normal Execution Function Call Indirect Jump Function Return

Big Picture State 0 Normal Execution CFI State Only CFI instructions allowed Function Call Indirect Jump Function Return

Big Picture State 0 Normal Execution Function Call Indirect Jump Function Return CFI State Only CFI instructions allowed CFI_CALL label CFI_JMP label CFI_RET label

Big Picture State 0 Normal Execution Function Call Indirect Jump Function Return CFI State Only CFI instructions allowed CFI_CALL label CFI_JMP label CFI_RET label

Big Picture State 0 Normal Execution Function Call Indirect Jump Function Return CFI State Only CFI instructions allowed CFI_CALL label CFI_JMP label CFI_RET label

Overview on HAFIX

Overview on HAFIX Contributions Efficient CFI hardware implementation for Intel Siskiyou Peak and SPARC-LEON3 Dedicated CFI instructions and memory

Overview on HAFIX Contributions Efficient CFI hardware implementation for Intel Siskiyou Peak and SPARC-LEON3 Dedicated CFI instructions and memory HAFIX Policies 1. Function returns only allowed to target active call sites or the last active call site 2. Function calls need to target a valid function entry

Overview on HAFIX Contributions Efficient CFI hardware implementation for Intel Siskiyou Peak and SPARC-LEON3 Dedicated CFI instructions and memory HAFIX Policies 1. Function returns only allowed to target active call sites or the last active call site 2. Function calls need to target a valid function entry Limitations No policy enforcement for indirect jumps Coarse-grained policy for indirect calls

HAFIX++ Strategy Without Tactics: Policy-Agnostic Hardware-Enhanced Control-Flow Integrity [Dean Sullivan, Orlando Arias, Lucas Davi, Per Larsen, Ahmad-Reza Sadeghi, Yier Jin, DAC 2016]

What about attacks inside the benign control flow? How can we attest control-flow paths of an application?

C-FLAT: Control-Flow Attestation of Embedded Systems Software Tigist Abera, N. Asokan, Lucas Davi, Jan-Erik Ekberg, Thomas Nyman, Andrew Paverd, Ahmad-Reza Sadeghi, Gene Tsudik ACM CCS 2016

C-FLAT: Big Picture Verifier Prover App A

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis P 1 P 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis LP 1 P 1 P 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis LP 1 Path Measurement App A P 1 P 1, #LP 1 P 2 P 1 P 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis LP 1 Path Measurement App A Run-Time Path Measurement P 1 P 1, #LP 1 P 2 P 1 P 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis LP 1 Path Measurement App A Run-Time Path Measurement P 1 P 1, #LP 1 P 2 P 1 P 2 P* 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis Path Measurement Control-Flow Validation Run-Time Path Measurement LP 1 App A P 1 P 1, #LP 1 P 2 P 1 P 2 P* 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis Path Measurement Control-Flow Validation Run-Time Path Measurement LP 1 App A P 1 P 1, #LP 1 P 2 P* 2 P 1 P 2 P* 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis Path Measurement Control-Flow Validation Run-Time Path Measurement LP 1 App A P 1 P 1, #LP 1 P 2 P* 2 P 1 P 2 P* x P* 2

C-FLAT: Big Picture Verifier Prover App A Control-Flow Graph (CFG) Analysis Path Measurement Control-Flow Validation Run-Time Path Measurement LP 1 App A P 1 P* x P 1, #LP 1 P 2 P* 2 P 1 P 2 P* x P* 2

How to attest the executed control flows without transmitting all executed branches?

C-FLAT Measurement Function Cumulative Hash Value: H i = H ( H i-1, N ) H i-1 -- previous hash result N -- instruction block (node) just executed A B C D E F

C-FLAT Measurement Function Cumulative Hash Value: H i = H ( H i-1, N ) H i-1 -- previous hash result N -- instruction block (node) just executed A H 1 = H(0,A) B C D E F

C-FLAT Measurement Function Cumulative Hash Value: H i = H ( H i-1, N ) H i-1 -- previous hash result N -- instruction block (node) just executed H 2 = H( H 1,B) H 1 = H(0,A) A B C D E F

C-FLAT Measurement Function Cumulative Hash Value: H i = H ( H i-1, N ) H i-1 -- previous hash result N -- instruction block (node) just executed H 2 = H( H 1,B) H 1 = H(0,A) A B C D E H 3 = H( H 2,C) H 4 = H( H 2,D) F

C-FLAT Measurement Function Cumulative Hash Value: H i = H ( H i-1, N ) H i-1 -- previous hash result N -- instruction block (node) just executed H 2 = H( H 1,B) H 1 = H(0,A) A B C D H 3 = H( H 2,C) H 4 = H( H 2,D) E F H 5 = H( H 2,E) H 6 = H( H 5,F)

Loops are a challenge! Different loop paths and loop iterations lead to many valid hash values

C-FLAT Approach: Treat loops as sub-graphs and report their hash values and # of iterations separately

C-FLAT Approach: Treat loops as sub-graphs and report their hash values and # of iterations separately H Final H loop-entry Loop Entry Hash H loop_1,#h loop_1 H loop_2,#h loop_2 Loop Hash,Iteration

Prototype Architecture Implementation on Raspberry Pi 2 Application Binary Trampolines Measurement Engine and Attestation Hardware

Prototype Architecture Implementation on Raspberry Pi 2 Application Binary Trampolines Measurement Engine and Attestation Hardware

Prototype Architecture Implementation on Raspberry Pi 2 Application Binary Trampolines Measurement Engine and Attestation Hardware

Prototype Architecture Implementation on Raspberry Pi 2 Application Binary Trampolines Measurement Engine and Attestation Hardware

Evaluation: Case Studies Syringe Pump Soldering Iron Temperature Controller

Syringe Pump Source: https://hackaday.io/project/1838- open-syringe-pump

Syringe Pump Source: https://hackaday.io/project/1838- open-syringe-pump Original implementation targets Arduino boards We ported the code to Raspberry Pi 13,000 instructions with 332 CFG edges of which 20 are loops Main functions are set-quantity and move-syringe

Applying C-FLAT to Syringe Pump main() while (1) { if (serialready()) { processserial(); } } Please note that this slide shows a simplified view of the Syringe pump code and control-flow graph.

Applying C-FLAT to Syringe Pump main() while (1) { if (serialready()) { cfa_init; processserial(); cfa_quote; } } Please note that this slide shows a simplified view of the Syringe pump code and control-flow graph.

Applying C-FLAT to Syringe Pump main() while (1) { if (serialready()) { cfa_init; processserial(); cfa_quote; } } processserial() if (input == + ) { action(push,bolus); updatescreen(); } else if (input == - ) { action(pull,bolus); updatescreen(); } action(direction,bolus) steps = bolus * steps_per_ml if (direction == PUSH) { /* set stepper direction */ } else { /* PULL */ /* set stepper direction */ } for (steps) { /* move stepper */ } bolus = dose of drug; volume of cylinder for a particular height x Please note that this slide shows a simplified view of the Syringe pump code and control-flow graph.

Applying C-FLAT to Syringe Pump while (1) { if (serialready()) { cfa_init; processserial(); 1 cfa_quote; 14 } } 2 10 13 if (input == + ) { action(push,bolus); 3 updatescreen(); 9 } else if (input == - ) { } main() processserial() action(pull,bolus); updatescreen(); 11 12 4 5 6 7 8 action(direction,bolus) steps = bolus * steps_per_ml if (direction == PUSH) { /* set stepper direction */ } else { /* PULL */ /* set stepper direction */ } for (steps) { /* move stepper */ } bolus = dose of drug; volume of cylinder for a particular height x Please note that this slide shows a simplified view of the Syringe pump code and control-flow graph.

Final Hash Measurements 4 5 6 7 8 action(direction,bolus) steps = bolus * steps_per_ml if (direction = PUSH) { /* set stepper direction */ } else /* PULL */ /* set stepper direction */ } for (steps) { /* move stepper */ }

Final Hash Measurements 4 5 6 7 8 action(direction,bolus) steps = bolus * steps_per_ml if (direction = PUSH) { /* set stepper direction */ } else /* PULL */ /* set stepper direction */ } for (steps) { /* move stepper */ } Final Measurements for PUSH, PULL operations: b3 c5 ca c4 6f dc 6a d0 4a 80 10 09 af a3 59 70 e0 9a f6 48 11 65 17 94 a7 0b 06 f0 ba e4 75 75

Final Hash Measurements 4 5 6 7 8 action(direction,bolus) steps = bolus * steps_per_ml if (direction = PUSH) { /* set stepper direction */ } else /* PULL */ /* set stepper direction */ } for (steps) { /* move stepper */ } Final Measurements for PUSH, PULL operations: b3 c5 ca c4 6f dc 6a d0 4a 80 10 09 af a3 59 70 e0 9a f6 48 11 65 17 94 a7 0b 06 f0 ba e4 75 75 Loop Measurement: 97 78 fb fc 93 09 4e d7 ac 32 5d 65 eb 29 08 0c (#iterations)

C-FLAT Log for PUSH action PUSH 0.1 ml Used 0.100 ml Bolus 0.100 ml [INFO] cfa_quote: 57 92 0f 9e 98 47 30 bb a5 f7 5d 2a dc 8a 7b 5f [INFO] loop[000]: b3 c5 ca c4 6f dc 6a d0 4a 80 10 09 af a3 59 70 [INFO] path[000]: 97 78 fb fc 93 09 4e d7 ac 32 5d 65 eb 29 08 0c (682) [INFO] loop[001]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[002]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[003]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[004]: f5 77 b7 94 bd 6c 81 e2 2f 36 da ad cd df 56 6e [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (9) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[005]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[006]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[007]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[008]: ca 34 cb 8a 0b 8a 76 41 0f 59 e9 b2 8d 76 91 30 [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (10) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[009]: 2d 80 99 2c f1 61 b1 19 53 4d 0a 96 be be a8 1f [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (13) [INFO] loop[010]: d2 32 da 39 c8 7f 0d bb 13 c0 a7 12 7d 4b 0c ce [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) [INFO] loop[011]: 73 e3 be b7 33 30 58 5a 59 1b 2b c0 60 50 c6 36 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (14) [INFO] loop[012]: c2 88 83 00 68 dd 41 32 2c 0d 37 f6 d3 be fd 09 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) PUSH 0.2 ml Used 0.200 ml Bolus 0.200 ml [INFO] cfa_quote: 57 92 0f 9e 98 47 30 bb a5 f7 5d 2a dc 8a 7b 5f [INFO] loop[000]: b3 c5 ca c4 6f dc 6a d0 4a 80 10 09 af a3 59 70 [INFO] path[000]: 97 78 fb fc 93 09 4e d7 ac 32 5d 65 eb 29 08 0c (1365) [INFO] loop[001]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[002]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[003]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[004]: f5 77 b7 94 bd 6c 81 e2 2f 36 da ad cd df 56 6e [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (9) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[005]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[006]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[007]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[008]: ca 34 cb 8a 0b 8a 76 41 0f 59 e9 b2 8d 76 91 30 [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (10) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[009]: 2d 80 99 2c f1 61 b1 19 53 4d 0a 96 be be a8 1f [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (13) [INFO] loop[010]: d2 32 da 39 c8 7f 0d bb 13 c0 a7 12 7d 4b 0c ce [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) [INFO] loop[011]: 73 e3 be b7 33 30 58 5a 59 1b 2b c0 60 50 c6 36 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (14) [INFO] loop[012]: c2 88 83 00 68 dd 41 32 2c 0d 37 f6 d3 be fd 09 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2)

C-FLAT Log for PUSH action PUSH 0.1 ml Used 0.100 ml Bolus 0.100 ml [INFO] cfa_quote: 57 92 0f 9e 98 47 30 bb a5 f7 5d 2a dc 8a 7b 5f PUSH 0.2 ml Used 0.200 ml Bolus 0.200 ml [INFO] cfa_quote: 57 92 0f 9e 98 47 30 bb a5 f7 5d 2a dc 8a 7b 5f [INFO] loop[000]: b3 c5 ca c4 6f dc 6a d0 4a 80 10 09 af a3 59 70 [INFO] path[000]: 97 78 fb fc 93 09 4e d7 ac 32 5d 65 eb 29 08 0c (682) [INFO] loop[001]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[002]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[003]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[004]: f5 77 b7 94 bd 6c 81 e2 2f 36 da ad cd df 56 6e [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (9) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[005]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[006]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[007]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[008]: ca 34 cb 8a 0b 8a 76 41 0f 59 e9 b2 8d 76 91 30 [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (10) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[009]: 2d 80 99 2c f1 61 b1 19 53 4d 0a 96 be be a8 1f [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (13) [INFO] loop[010]: d2 32 da 39 c8 7f 0d bb 13 c0 a7 12 7d 4b 0c ce [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) [INFO] loop[011]: 73 e3 be b7 33 30 58 5a 59 1b 2b c0 60 50 c6 36 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (14) [INFO] loop[012]: c2 88 83 00 68 dd 41 32 2c 0d 37 f6 d3 be fd 09 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) [INFO] loop[000]: b3 c5 ca c4 6f dc 6a d0 4a 80 10 09 af a3 59 70 [INFO] path[000]: 97 78 fb fc 93 09 4e d7 ac 32 5d 65 eb 29 08 0c (1365) [INFO] loop[001]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[002]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[003]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[004]: f5 77 b7 94 bd 6c 81 e2 2f 36 da ad cd df 56 6e [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (9) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[005]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (1) [INFO] loop[006]: 6d 05 6e b2 3a 27 1e 2b 78 3e f9 4c e3 a7 cb f8 [INFO] path[000]: 62 f7 b8 0b 65 4b de 35 c7 05 bc 28 06 43 11 6e (2) [INFO] loop[007]: eb 16 88 8a d2 3b c6 19 f9 01 94 5d ee cb 1c 13 [INFO] path[000]: b9 7d cf 8d 00 b6 5f 63 b3 7c 60 e4 e3 be 56 17 (3) [INFO] loop[008]: ca 34 cb 8a 0b 8a 76 41 0f 59 e9 b2 8d 76 91 30 [INFO] path[000]: 67 c6 5e d4 18 13 02 bc 4a 5d 60 a0 16 85 f4 ed (10) [INFO] path[001]: 78 19 af 09 0f d5 64 f4 39 b4 7a 0d 97 57 77 8c (2) [INFO] loop[009]: 2d 80 99 2c f1 61 b1 19 53 4d 0a 96 be be a8 1f [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (13) [INFO] loop[010]: d2 32 da 39 c8 7f 0d bb 13 c0 a7 12 7d 4b 0c ce [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) [INFO] loop[011]: 73 e3 be b7 33 30 58 5a 59 1b 2b c0 60 50 c6 36 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (14) [INFO] loop[012]: c2 88 83 00 68 dd 41 32 2c 0d 37 f6 d3 be fd 09 [INFO] path[000]: 74 af 0f dc 3b 17 ff 67 03 72 d0 db fe b5 94 78 (2) Only the number of loop iterations is different per bolus 682 (0.1 ml), 1365 (0.2 ml)

Attacking the Syringe Pumb Constructed several exploits to validate the effectiveness of C-FLAT Control-flow attack uses ROP to dispense liquid at unexpected time C-FLAT detects attack due to unexpected measurement Non-control-data attack that dispenses more liquid than requested C-FLAT detects attack due to an unexpectedly high number of loop iterations

Discussion on C-FLAT C-FLAT attests control flow Pure data attacks that don t affect control flow are not covered

Discussion on C-FLAT C-FLAT attests control flow Pure data attacks that don t affect control flow are not covered Scalability depends on program size and complexity We target typical (simple) embedded software, e.g., Syringe Pump that scales well for C-FLAT

Discussion on C-FLAT C-FLAT attests control flow Pure data attacks that don t affect control flow are not covered Scalability depends on program size and complexity We target typical (simple) embedded software, e.g., Syringe Pump that scales well for C-FLAT Reducing context switch overhead ARMv8 Cortex-A53 needs ~3700 cycles at 800MHz; TrustZone-M only requires a few cycles

Open Challenges

Open Challenges

Open Challenges CFI enforcement in the context of real-time operating systems and autonomous system

Open Challenges CFI enforcement in the context of real-time operating systems and autonomous system Addressing new attack techniques (e.g., dataoriented exploits, rowhammer)

Open Challenges CFI enforcement in the context of real-time operating systems and autonomous system Addressing new attack techniques (e.g., dataoriented exploits, rowhammer) Control-flow attestation of a network of devices inside an autonomous car

Open Challenges CFI enforcement in the context of real-time operating systems and autonomous system Addressing new attack techniques (e.g., dataoriented exploits, rowhammer) Control-flow attestation of a network of devices inside an autonomous car Data-flow attestation