Debunking Fault Injection Myths and Misconceptions Cristofaro Mune - - PowerPoint PPT Presentation

debunking fault injection
SMART_READER_LITE
LIVE PREVIEW

Debunking Fault Injection Myths and Misconceptions Cristofaro Mune - - PowerPoint PPT Presentation

Debunking Fault Injection Myths and Misconceptions Cristofaro Mune Niek Timmers c.mune@pulse-sec.com niek@twentytwosecurity.com @pulsoid @tieknimmers Todays agenda Introduction Fault injection, what is it? Fault injection,


slide-1
SLIDE 1

Debunking Fault Injection Myths and Misconceptions

Niek Timmers niek@twentytwosecurity.com @tieknimmers Cristofaro Mune c.mune@pulse-sec.com @pulsoid

slide-2
SLIDE 2

Today’s agenda

  • Introduction
  • Fault injection, what is it?
  • Fault injection, where are we now?
  • Trends
  • Debunking myths
  • Takeaways
slide-3
SLIDE 3
  • Cristofaro Mune
  • Product Security Consultant
  • Security trainer
  • Research:
  • Fault injection
  • TEEs
  • White-box Cryptography
  • Device exploitation
  • Niek Timmers
  • Freelance Device Security Expert
  • Security trainer
  • Interests:
  • Embedded device security
  • Secure boot
  • Hardware attacks
  • Automotive

Who are we…

slide-4
SLIDE 4

WHAT IS FAULT INJECTION?

slide-5
SLIDE 5

How do you introduce those faults?

Fault injection basics

“Introducing faults into a chip to alter its intended behavior.”

slide-6
SLIDE 6

Fault injection techniques

Faults are introduced by injecting glitches that put a chip temporarily outside of its expected conditions.

slide-7
SLIDE 7

Fault injection techniques

Faults are introduced by injecting glitches that put a chip temporarily outside of its expected conditions.

3.3 V Clock Time 4.0 V 1.0 V

Voltage Clock

slide-8
SLIDE 8

Fault injection techniques

Faults are introduced by injecting glitches that put a chip temporarily outside of its expected conditions.

Voltage Clock Electromagnetic Laser

slide-9
SLIDE 9

WHERE ARE WE NOW?

slide-10
SLIDE 10

Research

  • There’s academic conferences
  • Great academic papers at

various conferences

  • Great contributions from the

community at various conferences

  • E.g. Exide @ REcon 2014
slide-11
SLIDE 11

Tooling

  • Do-it-yourself
  • < $100 (Voltage)
  • E.g. chipfail glitcher
  • Commercial (affordable)
  • < $1000 (Voltage); < $4000 (EMFI)
  • E.g. NewAE ChipWhisperer
  • Commercial (professional)
  • > $10,000 (Voltage, EMFI, Laser, etc.)
  • E.g. Riscure Inspector FI
slide-12
SLIDE 12

Attacks

  • Breaking the security of crypto wallets
  • Breaking the security of smart phones
  • Breaking the security of secure boot
  • Breaking the security of crypto engines
slide-13
SLIDE 13

Trends

  • Tooling is becoming available to the masses
  • Lots of focus on the ‘how to inject a glitch’ part of an attack
  • Most research conducted on low power chips
  • Focus is mostly on altering software behavior
slide-14
SLIDE 14

Important exceptions

  • Optical fault injection tooling not

available to the masses

  • Academia performs theoretical

research on fault injection

  • Real attackers go further than:
  • low powered chips
  • just altering software
slide-15
SLIDE 15

WHERE DO WE FIT IN?

slide-16
SLIDE 16

What we are working on…

  • A fault injection think tank (AllOurFaults):
  • Alyssa Milburn (@noopwafel)
  • Albert Spruyt
  • Cristofaro Mune (@pulsoid)
  • Niek Timmers (@tieknimmers)
  • An open source voltage glitching platform
  • Fault injection research; some results covered in this presentation
  • You can find us on: allourfaults.com and @allourfaults
slide-17
SLIDE 17

Published fault injection research

  • Academic contributions:
  • Controlling PC on ARM using Fault Injection, 2016
  • Escalating Privileges in Linux using Voltage Fault Injection, 2017
  • Several community contributions:
slide-18
SLIDE 18

Lots of research… but still many ‘Myths and Misconceptions’

slide-19
SLIDE 19

Let’s debunk them in a systematic fashion!

slide-20
SLIDE 20

Fault injection reference model

Faults

FI technique

Injection Clock EM … Voltage Activation Software

  • CLKSCREW
  • Rowhammer

Hardware

  • FI tooling

Glitch parameters

Glitch Exploit

HW Vulnerability

Target

Fault model

Goal

“Control” “Inject” “Glitch” “Selecting specific faults” “Execute” “Achieve” “Introduce”

slide-21
SLIDE 21

Here they come…

slide-22
SLIDE 22

“Fault attacks are not effective on >1 GHz chips.”

slide-23
SLIDE 23

FAULT ATTACKS ARE NOT EFFECTIVE ON > 1 GHZ CHIPS

slide-24
SLIDE 24

BUT THAT’S VOLTAGE… WHAT ABOUT EMFI?

slide-25
SLIDE 25

“EMFI does not work on >100 MHz chips.”

  • Awesome do-it-yourself EMFI tool
  • Incorrect statement on EMFI attacks
  • Not everybody aware of EMFI research

“BADFET: Defeating Modern Secure Boot Using Second-Order Pulsed Electromagnetic Fault Injection” – Cui, Housley

slide-26
SLIDE 26

Attacks above 100 MHz already published in 2014…

Actually…

slide-27
SLIDE 27

More EMFI research above 100MHz 2019

slide-28
SLIDE 28

EM-FI DOES NOT WORK ON >100 MHZ TARGETS

slide-29
SLIDE 29

Inconsistent views result in ‘Myths and Misconceptions’

Research Fragmentation

  • Fault injection research is conducted in multiple communities:
  • Academia
  • Industry
  • Security community
  • Consolidation of knowledge does not always happens
  • Result: Research is being missed
slide-30
SLIDE 30

“Fault attacks are used to bypass SW checks”

Report / Slides

slide-31
SLIDE 31

Preset user space registers. Linux Kernel Privilege Escalation

“Fault attacks are used to bypass SW checks”

Control of kernel PC from user space!

“Don’t tell anyone…No checks involved!”

slide-32
SLIDE 32
  • RSA key weakening by flipping

bits in the modulus

  • Also performed as part of other

attacks:

  • E.g CLKSCREW

“Fault attacks are used to bypass SW checks”

slide-33
SLIDE 33
  • PlayStation Vita attack
  • Differential Fault Analysis Attack

(DFA) on cryptographic engines

  • Recovered keys from the target
  • 30 master keys
  • 238 out of 240 non-master keys

“Fault attacks are used to bypass SW checks”

Yifan Lu – “Attacking Hardware AES with DFA” – (PS Vita) Paper/Blog

slide-34
SLIDE 34

FAULT ATTACKS ARE USED TO BYPASS SW CHECKS

slide-35
SLIDE 35

“Fault attacks are not effective on multi-core chips.”

  • Multiple cores have an impact…but fault injection still possible.
  • Even when cores verify each other in lockstep
slide-36
SLIDE 36

FAULT ATTACKS DO NOT WORK ON MULTI-CORE CHIPS

slide-37
SLIDE 37

Use case #1: Rowhammer Use case #2: CLKSCREW

“Physical access is required to perform fault attacks.” These HW vulnerabilities can be remotely triggered by software

slide-38
SLIDE 38

Rowhammer: Kernel Privilege Escalation

Faults

FI technique

Injection “Electric Field” injection Activation Software Control Accessing DDR rows Glitch Exploit

HW Vulnerability

Target Goal Electric coupling between rows DDR data corruption

Faults

bit flips

Fault Model

Process Page Table Entry modification Physical memory R/W access

Exploit

Kernel Privilege escalation

Goal

Reference: Google Project Zero

slide-39
SLIDE 39

CLKSCREW: Key extraction

Faults

FI technique

Injection Clock +Voltage Activation Software Control

  • DVFS registers

Glitch Exploit

HW Vulnerability

Target Goal Flip Flop de-synchronization Data corruption

Faults

AES state: one byte modifications (in TEE TA memory)

Fault Model

AES DFA

Exploit

AES key extracted from TEE TA

Goal

Reference: Clkscrew paper

slide-40
SLIDE 40

PHYSICAL ACCESS REQUIRED FOR FI

slide-41
SLIDE 41

“Fault attacks are injection dependent.”

  • Literature often links injection technique to goal:
  • E.g. “Fault injection technique A is used for attack B”
  • No systematic comparison of faults available
  • Actually… specific fault models are applicable to multiple FI techniques
  • i.e. exploitation is independent from injection
slide-42
SLIDE 42

Exploitation is independent from injection!

  • Attack works if the faults fits the chosen fault model
  • Setup changes but the exploitation strategy stays the same

Faults Injection Modify clock and voltage Activation Software Glitch Exploit Target Goal

Independent

AES state: modifications

Fault Model

AES DFA

Exploit

AES key extracted from TEE TA

Goal CLKSCREW

Voltage Hardware Glitch

UNKNOWN

Activation Injection

slide-43
SLIDE 43

“FAULT ATTACKS ARE INJECTION DEPENDENT.”

slide-44
SLIDE 44

Lesson learned: always try first…

“Glitch resolution is key to success”

  • Shorter glitches definitely have advantages…
  • But may not always be needed!

Yifan Lu – “Attacking Hardware AES with DFA” – (PS Vita) Paper/Blog

slide-45
SLIDE 45

GLITCH RESOLUTION IS KEY TO SUCCESS

slide-46
SLIDE 46

“Synchronization with the target is required.”

  • Synchronizing with target clock allows for increased precision.
  • Often not possible.
  • Clock signal not reachable
  • Our research is usually performed without clock synchronization
  • Fast setup and short attack cycles increase attempts per second:
  • Speed overcomes target jitter
slide-47
SLIDE 47

SYNCHRONIZATION WITH THE TARGET IS REQUIRED

slide-48
SLIDE 48

“Successes rate determines attack feasibility”

  • Fault attacks typically have a success rate < 100%
  • Let’s assume two attacks, which one is more effective?
  • Attack A: 1% success rate, 10 attempts per minute
  • Attack B: 0,1% success rate, 1000 attempts per minute
  • Success rate only provides fault frequency
  • Feasibility better described by “average time for success”
slide-49
SLIDE 49

SUCCESS RATE DETERMINES ATTACK FEASIBILITY

slide-50
SLIDE 50

What do they have in common?

“Fault injection attacks do not scale.”

  • They don’t. Their results do.
  • Get assets out once and profit forever (e.g. code, keys, etc.).
slide-51
SLIDE 51

Assets compromised using Fault Injection

“Fault injection attacks do not scale.”

  • They don’t. Their results do.
  • Get assets out once and profit forever (e.g. code, keys, etc.).

Yifan Lu Team Xecuter Bernhard Froemel

slide-52
SLIDE 52

FAULT INJECTION ATTACKS DO NOT SCALE

slide-53
SLIDE 53

Wait a minute…

“Implementing countermeasures is easy.”

  • How do you harden products against fault injection attacks?
  • “Just add some random delays…”
  • “We have triple checks here. You CANNOT do it.”
  • “We HAVE brownout detectors and clock monitors. Solved.”
  • “There are NO CONDITIONALS to attack. It’

s SECURE!”

slide-54
SLIDE 54

Visualizing FI Countermeasures

Faults Injection Activation Hardware: (Prevent)

  • Enforce safe DVFS

settings Glitch Exploit Target Goal Hardware (Prevent):

  • Active/Passive

shields Hardware (Detect):

  • Brownout detectors
  • Optical sensors

Hardware (Detect):

  • ECC RAM

SW(Detect):

  • Redundant

checks/operations SW(Mitigate):

  • Random Delays
slide-55
SLIDE 55

Systematic approach is essential to say something useful…

Important

  • Software countermeasures:
  • Specific to exploitation
  • Depend on selected fault model
  • Do not prevent/detect injection
  • Hardware countermeasures:
  • CAN prevent injection
  • MAY be specific to injection technique
slide-56
SLIDE 56

LET’S EXACTLY DO THAT

slide-57
SLIDE 57

One Glitch, Multiple Faults…

slide-58
SLIDE 58

One Glitch, Multiple Faults

Fault Physical Circuit Micro-Architecture

Software “Hardware”

Logical gates, Memory Cells, Flip Flops

Execution

Control Flow, Data Flow

Instructions

Instruction Skipping

Fault Model

Data corruption

Root Cause

[2018]: Yuce, Schaumont, Witteman

slide-59
SLIDE 59

HARDENING SECURE BOOT

slide-60
SLIDE 60

Secure Boot: Skipping Signature Check

Fault Physical Circuit Micro-Architecture

Software “Hardware”

Logical gates, Memory Cells, Flip Flops

Execution

Control Flow, Data Flow

Instructions Instruction Skipping

Fault Model

Root Cause

Code Flow Attack Payload Exec

SW-based countermeasures

slide-61
SLIDE 61

BUT…

slide-62
SLIDE 62

Secure Boot: Instruction Corruption

Fault Physical Circuit Micro-Architecture

Software “Hardware”

Logical gates, Memory Cells, Flip Flops

Execution

Control Flow, Data Flow

Instructions

Fault Model

Instruction corruption

Fault Model

Root Cause

Attack Payload Exec

PC Control

slide-63
SLIDE 63

Secure Boot: OTP Transfer Attack

Fault Physical Circuit Micro-Architecture Subsystem*

Software “Hardware”

OTP , JTAG, CPUs,… Logical gates, Memory Cells, Flip Flops

Execution

Control Flow, Data Flow

Instructions

Fault Model

Bit flips in OTP transfer

Fault Model

Root Cause

Attack Payload Exec

Wrong values in shadow registers *Extension to [2018]: Yuce, Schaumont, Witteman

slide-64
SLIDE 64

To summarize…

  • Most SW countermeasures can be bypassed by:
  • Leveraging faults at a different system layer
  • Countermeasures based on attack-specific assumptions
  • Defenses CANNOT be implemented using software only
  • Fault injection hardened hardware is fundamental
slide-65
SLIDE 65

IMPLEMENTING COUNTERMEASURES IS EASY

slide-66
SLIDE 66

LET’S WRAP UP

slide-67
SLIDE 67

Did we REALLY debunk all these myths? “PLAUSIBLE DENIABILITY”, AT LEAST.

slide-68
SLIDE 68

Takeaways

  • Knowledge gaps between community, academia and industry.
  • Consolidation required to prevent incorrect conclusions.
  • A common understanding will give ground to new and powerful FI attacks.
  • We hope this presentation helps with exactly that.
  • Fault injection has reached the masses.
  • It is here to stay and will not go away.
slide-69
SLIDE 69

Thank you!

Niek Timmers niek@twentytwosecurity.com @tieknimmers Cristofaro Mune c.mune@pulse-sec.com @pulsoid

Feel free to contact us!