The Promises and Pitfalls of Hardware-Assisted Security Alexandra - - PowerPoint PPT Presentation

the promises and pitfalls of hardware assisted security
SMART_READER_LITE
LIVE PREVIEW

The Promises and Pitfalls of Hardware-Assisted Security Alexandra - - PowerPoint PPT Presentation

The Promises and Pitfalls of Hardware-Assisted Security Alexandra Dmitrienko Julius-Maximilians-Universitt Wrzburg alexandra.dmitrienko@uni-wuerzburg.de SEPTEMBER 9 13, 2019 CROSSING Summer School on Sustainable Security & Privacy


slide-1
SLIDE 1

The Promises and Pitfalls of Hardware-Assisted Security

Alexandra Dmitrienko Julius-Maximilians-Universität Würzburg alexandra.dmitrienko@uni-wuerzburg.de

CROSSING Summer School on Sustainable Security & Privacy 2019 CROSSING Summer School on Sustainable Security & Privacy

CROSSING Summer School on Sustainable Security & Privacy

SEPTEMBER 9 – 13, 2019

slide-2
SLIDE 2

The Great Promise of Trusted Computing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

2

slide-3
SLIDE 3

Historical Overview: Deployed Systems

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cambridge CAP

1970 1980 1990 2000 2010

Reference monitor Protection rings VAX/VMS Java security architecture Hardware-assisted secure boot Trusted Platform Module (TPM) Late launch/TXT Computer security Mobile security Smart card security TPM 2.0 Intel SGX PUFs

3

slide-4
SLIDE 4

Historical Overview: Deployed Systems

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cambridge CAP

1970 1980 1990 2000 2010

Reference monitor Protection rings VAX/VMS Java security architecture Hardware-assisted secure boot Trusted Platform Module (TPM) Late launch/TXT Computer security Mobile security Smart card security Simple smart cards Java Card platform TPM 2.0 Intel SGX PUFs

3

slide-5
SLIDE 5

Historical Overview: Deployed Systems

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cambridge CAP

1970 1980 1990 2000 2010

Reference monitor Protection rings VAX/VMS Java security architecture Hardware-assisted secure boot Trusted Platform Module (TPM) Late launch/TXT Computer security Mobile security Smart card security Mobile hardware security architectures TI M-Shield ARM TrustZone Mobile OS security architectures Mobile Trusted Module (MTM) Simple smart cards Java Card platform TPM 2.0 Intel SGX GP TEE standards On-board Credentials PUFs

3

slide-6
SLIDE 6

Trusted Computing under Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

4

slide-7
SLIDE 7

Trusted Computing under Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

4

slide-8
SLIDE 8

Trusted Computing under Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

4

slide-9
SLIDE 9

Goal: Self-Contained Security

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory

  • Isolated

execution

  • Platform

integrity

  • Secure storage
  • Device

identification

  • Device

authentication capabilities

5

slide-10
SLIDE 10

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Intel SGX

6

slide-11
SLIDE 11

Intel Software Guard Extensions (SGX)

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory

EPC

EPC: Enclave Page Cache (Dedicated Physical Memory)

7

slide-12
SLIDE 12

Intel Software Guard Extensions (SGX)

  • OS creates and manages enclaves, allocates memory from Enclave Page Cache (EPC)
  • OS maps physical to virtual memory, as well as loads data and code into enclave
  • Trust assumptions: All software components untrusted

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory Enclave 4 Enclave 3 Enclave 2 Enclave 1

EPC

EPC: Enclave Page Cache (Dedicated Physical Memory)

7

slide-13
SLIDE 13

Intel Software Guard Extensions (SGX)

  • OS creates and manages enclaves, allocates memory from Enclave Page Cache (EPC)
  • OS maps physical to virtual memory, as well as loads data and code into enclave
  • Trust assumptions: All software components untrusted

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory Enclave 4 Enclave 3 Enclave 2 Enclave 1

EPC

EPC: Enclave Page Cache (Dedicated Physical Memory)

7

slide-14
SLIDE 14

Intel Software Guard Extensions (SGX)

  • Asynchrones Enclave Exit (AEX): Enclaves interruptable, CPU

saves/deletes context in CPU registers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Enclave 4 Enclave 3 Enclave 2 Enclave 1 Peripherals CPU I/O Memory

EPC

EPC: Enclave Page Cache (Dedicated Physical Memory)

8

slide-15
SLIDE 15

Intel Software Guard Extensions (SGX)

  • Asynchrones Enclave Exit (AEX): Enclaves interruptable, CPU

saves/deletes context in CPU registers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Enclave 4 Enclave 3 Enclave 2 Enclave 1 Peripherals CPU I/O Memory

EPC

EPC: Enclave Page Cache (Dedicated Physical Memory)

8

slide-16
SLIDE 16

Intel Software Guard Extensions (SGX)

  • Asynchrones Enclave Exit (AEX): Enclaves interruptable, CPU

saves/deletes context in CPU registers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Enclave 4 Enclave 3 Enclave 2 Enclave 1

Code-reuse Attacks

Peripherals CPU I/O Memory

EPC

EPC: Enclave Page Cache (Dedicated Physical Memory)

8

slide-17
SLIDE 17

Intel Software Guard Extensions (SGX)

  • Asynchrones Enclave Exit (AEX): Enclaves interruptable, CPU

saves/deletes context in CPU registers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Enclave 4 Enclave 3 Enclave 2 Enclave 1

Code-reuse Attacks

Peripherals CPU I/O Memory

EPC Side-Channel Attacks (not in SGX Adv. Model)

EPC: Enclave Page Cache (Dedicated Physical Memory)

8

slide-18
SLIDE 18

Intel Software Guard Extensions (SGX)

  • Asynchrones Enclave Exit (AEX): Enclaves interruptable, CPU

saves/deletes context in CPU registers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Enclave 4 Enclave 3 Enclave 2 Enclave 1

Code-reuse Attacks

Peripherals CPU I/O Memory

EPC Side-Channel Attacks (not in SGX Adv. Model)

EPC: Enclave Page Cache (Dedicated Physical Memory)

Speculative execution

8

slide-19
SLIDE 19

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Code-reuse on SGX

9

slide-20
SLIDE 20

Code-reuse Attacks: Big Picture

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

10

slide-21
SLIDE 21

Code-reuse Attacks: Big Picture

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

10

slide-22
SLIDE 22

Code-reuse Attacks: Big Picture

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

n mm

  • r

ien ted Pro g ra ing r u t Re 10

slide-23
SLIDE 23

Hacking in Darkness: ROP against Secure Enclaves

  • Memory corruption attack against Intel SGX (Dark-ROP)
  • Combines ROP techniques with oracles that inform about internal

state of a victim enclave

  • Requires kernel privileges
  • Relies on running the target enclave multiple times and crashes to

leak information

  • Demonstrates how the security of SGX can be disarmed
  • Exfiltration of all memory contents from the enclave (code and data)
  • Bypassing the SGX attestation

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

[Lee et al., USENIX Security 2017]

11

slide-24
SLIDE 24

SGX-Shield: Randomization for SGX Enclaves

  • Address Space Layout Randomization (ASLR) for SGX enclaves
  • Effective against ROP, since it relies on addresses of code snippets

(gadgets)

  • Limited entropy due to limited memory space
  • Still effective against Dark-ROP
  • Since an enclave will be re-randomized after the crash

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

[Seo et al., NDSS 2017]

12

slide-25
SLIDE 25

SGX SDK and The Guard’s Dilemma

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Source SGX SDK App Enclave Compiler [Biondo et al., USENIX Security 2018]

13

slide-26
SLIDE 26

SGX SDK and The Guard’s Dilemma

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Source SGX SDK App Enclave Function 0 Function 1 Function 2 Function 3 Compiler App Code [Biondo et al., USENIX Security 2018]

13

slide-27
SLIDE 27

SGX SDK and The Guard’s Dilemma

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Source SGX SDK App Enclave Function 0 Function 1 Function 2 Function 3 Compiler App Code Untrusted Runtime System (uRTS) Trusted Runtime System (tRTS) [Biondo et al., USENIX Security 2018]

13

slide-28
SLIDE 28

SGX SDK and The Guard’s Dilemma

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Source SGX SDK App Enclave Function 0 Function 1 Function 2 Function 3 Compiler App Code Untrusted Runtime System (uRTS) Trusted Runtime System (tRTS)

App-to-Enclave function call (ECALL)

[Biondo et al., USENIX Security 2018]

13

slide-29
SLIDE 29

SGX SDK and The Guard’s Dilemma

  • tRTS is not randomized by SGX-Shield
  • It cannot be randomized due to architectural specifics
  • E.g., enclave functions are invoked using fixed pre-defined entry points
  • Contributions by Biondo et al.:
  • show that tRTS has enough gadgets to mount ROP
  • develop new techniques that do not require enclave crashes
  • new techniques do not require kernel privileges from an attacker

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

[Biondo et al., USENIX Security 2018]

14

slide-30
SLIDE 30

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Leaky SGX

15

slide-31
SLIDE 31

Side-Channel Attack: General Principle

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

System Entity 2 Entity 1

16

slide-32
SLIDE 32

Side-Channel Attack: General Principle

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

System Entity 2 Entity 1 Victim Attacker

16

slide-33
SLIDE 33

Side-Channel Attack: General Principle

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

System Entity 2 Entity 1 Victim Attacker Observe

16

slide-34
SLIDE 34

Side-Channel Attack: General Principle

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

System Entity 2 Entity 1 Victim Attacker Observe

16

slide-35
SLIDE 35

Side-Channel Attack: General Principle

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

System Entity 2 Entity 1 Victim Attacker

16

slide-36
SLIDE 36

Side-Channel Attack: General Principle

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

System Entity 2 Entity 1 Victim Attacker Utilize Observe

16

slide-37
SLIDE 37

Page Fault Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM

Granularity: page 4K, good for big data structures

EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault

17

slide-38
SLIDE 38

Page Fault Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT

Granularity: page 4K, good for big data structures

EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault

17

slide-39
SLIDE 39

Page Fault Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT PF Handler IRQ

Granularity: page 4K, good for big data structures

EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault

17

slide-40
SLIDE 40

Page Fault Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT PF Handler IRQ

Granularity: page 4K, good for big data structures

[Xu et al., IEEE S&P’15]

Original Recovered

EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault

17

slide-41
SLIDE 41

Page Fault Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT PF Handler IRQ

Granularity: page 4K, good for big data structures

[Xu et al., IEEE S&P’15]

Original Recovered Single-trace RSA key recovery from RSA key generation

procedure of Intel SGX SSL via controlled-channel attack on the binary Euclidean algorithm (BEA) [Weiser et al., AsiaCCS’18]

EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault

17

slide-42
SLIDE 42

Cache Attacks on SGX: Hack in The Box

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU EPC RAM Cache

EPC: Enclave Page Cache

18

slide-43
SLIDE 43

Cache Attacks on SGX: Hack in The Box

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU EPC RAM Cache

EPC: Enclave Page Cache

18

slide-44
SLIDE 44

Cache Attacks on SGX: Hack in The Box

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 1 App 2 App 3 CPU EPC RAM Cache

  • bserve

uses e.g., by Prime & Probe

EPC: Enclave Page Cache

18

slide-45
SLIDE 45

Prime + Probe

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5

t0 t1 t2

for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)

Prime Victim Probe

Cache Code cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 2

19

slide-46
SLIDE 46

Prime + Probe

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5

t0 t1 t2

for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)

Prime Victim Probe

Cache Code cache line 2

19

slide-47
SLIDE 47

Prime + Probe

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5

t0 t1 t2

for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)

Prime Victim Probe

Cache Code cache line 2

19

slide-48
SLIDE 48

Prime + Probe

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5

t0 t1 t2

for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)

Prime Victim Probe

Cache Code cache line 2

19

slide-49
SLIDE 49

Prime + Probe

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5

t0 t1 t2

for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)

Prime Victim Probe

Cache Code

cache line 2 was used by victim

19

slide-50
SLIDE 50

How to measure the time difference?

  • #1: Time Stamp Counter (TSC)
  • Not precise enough to reliably distinguish the difference between L1 vs. L2 hits
  • Reading the time stamp counter by itself suffers from noise
  • #2: Counting thread:
  • a thread that only performs a loop that constantly increments a value (basically a

timer)

  • Slows down the victim, can be detected
  • #3: Performance Monitoring Counter (PMC):
  • can be configured to count different events: executed cycles, cache hits or cache

misses for the different caches, mis-predicted branches, etc.

  • Anti Side-channel Interference (ASCI) feature:
  • Can be configured to disable thread-specific performance monitoring of enclaves

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

20

slide-51
SLIDE 51

Side-Channel Grand Challenge: Noise

  • Operating System and any other software running on the platform

generate noise

  • Even attacker’s own code pollutes the cache

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cl 0 cl 0 cl 1 cl 2

Prime tk tl tn

cl 0 cl 1 cl 2 cl 0 cl 1 cl 2

Other Process

cl 0 cl 1 cl 2

Victim

cl 2

tm

cl 0 cl 1 cl 2

Probe

21

slide-52
SLIDE 52

Side-Channel Grand Challenge: Noise

  • Operating System and any other software running on the platform

generate noise

  • Even attacker’s own code pollutes the cache

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cl 0 cl 0 cl 1 cl 2

Prime tk tl tn

cl 0 cl 1 cl 2

Other Process

cl 0 cl 1 cl 2

Victim

cl 2

tm

cl 0 cl 1 cl 2

Probe

21

slide-53
SLIDE 53

Side-Channel Grand Challenge: Noise

  • Operating System and any other software running on the platform

generate noise

  • Even attacker’s own code pollutes the cache

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cl 0 cl 0 cl 1 cl 2

Prime tk tl tn

cl 0 cl 1 cl 2

Other Process

cl 0 cl 1 cl 2

Victim

cl 2

tm

cl 0 cl 1 cl 2

Probe

cl 0

21

slide-54
SLIDE 54

Side-Channel Grand Challenge: Noise

  • Operating System and any other software running on the platform

generate noise

  • Even attacker’s own code pollutes the cache

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cl 0 cl 0 cl 1 cl 2

Prime tk tl tn

cl 0 cl 1 cl 2

Other Process

cl 0 cl 1 cl 2

Victim tm

cl 0 cl 1 cl 2

Probe

cl 0 cl 2

21

slide-55
SLIDE 55

Side-Channel Grand Challenge: Noise

  • Operating System and any other software running on the platform

generate noise

  • Even attacker’s own code pollutes the cache

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cl 0 cl 0 cl 1 cl 2

Prime tk tl tn

cl 0 cl 1 cl 2

Other Process

cl 0 cl 1 cl 2

Victim tm

cl 0 cl 1 cl 2

Probe

21

slide-56
SLIDE 56

Side-Channel Grand Challenge: Noise

  • Operating System and any other software running on the platform

generate noise

  • Even attacker’s own code pollutes the cache

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

cl 0 cl 0 cl 1 cl 2

Prime tk tl tn

cl 0 cl 1 cl 2

Other Process

cl 0 cl 1 cl 2

Victim tm

cl 0 cl 1 cl 2

Probe cl0 and cl2 were used… … by the victim?

21

slide-57
SLIDE 57

Cache Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core

Level 2 Level 1 Branch Pred. SMT SMT

OS EPC: Enclave Page Cache SMT: Simultaneous Multithreading

22

slide-58
SLIDE 58

Cache Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core

Level 2 Level 1 Branch Pred. SMT SMT

OS EPC: Enclave Page Cache SMT: Simultaneous Multithreading

22

slide-59
SLIDE 59

Cache Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core

Level 2 Level 1 Branch Pred. SMT SMT

OS

Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952]

EPC: Enclave Page Cache SMT: Simultaneous Multithreading

22

slide-60
SLIDE 60

Cache Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core

Level 2 Level 1 Branch Pred. SMT SMT

OS

Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952] Use standard prime + probe to detect key dependent memory accesses, interrupt enclave [Moghimi et al., arXiv:1703.06986] Use prime + probe to extract key from synchronized victim enclave [Götzfried et al., EuroSec’17] Prime + probe attack from malicious OS extracting genome data [Brasser et al., WOOT’17]

EPC: Enclave Page Cache SMT: Simultaneous Multithreading

22

slide-61
SLIDE 61

Cache Attacks on SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core

Level 2 Level 1 Branch Pred. SMT SMT

OS

Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952] Use standard prime + probe to detect key dependent memory accesses, interrupt enclave [Moghimi et al., arXiv:1703.06986] Use prime + probe to extract key from synchronized victim enclave [Götzfried et al., EuroSec’17] A malicious enclave prime + probes another enclave, evading detection [Schwarz et al., DIMVA’17 & arXiv:1702.08719] Prime + probe attack from malicious OS extracting genome data [Brasser et al., WOOT’17]

EPC: Enclave Page Cache SMT: Simultaneous Multithreading

22

slide-62
SLIDE 62

SGX Side-Channel Attacks Comparison

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Attack Type Observed Cache Interrupting Victim Time Measurement Attacker Code Attacked Victim Lee et al. Branch Shadowing BTB / LBR Yes Execution Timing OS RSA & SVM classifier Moghimi et al. Prime + Probe L1(D) Yes TCS OS AES Götzfried et al. Prime + Probe L1(D) No PCM OS AES Our Attack Prime + Probe L1(D) No PCM OS RSA & Genome Sequencing Schwarz et al. Prime + Probe L3 No Counting Thread Enclave AES PCM: Performance Counter Monitor BTB: Branch Target Buffer LBR: Last Branch Record TSC: Time Stamp Counter

23

slide-63
SLIDE 63

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process m+1 SMT SMT L1 Core 0 Core n PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

[Brasser et al., WOOT’17]

24

slide-64
SLIDE 64

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process m+1 SMT SMT L1 Core 0 Core n PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

[Brasser et al., WOOT’17]

24

slide-65
SLIDE 65

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 Core 0 Core n PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

[Brasser et al., WOOT’17]

24

slide-66
SLIDE 66

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 Core 0 Core n PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

Uninterrupted execution

  • Attacker assigns victim and attacker code to the

same core, all other tasks to others

  • Attacker assigns victim and attacker code to

different SMT threads

  • Monitors only one cache set per execution to

increase measurement resolution

[Brasser et al., WOOT’17]

24

slide-67
SLIDE 67

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler Handler Handler PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

[Brasser et al., WOOT’17]

24

slide-68
SLIDE 68

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

[Brasser et al., WOOT’17]

24

slide-69
SLIDE 69

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

Reducing noise Use kernel sysfs interface to assign interrupts to other cores

  • Timer interrupt (per thread) cannot be reassigned
  • Lowered timer frequency to 100Hz (i.e., every 10ms)

[Brasser et al., WOOT’17]

24

slide-70
SLIDE 70

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM

Probe

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

[Brasser et al., WOOT’17]

24

slide-71
SLIDE 71

Our Attack

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM

Probe

PCM: Performance Counter Monitor | SMT: Simultaneous Multithreading | APIC: Advanced Programmable Interrupt Controller

Prime+Probe attack using L1 data cache

  • Eviction detection using Performance Counter

Monitor (L1D_REPLACEMENT)

  • Anti Side-Channel Interference (ASCI) not effective,

monitoring cache events of attacker possible

[Brasser et al., WOOT’17]

24

slide-72
SLIDE 72

Our Attack Use-Cases

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

  • Attacking open source k-mer analysis tool

PRIMEX [Lexa et al., Bioinformatics 2003]

  • Extracting genome sequences

[arXiv:1702.07521] [Brasser et al., WOOT 2017]

  • Attacking RSA implementation from the

Intel IIP crypto library in the Intel SGX SDK

  • Extracting 2048-bit RSA decryption key

25

slide-73
SLIDE 73

Extracting RSA decryption key

26

slide-74
SLIDE 74

RSA Key Exfiltration: Victim Enclave

  • RSA Decryption: m = cd (mod N)

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

27

slide-75
SLIDE 75

RSA Key Exfiltration: Victim Enclave

  • RSA Decryption: m = cd (mod N)

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

27

slide-76
SLIDE 76

RSA Key Exfiltration: Victim Enclave

  • RSA Decryption: m = cd (mod N)

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Secret-dependent memory access!

27

slide-77
SLIDE 77

Fixed-size Sliding Window Exponentiation

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

0110 1111 0001 0011

Multiplier 1

Set 13

Multiplier 2 Multiplier 3 Multiplier 15

… Set 14 Set 15 Set 16 Set 17 Set 18 Set 41 Set 42 …

Multiplier Table g L1 Cache

1011

Exponent e = (ej, ej-1, …, e0)

ej ej-1 ej-2 ej-3 e0

28

slide-78
SLIDE 78

Fixed-size Sliding Window Exponentiation

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

0110 1111 0001 0011

Multiplier 1

Set 13

Multiplier 2 Multiplier 3 Multiplier 15

… Set 14 Set 15 Set 16 Set 17 Set 18 Set 41 Set 42 …

Multiplier Table g L1 Cache

1011

Exponent e = (ej, ej-1, …, e0)

ej ej-1 ej-2 ej-3 e0

28

slide-79
SLIDE 79

Fixed-size Sliding Window Exponentiation

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

0110 1111 0001 0011

Multiplier 1

Set 13

Multiplier 2 Multiplier 3 Multiplier 15

… Set 14 Set 15 Set 16 Set 17 Set 18 Set 41 Set 42 …

Multiplier Table g L1 Cache

1011

Exponent e = (ej, ej-1, …, e0)

ej ej-1 ej-2 ej-3 e0

28

slide-80
SLIDE 80

Fixed-size Sliding Window Exponentiation

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

0110 1111 0001 0011

Multiplier 1

Set 13

Multiplier 2 Multiplier 3 Multiplier 15

… Set 14 Set 15 Set 16 Set 17 Set 18 Set 41 Set 42 …

Multiplier Table g L1 Cache

1011

Exponent e = (ej, ej-1, …, e0)

ej ej-1 ej-2 ej-3 e0

28

slide-81
SLIDE 81

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-82
SLIDE 82

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-83
SLIDE 83

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-84
SLIDE 84

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-85
SLIDE 85

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-86
SLIDE 86

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-87
SLIDE 87

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-88
SLIDE 88

Attack Result

  • 2048-bit Chinese Remainder Theorem RSA key
  • Only 300 decryptions to leak 70% of key bits
  • Enough to recover key [Heninger et. al., CRYPTO’09]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Time

Each colored dot represents a multiplier access candidate, 15 monitoring rounds

29

slide-89
SLIDE 89

Genome Sequencing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Genome Analysis Enclave (e.g. PRIMEX)

31

slide-90
SLIDE 90

Genome Sequencing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Genome Analysis Enclave (e.g. PRIMEX) TTGACCCACTGAATCACGTCTG…

Encrypted Genome Sequence

31

slide-91
SLIDE 91

Genome Sequencing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Pre-processing

  • Split input into

sub-sequences (k-mer)

  • Store k-mer

positions in hash- table

Analysis

  • Statistical

analysis, e.g., to identify correlation in the data

Genome Analysis Enclave (e.g. PRIMEX) TTGACCCACTGAATCACGTCTG…

Encrypted Genome Sequence

31

slide-92
SLIDE 92

Genome Sequencing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Pre-processing

  • Split input into

sub-sequences (k-mer)

  • Store k-mer

positions in hash- table

Analysis

  • Statistical

analysis, e.g., to identify correlation in the data

Genome Analysis Enclave (e.g. PRIMEX)

ATCGATCGATCG…

Attacker’s goal: Identify k-mer sequences in the input string, allowing the identification of individuals

TTGACCCACTGAATCACGTCTG…

Encrypted Genome Sequence

31

slide-93
SLIDE 93

Some Basics on Human Genomes

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

TTGACCCACTGAATCACGTCTGACCGCGCGTACGCGG TCACTTGCGGTGCCGTTTTCTTTGTTACCGACGACCG ACCAGCGACAGCCACCGCGCGCTCACTGCCACCAAAA GAGTCATATCGATCGATCGATCGATCGATCGATCGAT CGATCGATCGATCGATCGATCGATCGATCGATCATCA CAGCCGACCAGTTTCTGGAACGTTCCCGATACTGGAA CGGTCCTAATGCAGTATCCCACCCTCCTTCCATCGAC GCCAGTCGAATCACGCCGCCAGCCACCGTCCGCCAGC CGGCCAGAATACCGATGACTCGGCGGTCTCGTGTCGG TGCCGGCCTCGCAGCCATTGTACTGGCCCTGGCCGCA GTGTCGGCTGCCGCTCCGATTGCCGGGGCGCAGTCCG CCGGCAGCGGTGCGGTCTCAGTCACCATCGGCGACGT GGACGTCTCGCCTGCGAACCCAACCACGGGCACGCAG GTGTTGATCACCCCGTCGATCAACAACTCCGGATCGG CAAGCGGGTCCGCGCGCGTCAACGAGGTCACGCTGCG CGGCGACGGTCTCCTCGCAACGGAAGACAGCCTGGGG

32

slide-94
SLIDE 94

Some Basics on Human Genomes

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

  • Nucleobases
  • Adenine (A)
  • Cytosine (C)
  • Guanine (G)
  • Thymine (T)
  • Microsatellite
  • Forensic analysis
  • Genetic fingerprinting
  • Kinship analysis

TTGACCCACTGAATCACGTCTGACCGCGCGTACGCGG TCACTTGCGGTGCCGTTTTCTTTGTTACCGACGACCG ACCAGCGACAGCCACCGCGCGCTCACTGCCACCAAAA GAGTCATATCGATCGATCGATCGATCGATCGATCGAT CGATCGATCGATCGATCGATCGATCGATCGATCATCA CAGCCGACCAGTTTCTGGAACGTTCCCGATACTGGAA CGGTCCTAATGCAGTATCCCACCCTCCTTCCATCGAC GCCAGTCGAATCACGCCGCCAGCCACCGTCCGCCAGC CGGCCAGAATACCGATGACTCGGCGGTCTCGTGTCGG TGCCGGCCTCGCAGCCATTGTACTGGCCCTGGCCGCA GTGTCGGCTGCCGCTCCGATTGCCGGGGCGCAGTCCG CCGGCAGCGGTGCGGTCTCAGTCACCATCGGCGACGT GGACGTCTCGCCTGCGAACCCAACCACGGGCACGCAG GTGTTGATCACCCCGTCGATCAACAACTCCGGATCGG CAAGCGGGTCCGCGCGCGTCAACGAGGTCACGCTGCG CGGCGACGGTCTCCTCGCAACGGAAGACAGCCTGGGG

32

slide-95
SLIDE 95

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table Indexer A G C A G C A T C A G G T A C …

33

slide-96
SLIDE 96

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table Indexer A G C A G C A T C A G G T A C …

33

slide-97
SLIDE 97

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

1

Indexer A G C A G C A T C A G G T A C …

33

slide-98
SLIDE 98

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

1 2

Indexer A G C A G C A T C A G G T A C …

33

slide-99
SLIDE 99

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

3 1 2

Indexer A G C A G C A T C A G G T A C …

33

slide-100
SLIDE 100

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

3 1 2

Indexer

  • Hash table access pattern
  • Hash table entry 8 bytes
  • Cache line size 64 bytes
  • Collisions
  • Genome unstructured
  • Microsatellites structured

A G C A G C A T C A G G T A C …

33

slide-101
SLIDE 101

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

3 1 2

Indexer

  • Hash table access pattern
  • Hash table entry 8 bytes
  • Cache line size 64 bytes
  • Collisions
  • Genome unstructured
  • Microsatellites structured

A G C A G C A T C A G G T A C …

33

slide-102
SLIDE 102

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

3 1 2

Indexer

  • Hash table access pattern
  • Hash table entry 8 bytes
  • Cache line size 64 bytes
  • Collisions
  • Genome unstructured
  • Microsatellites structured

A G C A G C A T C A G G T A C …

33

slide-103
SLIDE 103

Genome Pre-Processing

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

… Hash Table

3 1 2

Indexer

  • Hash table access pattern
  • Hash table entry 8 bytes
  • Cache line size 64 bytes
  • Collisions
  • Genome unstructured
  • Microsatellites structured

A G C A G C A T C A G G T A C …

TTGACCCACTGAATCACGTCTGACCGCGCGTACGCGGTCACTTGC GGTGCCGTTTTCTTTGTTACCGACGACCGACCAGCGACAGCCACC GCGCGCTCACTGCCACCAAAAGAGTCATATCGATCGATCGATCGA TCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGAT CATCACAGCCGACCAGTTTCTGGAACGTTCCCGATACTGGAACGG TCCTAATGCAGTATCCCACCCTCCTTCCATCGACGCCAGTCGAAT CACGCCGCCAGCCACCGTCCGCCAGCCGGCCAGAATACCGATGAC TCGGCGGTCTCGTGTCGGTGCCGGCCTCGCAGCCATTGTACTGGC CCTGGCCGCAGTGTCGGCTGCCGCTCCGATTGCCGGGGCGCAGTC CGCCGGCAGCGGTGCGGTCTCAGTCACCATCGGCGACGTGGACGT CTCGCCTGCGAACCCAACCACGGGCACGCAGGTGTTGATCACCCC

33

slide-104
SLIDE 104

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0

34

slide-105
SLIDE 105

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG ATCG cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0

34

slide-106
SLIDE 106

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG ATCG TCGA cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0

34

slide-107
SLIDE 107

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG ATCG TCGA CGAT cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0

34

slide-108
SLIDE 108

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG ATCG TCGA CGAT GATC cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0

34

slide-109
SLIDE 109

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG ATCG TCGA CGAT GATC ATCG cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0

34

slide-110
SLIDE 110

Microsatellites and Processed k-mers

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

ATCGATCGATCGATCGATCGATCGATCGATCG ATCG TCGA CGAT GATC ATCG cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0 The microsatellite will activate cache lines 2, 4, 5 and 0 repeatedly

34

slide-111
SLIDE 111

Genome Sequencing Attack Results

  • Monitor cache lines associated to satellite
  • High activity in cache lines reveal occurrence of satellite in input

string

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Execution Time A D B C

35

slide-112
SLIDE 112

Genome Sequencing Attack Results

  • Monitor cache lines associated to satellite
  • High activity in cache lines reveal occurrence of satellite in input

string

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Execution Time Activity in all related cache lines A D B C

35

slide-113
SLIDE 113

Speculative Execution Attacks

36

slide-114
SLIDE 114

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

CPU Cache

37

slide-115
SLIDE 115

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

CPU Cache

37

slide-116
SLIDE 116

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

CPU Cache

37

slide-117
SLIDE 117

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

CPU Cache

37

slide-118
SLIDE 118

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

Isolation CPU Cache

37

slide-119
SLIDE 119

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

Isolation CPU Speculative Execution Cache

37

slide-120
SLIDE 120

Speculative Execution Bug

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Malicious User

Victim

Isolation CPU Speculative Execution Cache

37

slide-121
SLIDE 121

Meltdown

  • Exploits speculative execution bug
  • attacker can read arbitrary physical memory (including

kernel memory) from an unprivileged user process

  • this can be used, e.g., to break kernel ASLR

from unprivileged process

  • or, to extract secrets from Intel SGX enclaves!

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

38

slide-122
SLIDE 122

Foreshadow: Meltdown against SGX

  • Foreshadow [Van Bulck, USENIX Security 2018]
  • Extract long-term secrets from Intel

Launching and Quoting Enclaves

  • Speculative access only possible

for data in L1 cache

  • Implications
  • Attacker can bypass vetting of enclaves by

Intel

  • Attacker can forge local and remote

attestations sent to other enclaves and to remote parties

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

OS Enclave

CPU Cache

39

slide-123
SLIDE 123

Foreshadow: Meltdown against SGX

  • Foreshadow [Van Bulck, USENIX Security 2018]
  • Extract long-term secrets from Intel

Launching and Quoting Enclaves

  • Speculative access only possible

for data in L1 cache

  • Implications
  • Attacker can bypass vetting of enclaves by

Intel

  • Attacker can forge local and remote

attestations sent to other enclaves and to remote parties

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

OS Enclave

CPU Cache

39

slide-124
SLIDE 124

Foreshadow: Meltdown against SGX

  • Foreshadow [Van Bulck, USENIX Security 2018]
  • Extract long-term secrets from Intel

Launching and Quoting Enclaves

  • Speculative access only possible

for data in L1 cache

  • Implications
  • Attacker can bypass vetting of enclaves by

Intel

  • Attacker can forge local and remote

attestations sent to other enclaves and to remote parties

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

OS Enclave

CPU Cache

39

slide-125
SLIDE 125

Foreshadow: Meltdown against SGX

  • Foreshadow [Van Bulck, USENIX Security 2018]
  • Extract long-term secrets from Intel

Launching and Quoting Enclaves

  • Speculative access only possible

for data in L1 cache

  • Implications
  • Attacker can bypass vetting of enclaves by

Intel

  • Attacker can forge local and remote

attestations sent to other enclaves and to remote parties

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

OS Enclave

CPU Cache

39

slide-126
SLIDE 126

Foreshadow: Meltdown against SGX

  • Foreshadow [Van Bulck, USENIX Security 2018]
  • Extract long-term secrets from Intel

Launching and Quoting Enclaves

  • Speculative access only possible

for data in L1 cache

  • Implications
  • Attacker can bypass vetting of enclaves by

Intel

  • Attacker can forge local and remote

attestations sent to other enclaves and to remote parties

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

OS Enclave

CPU Speculative Execution Cache

39

slide-127
SLIDE 127

Foreshadow: Meltdown against SGX

  • Foreshadow [Van Bulck, USENIX Security 2018]
  • Extract long-term secrets from Intel

Launching and Quoting Enclaves

  • Speculative access only possible

for data in L1 cache

  • Implications
  • Attacker can bypass vetting of enclaves by

Intel

  • Attacker can forge local and remote

attestations sent to other enclaves and to remote parties

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

OS Enclave

CPU Speculative Execution Cache

39

slide-128
SLIDE 128

How to Get Enclave Data into L1 Cache?

  • Run enclave and interrupt when target data was used
  • The enclave’s usage of the target data brings it into the cache
  • Use SGX paging mechanism
  • OS can swap in/out pages of enclaves
  • When an enclave page is swapped in, its content is loaded into L1 cache
  • Malicious OS can run attack without even running the enclave

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

40

slide-129
SLIDE 129

Defenses Against Foreshadow

  • Flush L1 cache on enclave exit
  • Provided via microcode update
  • Only effective without hyperthreading
  • Include hyperthreading configuration in attestation report
  • “[…] the Intel SGX attestation will indicate whether hyperthreading has been

enabled by the BIOS.” [Intel*]

  • Renew SGX keys
  • “The microcode update changes the Security Version Number (SVN)

associated with the Intel SGX implementation and provides enclaves on the platform with new sealing and attestation keys.” [Intel*]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

41

slide-130
SLIDE 130

Defenses Against Foreshadow

  • Flush L1 cache on enclave exit
  • Provided via microcode update
  • Only effective without hyperthreading
  • Include hyperthreading configuration in attestation report
  • “[…] the Intel SGX attestation will indicate whether hyperthreading has been

enabled by the BIOS.” [Intel*]

  • Renew SGX keys
  • “The microcode update changes the Security Version Number (SVN)

associated with the Intel SGX implementation and provides enclaves on the platform with new sealing and attestation keys.” [Intel*]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

* https://software.intel.com/security-software-guidance/software-guidance/l1-terminal-fault

41

slide-131
SLIDE 131

Alternative Solutions?

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

42

slide-132
SLIDE 132

Alternative Solutions?

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Buy Chinese Quality Chips, not cheap American copies!

42

slide-133
SLIDE 133

Side-Channel Defenses Using T TSX

43

slide-134
SLIDE 134

Intel TSX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX

44

slide-135
SLIDE 135

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX

44

slide-136
SLIDE 136

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX

44

slide-137
SLIDE 137

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX

44

slide-138
SLIDE 138

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX

44

slide-139
SLIDE 139

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX

44

slide-140
SLIDE 140

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX abort abort

44

slide-141
SLIDE 141

Intel TSX

  • Intel implementation of Hardware Transactional Memory (HTM)
  • Designed for high-performance concurrency
  • Allows synchronous memory transactions
  • TSX is not available on all SGX-enable processors

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Cache Core 0 Core n Thread 1 Thread 2 RAM TSX abort abort

44

slide-142
SLIDE 142

SGX Specific Side-Channel Defenses Using TSX

Detecting enclave’s interruption

  • Frequent interrupts evidence for side-channel attack
  • T-SGX: Uses TSX feature to detect enclave interrupt [Shih et al., NDSS’17]
  • Déjà Vu : Uses TSX to detect enclave slowdown [Chen et al., AsiaCCS’17]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker Cache Core 0 Core n TSX

45

slide-143
SLIDE 143

SGX Specific Side-Channel Defenses Using TSX

Detecting enclave’s interruption

  • Frequent interrupts evidence for side-channel attack
  • T-SGX: Uses TSX feature to detect enclave interrupt [Shih et al., NDSS’17]
  • Déjà Vu : Uses TSX to detect enclave slowdown [Chen et al., AsiaCCS’17]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker Cache Core 0 Core n TSX abort interrupt

45

slide-144
SLIDE 144

SGX Specific Side-Channel Defenses Using TSX

Detecting enclave’s interruption

  • Frequent interrupts evidence for side-channel attack
  • T-SGX: Uses TSX feature to detect enclave interrupt [Shih et al., NDSS’17]
  • Déjà Vu : Uses TSX to detect enclave slowdown [Chen et al., AsiaCCS’17]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker Cache Core 0 Core n TSX abort interrupt

45

slide-145
SLIDE 145

SGX Specific Side-Channel Defenses Using TSX

Detecting cache evictions

  • Eviction of the victim’s cache entries could lead to information leakage
  • Cloak: Prime cache before accessing sensitive data [Schuster et al., USENIX 2017]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker Core 0 TSX

46

slide-146
SLIDE 146

SGX Specific Side-Channel Defenses Using TSX

Detecting cache evictions

  • Eviction of the victim’s cache entries could lead to information leakage
  • Cloak: Prime cache before accessing sensitive data [Schuster et al., USENIX 2017]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker Core 0 TSX

46

slide-147
SLIDE 147

SGX Specific Side-Channel Defenses Using TSX

Detecting cache evictions

  • Eviction of the victim’s cache entries could lead to information leakage
  • Cloak: Prime cache before accessing sensitive data [Schuster et al., USENIX 2017]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker Core 0 TSX abort

46

slide-148
SLIDE 148

General Hardware-based Side-Channel l Defenses

47

slide-149
SLIDE 149

General Hardware-based Sid ide-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Temporal cache isolation

48

slide-150
SLIDE 150

General Hardware-based Sid ide-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache partitioning / coloring Temporal cache isolation

48

slide-151
SLIDE 151

General Hardware-based Sid ide-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache partitioning / coloring Temporal cache isolation Randomized cache mappings

48

slide-152
SLIDE 152

Temporal Cache Isolation

  • Flush on each context switch
  • Ineffective on SMT-enabled systems where

caches are shared contemporaneously

  • E.g., [Costan et al., USENIX Sec’16]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Victim Cache

SMT: Simultaneous Multithreading

Temporal cache isolation

49

slide-153
SLIDE 153

Temporal Cache Isolation

  • Flush on each context switch
  • Ineffective on SMT-enabled systems where

caches are shared contemporaneously

  • E.g., [Costan et al., USENIX Sec’16]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Attacker Cache flush

SMT: Simultaneous Multithreading

Temporal cache isolation

49

slide-154
SLIDE 154

Temporal Cache Isolation

  • Flush on each context switch
  • Ineffective on SMT-enabled systems where

caches are shared contemporaneously

  • E.g., [Costan et al., USENIX Sec’16]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker SMT

SMT: Simultaneous Multithreading

Temporal cache isolation

49

slide-155
SLIDE 155

Cache Partitioning / Coloring

  • Reduces the amount of cache available to individual

software

  • E.g., [Domnister et al., TACO’12]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache partitioning / coloring

Cache Victim Attacker

50

slide-156
SLIDE 156

Cache Partitioning / Coloring

  • Reduces the amount of cache available to individual

software

  • E.g., [Domnister et al., TACO’12]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache partitioning / coloring

Cache Victim Attacker

50

slide-157
SLIDE 157

Randomized Cache Mappings

  • Adversary cannot link cache observation with memory

locations

  • Frequency analysis or predictable access patterns can reveal randomization secret
  • E.g., [Wang et al., ISCA’07]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker RAM

Randomized cache mappings

51

slide-158
SLIDE 158

Randomized Cache Mappings

  • Adversary cannot link cache observation with memory

locations

  • Frequency analysis or predictable access patterns can reveal randomization secret
  • E.g., [Wang et al., ISCA’07]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker RAM Key

Randomized cache mappings

51

slide-159
SLIDE 159

Randomized Cache Mappings

  • Adversary cannot link cache observation with memory

locations

  • Frequency analysis or predictable access patterns can reveal randomization secret
  • E.g., [Wang et al., ISCA’07]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker RAM Key

Key

Randomized cache mappings

51

slide-160
SLIDE 160

Randomized Cache Mappings

  • Adversary cannot link cache observation with memory

locations

  • Frequency analysis or predictable access patterns can reveal randomization secret
  • E.g., [Wang et al., ISCA’07]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker RAM Key

Randomized cache mappings

51

slide-161
SLIDE 161

Randomized Cache Mappings

  • Adversary cannot link cache observation with memory

locations

  • Frequency analysis or predictable access patterns can reveal randomization secret
  • E.g., [Wang et al., ISCA’07]

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Cache Victim Attacker RAM Key

Key

Randomized cache mappings

51

slide-162
SLIDE 162

General Software-only Side-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Side-channel resilient software design Monitoring for attack effects Oblivious execution / ORAM

52

slide-163
SLIDE 163

General Software-only Side-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Side-channel resilient software design Monitoring for attack effects Oblivious execution / ORAM

Example Problems

  • Scatter and gather:

data accesses effect all cache lines

  • Not applicable to all

applications

  • Manual software

hardening required

52

slide-164
SLIDE 164

General Software-only Side-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Side-channel resilient software design Monitoring for attack effects Oblivious execution / ORAM

Example Problems

  • Scatter and gather:

data accesses effect all cache lines

  • Not applicable to all

applications

  • Manual software

hardening required

Example Problems

  • Use hardware

performance counter to detect unusually high cache eviction rate

  • Requires privileged

entity (not available in SGX model)

52

slide-165
SLIDE 165

General Software-only Side-Channel Defenses

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Side-channel resilient software design Monitoring for attack effects Oblivious execution / ORAM

Example Problems

  • Scatter and gather:

data accesses effect all cache lines

  • Not applicable to all

applications

  • Manual software

hardening required

Example Problems

  • Use hardware

performance counter to detect unusually high cache eviction rate

  • Requires privileged

entity (not available in SGX model)

Oblivious RAM Problems

  • All memory accesses

(code and/or data) indistinguishable

  • Too inefficient, ORAM

metadata needs to be protected as well

52

slide-166
SLIDE 166

Our Recent Work: DR.SGX: Automated and Adjustable Side-Channel Protection for SGX using Data Location Randomization

[Brasser et al., ACSAC 2019]

53

slide-167
SLIDE 167

DR.SGX: Objective and Approach

  • Objective: Similarly to ORAM, make memory accesses

indistinguishable

  • but at a cheaper cost
  • without relying on meta-data that needs protection
  • Approach: Runtime fine-grained data location randomization
  • format-preserving encryption to determine location of randomized data
  • only small constant-size metadata needed
  • compiler-based approach (no annotations needed)
  • gradual randomization, interleaved with enclave execution
  • configurable re-randomization rate

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

54

slide-168
SLIDE 168

Randomizing Memory ry: ORAM vs. . DR.SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

RAM Sensitive Array

55

slide-169
SLIDE 169

Randomizing Memory ry: ORAM vs. . DR.SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

RAM Sensitive Array ORAM Tree

55

slide-170
SLIDE 170

Randomizing Memory ry: ORAM vs. . DR.SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

RAM Sensitive Array ORAM Tree

55

slide-171
SLIDE 171

Randomizing Memory ry: ORAM vs. . DR.SGX

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

RAM Sensitive Array AES Key

  • DR. SGX

(Pseudo-random Permutation)

55

slide-172
SLIDE 172

DR.SGX Re-randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Initial layout A B C D E F G H Time FFX Format-Preserving Encryption scheme with AES as a block cipher

56

slide-173
SLIDE 173

DR.SGX Re-randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Initial layout Layout 1 A B C D E F G H F C G E D H A B Time Permutation π1 AES-NI FFX Format-Preserving Encryption scheme with AES as a block cipher

56

slide-174
SLIDE 174

DR.SGX Re-randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

Initial layout Layout 1 Layout 2 A B C D E F G H F C G E D H A B G D B E H A F C Time Permutation π1 AES-NI Permutation π2 AES-NI Re-randomization window FFX Format-Preserving Encryption scheme with AES as a block cipher

56

slide-175
SLIDE 175

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping Memory accesses

57

slide-176
SLIDE 176

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping Memory accesses

57

slide-177
SLIDE 177

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping Binary analysis Memory accesses

57

slide-178
SLIDE 178

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping Architecture + Page tables Binary analysis Memory accesses

57

slide-179
SLIDE 179

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping Architecture + Page tables Binary analysis Memory accesses

57

slide-180
SLIDE 180

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping F H E B G D C A E B Memory accesses

57

slide-181
SLIDE 181

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping F H E B G D C A E B ??? Memory accesses

57

slide-182
SLIDE 182

Data Randomization

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

A B C D E F G H Main memory E B Cache Mapping F H E B G D C A E B ??? ??? Memory accesses

57

slide-183
SLIDE 183

Performance Evaluation using Nbench

  • Without runtime re-randomization (geometric mean about 4x)

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

58

slide-184
SLIDE 184

Performance Evaluation using Nbench

  • With different re-randomization windows (geometric mean up to 12x)

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

59

slide-185
SLIDE 185

ORAM vs. Dr.SGX: Performance Comparison

  • Obfuscuro [Ahmad et al., NDSS 2019]
  • Obfuscation engine on Intel SGX
  • Implements both, ORAM and oblivious execution
  • Performance overheads of 83x on average and up to 220x
  • Dr. SGX
  • Performance overhead 4x – 12x
  • at least one order of magnitude lower than Obfuscuro
  • Allows developers to balance between increased side-channel protection and

the performance cost based on adjustable security parameter

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

60

slide-186
SLIDE 186

Conclusion

  • Great concepts suffer from implementation problems
  • Intel SGX is no exception
  • Side-channel attacks are a major threat to Intel SGX
  • Were deemed as ‘too difficult’ and were left out of the attacker model
  • Research has shown it otherwise
  • Attacks still can be improved through more automation
  • Countermeasures
  • Range from specific protections against particular problems to generic

solutions

  • Generic solutions, however, come at significant (prohibitive?) cost
  • There is a need for more efficient generic solutions

SEPTEMBER 9 – 13, 2019

CROSSING Summer School on Sustainable Security & Privacy

61

slide-187
SLIDE 187