Securing Systems with Insecure Hardware Kaveh Razavi About VUSec - - PowerPoint PPT Presentation

securing systems with insecure hardware
SMART_READER_LITE
LIVE PREVIEW

Securing Systems with Insecure Hardware Kaveh Razavi About VUSec - - PowerPoint PPT Presentation

Securing Systems with Insecure Hardware Kaveh Razavi About VUSec ~20 members Software protections Binary and malware analysis Fuzzing Network security Hardware and OS security 2 Assuming secure software, what is


slide-1
SLIDE 1

Securing Systems with Insecure Hardware

Kaveh Razavi

slide-2
SLIDE 2

About VUSec

~20 members

  • Software protections
  • Binary and malware analysis
  • Fuzzing
  • Network security
  • Hardware and OS security

2

slide-3
SLIDE 3

3

Assuming secure software, what is still possible? and what can we do about it?

slide-4
SLIDE 4

General-purpose Hardware Attacks (2015-)

4

A government entity in a certain country: “can we please have the Drammer exploit?” Drammer Spectre/MDS

slide-5
SLIDE 5

What Is Different?

5

1) Attacks and their impact are not obvious 2) Problems are often structural 3) Cannot “update” hardware

slide-6
SLIDE 6

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

6

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-7
SLIDE 7

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

7

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-8
SLIDE 8

The Rowhammer Problem

We have reduced transistor without caring for reliability/security

8

Rowhammer: affects 87% of deployed DDR3 memory, DDR4 as well. Years later

Kim et al., “Flipping Bits in Memory Without Accessing Them: An Experimental Study of DRAM Disturbance Errors,” ISCA’14

slide-9
SLIDE 9

Exploiting These Flips

9

1) Templating 2) Massaging 3) Exploitation

Razavi et al., “Flip Feng Shui: Hammering a Needle into the Software Stack,” SEC’16

Random, previously unknown locations, single flips.

DRAM

$ $

slide-10
SLIDE 10

Compromising Cloud Virtual Machines

10

1) Templating 2) Massaging 3) Exploitation

Attacker’s own memory Memory deduplication

DRAM Victim VM Attacker VM

slide-11
SLIDE 11

Memory Deduplication

11

Victim VM Attacker VM $

slide-12
SLIDE 12

Memory Deduplication

12

Victim VM Attacker VM $ $

slide-13
SLIDE 13

Memory Deduplication

13

Victim VM Attacker VM $ $

slide-14
SLIDE 14

Compromising Cloud Virtual Machines

14

1) Templating 2) Massaging 3) Exploitation

Attacker’s own memory Memory deduplication Corrupt RSA public keys (OpenSSH)

DRAM Victim VM Attacker VM

slide-15
SLIDE 15

Factorizing Corrupted RSA Public Keys

15

n = p × q → PK (public key) PK → PK'

FFS

PK' → n' = p'× q'× z'× ...

slide-16
SLIDE 16

Attack’s Success Rate

16

slide-17
SLIDE 17

Flip Feng Shui on Mobile Devices (ARM)

17

DRAM

1) Templating 2) Massaging 3) Exploitation

Not possible to hammer No dedup

Caches Cores

→ ION (DMA) memory → buddy allocation

slide-18
SLIDE 18

Results - Drammer on 27 phones

18

22 seconds to root on 18 out of 27 tested phones.

slide-19
SLIDE 19

Impact

  • Similarly applicable in the browser (GLitch S&P’18)
  • Response: mostly disabling features

○ Google disabled parts of ION allocator ○ Microsoft and cloud providers turned dedup off

19

  • Major media attention
  • Two best paper and two pwnie awards
slide-20
SLIDE 20

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

20

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-21
SLIDE 21

Proposed Defenses

21

Disabling features:

  • Deduplication (massaging)
  • ION contiguous heap (templating)

Expensive and not secure Drammer (dedup), GuardION (ION)

slide-22
SLIDE 22

Proposed Defenses

22

Disabling features:

  • Deduplication
  • ION heaps

Hardware defenses:

  • ECC (templating)
  • PARA/TRR (templating)
slide-23
SLIDE 23

Error-correction Codes (SECDED)

  • Original paper demonstrated SECDED not to be enough
  • … but exploitation turned out to be difficult

○ ECC implementation is closed (guarantees unknown) ○ 1 bit flips not visible, 2 bit flips crash the system

23

DRAM DRAM Controller Cores

ECC DRAM as a practical secure defense.

slide-24
SLIDE 24

Recovering ECC Functions

24

  • Observing signals are not easy at 1Ghz+

○ Need custom interposer ○ Expensive logic analyzer

  • Fault injection with syringe needles!
  • Short-circuit data lines with Vss

○ High-to-low voltage flips

  • With some math error reports allows for ECC recovery

Cojocar et al., “Exploiting Correcting Codes: On the Effectiveness of ECC Memory Against Rowhammer Attacks,” S&P’19

slide-25
SLIDE 25

Results

25

slide-26
SLIDE 26

Avoiding Crashes

Detect single flips and merge them for silent corruptions.

26

Distinguished Practical Paper Award at S&P’19

slide-27
SLIDE 27

Proposed Defenses

27

Disabling features:

  • Deduplication
  • ION heaps

Hardware defenses:

  • ECC (templating)
  • PARA/TRR (templating)

Not deployed everywhere and some implementations are insecure (current work)

slide-28
SLIDE 28

Proposed Defenses

28

Disabling features:

  • Deduplication
  • ION heaps

Hardware defenses:

  • ECC (templating)
  • PARA/TRR (templating)

Proper protection in software with existing hardware interfaces?

slide-29
SLIDE 29

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

29

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-30
SLIDE 30

Rowhammer’s Fault Model

30

Bit flips affect adjacent rows Isolate every memory row from another...

slide-31
SLIDE 31

ZebRAM: Even/Odd Rows Isolated from Each Other

31

Konoth et al., “ZebRAM: Comprehensive and Compatible Software Protection Against Rowhammer Attacks,” OSDI’18

slide-32
SLIDE 32

ZebRAM’s Design

1) How to allocate odd/even rows?

32

2) How to map odd/even rows to safe/unsafe regions? 3) How to utilize unsafe region? 4) How to protect the safe/unsafe regions? ALIS VTx Swap

SHA2 Swap Cache

slide-33
SLIDE 33

Life of a Page in ZebRAM

33

Swap Safe Memory # Cache

Linux/KVM Kernel: 1454 LoC User: 5118 LoC

slide-34
SLIDE 34

Evaluation: SPEC 2006

34

slide-35
SLIDE 35

Evaluation: Security

35

Run no. Total Number of Flips Detected by ZebRAM 1 4,702 4,702 2 5,132 5,132 3 2,790 2,790

First comprehensive and compatible Rowhammer protection.

slide-36
SLIDE 36

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

36

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-37
SLIDE 37

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

37

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-38
SLIDE 38

Traditional Cache Attacks

38

Shared Last Level Cache Attacker Core Victim Core DRAM

slide-39
SLIDE 39

Attacking CPU-internal Components

39

Core MMU

AnC ASLR leak 2017

slide-40
SLIDE 40

AnC: MMU Leaves a Trace in the CPU Caches

40

CPU Cache

Secret: randomized virtual address

Gras/Razavi et al., “ASLR on the Line: Practical Cache Attacks on the MMU,” NDSS’17

slide-41
SLIDE 41

AnC from JavaScript

41

slide-42
SLIDE 42

Affected Architectures

42

slide-43
SLIDE 43

Impact

  • Response: spot mitigations

○ Apple updated WebKit allocation policies ○ Jitter in the timers

43

  • Best Dutch cyber security research award
  • Pwnie for most innovative research
slide-44
SLIDE 44

Attacking CPU-internal Components

44

Core Core MMU SPEC

AnC ASLR leak 2017 Spectre Arbitrary leak 2018

slide-45
SLIDE 45

45

*ptr;

Points to Secret

Victim Process Attacker Process

L1 Cache

Secret

Mitigations: limit the pointer

*ptr;

Cannot point to Secret Covert channel Exception!

Flush+Reload Array

...

arr[2] arr[1] arr[0]

Flush Flush Flush

arr[*ptr];

slide-46
SLIDE 46

Are these spot mitigations enough?

46

slide-47
SLIDE 47

Defending These New Classes of Attacks

DRAM-based corruptions (Rowhammer)

47

Novel Attacks Defense Assessment Novel Defenses

Hardware-based information leakage

slide-48
SLIDE 48

Attacking CPU-internal Components

48

Core Core MMU SPEC

AnC ASLR leak 2017 Spectre Arbitrary leak 2018

Core LFB

RIDL Arbitrary leak 2019

Van Schaik et al., “RIDL: Rogue Inflight Data Load,” S&P’19

slide-49
SLIDE 49

49

Victim Process

Secret

Attacker Process

L1 Cache

*ptr;

Invalid pointers leak! Various CPU buffers

*ptr;

Leakage across the board, bypassing all mitigations. Covert channel

arr[NULL];

slide-50
SLIDE 50

Which CPUs Are Vulnerable?

50

1 Year of CVD with Intel $100,000 bounty award

slide-51
SLIDE 51

Other Defenses: Partitioning

51

  • Partitioning is imperfect

○ TLBLeed (SEC’18), XLATE (SEC’18)

  • New OS primitives allow for secure partitioning

(VUsion, SOSP’17)

slide-52
SLIDE 52

Conclusion

52

Ben Gras, Victor van der Veen, Erik Bosman, Pietro Frigo, Andrei Tatar, Radhesh Konoth, Stephan van Schaik, Alyssa Milburn, Sebastian Ostersund, Dennis Andriesse, Elias Athanasopoulos, Daniel Gruss, Clementine Maurice, Yanick Fratantonio, Martina Lindorfer, Giovanni Viga, Bart Preneel, Cristiano Giuffrida, Herbert Bos

Hardware is the new software except it is harder to fix Spot mitigations are costly and ineffective Principled mitigations in software/hardware

slide-53
SLIDE 53

I am hiring PhD students!

53

To do exciting hardware security research Email: kaveh@cs.vu.nl Twitter: @kavehrazavi

slide-54
SLIDE 54

What’s Next?

54

slide-55
SLIDE 55

Evaluation: Redis Throughput at Saturation

55

slide-56
SLIDE 56

ECC: Replicating Existing Attacks

56

slide-57
SLIDE 57

Reducing ASLR Entropy

57

slide-58
SLIDE 58

(p)TRR

  • Original paper (PARA): on DRAM row activation

refresh adjacent rows with a certain probability ○ Found to be effective

  • (LP)DDR4 standard: count activations and refresh

adjacent rows

  • Many different implementations

○ Some look insecure, deployability? (current work)

58

slide-59
SLIDE 59

Proposed Defenses

59

Disabling features:

  • Deduplication
  • ION heaps

Hardware defenses:

  • ECC
  • (p)TRR

Software defenses:

  • ANVIL (templating)
  • CATT (memory massaging)
slide-60
SLIDE 60

Software Defenses

60

  • ANVIL (ASPLOS’16): software TRR

○ Requires hardware-specific Intel feature

  • CATT (SEC’16): separate kernel-user memory

○ Only protects the kernel ○ Limits memory management ○ Page-cache attacks

Kernel Memory Guard Row User Memory

slide-61
SLIDE 61

Securing DMA Memory

61

Van der Veen et al., “GuardION: Practical Mitigation of DMA-based Rowhammer Attacks on ARM,” DIMVA’18

Android kernel patch: 844 LoC Re-enabled ION contig. heap

slide-62
SLIDE 62

Evaluation Results

62

slide-63
SLIDE 63

Traditional Cache Attacks

63

Shared Last Level Cache Attacker Core Victim Core

if (secret_value == 1) { something(); } else { something_else(); } if (secret_value == 1) { something(); } else { something_else(); } if (secret_value == 1) { something(); } else { something_else(); }

DRAM

slide-64
SLIDE 64

Proposed Defenses: Cache Partitioning

64

Attacker Core Victim Core

COLORIS Page Coloring PACT’14

Shared Cache

CATalyst Intel CAT HPCA’17

Shared Cache

Cloak Intel TSX SEC’17

Shared Cache

Attacker Core Victim Core Attacker Core Victim Core

slide-65
SLIDE 65

Backup: Other Components

65

slide-66
SLIDE 66

Templating

66

Victim VM Attacker VM

slide-67
SLIDE 67

Memory Deduplication

67

Victim VM Attacker VM $

slide-68
SLIDE 68

Factorizing Corrupted RSA Public Keys

68

slide-69
SLIDE 69

The Drammer Attack

69

1) Templating 2) Massaging 3) Exploitation

ION DMA memory allocation Predictable behavior of buddy allocator Corrupting page tables

Van der Veen et al., “Drammer: Deterministic Rowhammer Attacks on Mobile Platforms,” CCS’16

slide-70
SLIDE 70

Leaking /etc/shadow with RIDL

70

Industry-wide mitigation efforts underway. Deep optimizations in the CPU pipeline

Van Schaik et al., “RIDL: Rogue Inflight Data Load,” S&P’19

slide-71
SLIDE 71

$600 Billion Lost to Cyber Crime in 2018

71

Lots of efforts on securing systems ($114 Billion in 2019)

slide-72
SLIDE 72

Securing Software (2000-)

72

ASLR DEP CFI Software Update

Assuming secure software, what is still possible? And what can we do about it?