27
u www.iaik.tugraz.at S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application Software Stefan Mangard Graz University of Technology FDTC 2015, Saint-Malo

Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

u www.iaik.tugraz.at

S C I E N C E P A S S I O N T E C H N O L O G Y

Fault Attacks at the System Level

The Challenge of Securing Application Software

Stefan Mangard

Graz University of Technology

FDTC 2015, Saint-Malo

Page 2: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

The goal is to secure implementations of cryptographic algorithms

against fault attacks

The Classic Setting of Fault Attacks

Graz University of Technology2

Stefan Mangard

Crypto

Input

Faulted Output

Page 3: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

The Fault Challenge

Attack setups get more and more sophisticated

Multiple laser spots

Laser shots to flip bits in 45 nm

EM pulses, Glitches

Countermeasures

Physical methods (sensors, …)

Redundancy schemes

Stefan Mangard

Graz University of Technology3

Source: Fraunhofer AISEC

Page 4: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

The Classic Setting of System Security

Graz University of Technology4

Stefan Mangard

Network Connection

The goal is to secure systems against attacks via the network interface

Page 5: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

The System Security Challenge

Secure OS with efficient isolation of resources Peripherals

CPU

Caches

Memories

Secure software execution Control flow integrity (CFI)

Data confidentiality and integrity

Stefan Mangard

Graz University of Technology5

Page 6: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

?Stefan Mangard

Graz University of Technology6

Page 7: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

7

Page 8: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Are we ready for the Internet of Things?

Stefan Mangard

Graz University of Technology8

Page 9: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Stefan Mangard

Graz University of Technology9

Attack model

Read/change data by software

Read/change data by side-

channels

Attack target

Operating system

Applications

Crypto implementations

Attack model

Read/change data by software

Read/change data by side-

channels

Attack target

Operating system

Applications

Crypto implementations

Page 10: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

What about system security in the context of all kinds of

side-channel attacks?

Stefan Mangard

Graz University of Technology10

Page 11: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Is It a Problem?

In attacks on pay TV systems fault attacks were done already before the academic community started looking at faults

Examples of faults with fatal consequences

Skipping of instructions

Changes of program counter

Change of pointers

Graz University of Technology11

Stefan Mangard

Page 12: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Mixing the Settings

Graz University of Technology12

Stefan Mangard

System

Page 13: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Flipping Bits in Memory Without Accessing Them

Published byYoongu Kim, Ross Daly, Jeremie Kim, Chris Fallin, Ji-Hye Lee, Donghyuk Lee, Chris

Wilkerson, Konrad Lai, Onur Mutlu: Flipping bits in memory without accessing them: An

experimental study of DRAM disturbance errors. ISCA 2014: 361-372

Fundamental observation

Reading from one address in memory with high frequency leads to

bit flips in neighboring bits

Observed on 110 out of 129 DRAM modules from three major

manufacturersStefan Mangard

Graz University of Technology13

Page 14: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

DDR Memory

Activating a row upon a read access Row is selected, copied into the row buffer (red)

and refreshed

Generating high frequency accessesL1: Read from row A

Read from row B

Flush cache

Goto L1

Two important requirements Row A and B need to be in the same bank

Bypassing the cache

Stefan Mangard

Graz University of Technology14

HandigeHarry via Wikimedia Commons

Read

Page 15: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Double-Sided Hammering

Reading (i.e hammering) on both

neighbors of a row increases the

success probability

Published by

Mark Seaborn on the Google Project

Zero Blog

Stefan Mangard

Graz University of Technology15

HandigeHarry via Wikimedia Commons

Read

ReadVictim

Page 16: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

The Exploit

Stefan Mangard

Graz University of Technology16

Requirement “Unreliable” memory

Method/Knowledge to find physically neighboring rows

Method that allows to bypass the cache and to generate accesses at a high frequency

General exploitation strategy Find a physical memory location that can be faulted

with high probability

Make sure that the some interesting target is stored on this memory location

Do hammering to induce the fault

Page 17: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

The Attacks of Seaborn et al.

Linux kernel privilege escalation

Find a position in memory that can be faulted

Release target location and generate fragmented physical memory

Fill the physical memory with page table entries (PTE) by mapping

a file repeatedly

Do hammering

Check, if one of the PTE now points to another PTE

Change PTE to gain access to complete physical memory

Stefan Mangard

Graz University of Technology17

Page 18: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Doing the Attack in Javascript

Doing rowhammer in Javascript poses a large-scale threat to do “remote fault attacks”

Our main contributions

An eviction strategy that allows to bypass the cache in Javascript

Strategy to find physical locations that are close to do hammering

More informationDaniel Gruß, Clémentine Maurice, Stefan Mangard - "Rowhammer.js: A Remote Software-Induced Fault Attack in JavaScript“, arXiv.org:1507.06955

Stefan Mangard

Graz University of Technology18

Page 19: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Effectiveness of the Eviction Strategy

Stefan Mangard

Graz University of Technology19

Page 20: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Countermeasures?

no clflush?, ECC memory,

vs.

general concepts to secure software execution against faultsStefan Mangard

Graz University of Technology20

Page 21: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Protecting Software Execution Against Fault Attacks

Generic approach

Software execution means doing computations

Generic approaches like private circuits II, dedicated logic styles,

masking …

Tailored approach

Partition the problem (CFI, register/cache/

memory integrity, isolation, … )

Research on dedicated countermeasures

Stefan Mangard

Graz University of Technology21

Page 22: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Control-Flow Integrity

Any program can be represented as directed graph

Nodes are basic blocks

CFI means preventing Change of instructions

Change of instruction sequence

Any execution path that is not part of the graph

CFI is a central requirement for the implementation of software countermeasures

Stefan Mangard

Graz University of Technology22

Page 23: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Control-Flow Integrity

Stefan Mangard

Graz University of Technology23

Not a new research topic

Software security Publications ranging from iOS and android security to server security

Fault-tolerant computing Countless publications since the eighties

Approaches vary with respect to HW/SW partitioning

Fault detection capabilities

Overhead (Code size, execution speed, …)

Page 24: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

HW-Supported Control-Flow Integrity

Checksum update upon

the execution of each

instruction

Very efficient and effective

Challenge

Branches

Interrupts

Stefan Mangard

Graz University of Technology24

Instruction

Decoder

Instructions

Datapath

Checksum

Page 25: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Generalized Path Signatures

First published by Wilken et al. in the eighties

Basic idea

Instrument software in such a way that signatures “collide” at each node of the control flow graph for all incoming paths

Recent publication

Mario Werner, Erich Wenger, Stefan Mangard - "Protecting the Control Flow of Embedded Processors against Fault Attacks" (CARDIS 2015 - to appear)

Instrumentation using LLVM

Software overhead on an ARM Cortex M3 ranges from 2% to about 70%

Stefan Mangard

Graz University of Technology25

Page 26: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Summary

The “Internet of Things” creates countless opportunities for Users

Attackers

Many interesting research challenges to secure Cryptography

Systems

Many interactions with other research fields Software security

Fault tolerant computing

Stefan Mangard

Graz University of Technology26

Page 27: Fault Attacks at the System Level - fdtc.deib.polimi.it · u S C I E N C E P A S S I O N T E C H N O L O G Y Fault Attacks at the System Level The Challenge of Securing Application

www.iaik.tugraz.at

Secure Systems Group

http://www.iaik.tugraz.at/sesys

[email protected]

Stefan Mangard

Graz University of Technology27