From bottom to top: Exploiting hardware side channels in web - - PowerPoint PPT Presentation

from bottom to top exploiting hardware side channels in
SMART_READER_LITE
LIVE PREVIEW

From bottom to top: Exploiting hardware side channels in web - - PowerPoint PPT Presentation

From bottom to top: Exploiting hardware side channels in web browsers Cl ementine Maurice, Graz University of Technology July 4, 2017RMLL, Saint- Etienne, France Rennes Graz Cl ementine Maurice now postdoc at TU Graz, Austria PhD


slide-1
SLIDE 1

From bottom to top: Exploiting hardware side channels in web browsers

Cl´ ementine Maurice, Graz University of Technology July 4, 2017—RMLL, Saint-´ Etienne, France

slide-2
SLIDE 2

Rennes Graz Cl´ ementine Maurice PhD since October 2015 from Rennes, France now postdoc at TU Graz, Austria Secure Systems group

+ Secure Systems team: Daniel Gruss, Michael Schwarz, Peter Pessl

2

slide-3
SLIDE 3

Introduction

  • safe sofware infrastructure does not mean safe execution

3

slide-4
SLIDE 4

Introduction

  • safe sofware infrastructure does not mean safe execution
  • information leaks because of the underlying hardware

3

slide-5
SLIDE 5

Introduction

  • safe sofware infrastructure does not mean safe execution
  • information leaks because of the underlying hardware
  • these vulnerabilities can also be exploited at a high level

3

slide-6
SLIDE 6

Introduction

  • safe sofware infrastructure does not mean safe execution
  • information leaks because of the underlying hardware
  • these vulnerabilities can also be exploited at a high level
  • like a web browser

3

slide-7
SLIDE 7

Introduction

  • safe sofware infrastructure does not mean safe execution
  • information leaks because of the underlying hardware
  • these vulnerabilities can also be exploited at a high level
  • like a web browser
  • because JavaScript is nothing more than code executing on your machine :)

3

slide-8
SLIDE 8

Outline

  • 1. What are micro-architectural side channels?

4

slide-9
SLIDE 9

Outline

  • 1. What are micro-architectural side channels?
  • 2. How can I use DRAM to create a covert channel?

4

slide-10
SLIDE 10

Outline

  • 1. What are micro-architectural side channels?
  • 2. How can I use DRAM to create a covert channel?
  • 3. How can I do that in JavaScript?!

4

slide-11
SLIDE 11

Sources of leakage

  • no “bug” in the sense of a mistake → lots of performance optimizations

5

slide-12
SLIDE 12

Sources of leakage

  • no “bug” in the sense of a mistake → lots of performance optimizations
  • via power consumption, electromagnetic leaks

5

slide-13
SLIDE 13

Sources of leakage

  • no “bug” in the sense of a mistake → lots of performance optimizations
  • via power consumption, electromagnetic leaks

5

slide-14
SLIDE 14

Sources of leakage

  • no “bug” in the sense of a mistake → lots of performance optimizations
  • via power consumption, electromagnetic leaks

→ targeted attacks, physical access

5

slide-15
SLIDE 15

Sources of leakage

  • no “bug” in the sense of a mistake → lots of performance optimizations
  • via power consumption, electromagnetic leaks

→ targeted attacks, physical access

  • via shared hardware and microarchitecture

5

slide-16
SLIDE 16

Sources of leakage

  • no “bug” in the sense of a mistake → lots of performance optimizations
  • via power consumption, electromagnetic leaks

→ targeted attacks, physical access

  • via shared hardware and microarchitecture

→ remote attacks

5

slide-17
SLIDE 17

Shared hardware

shared hardware CPU data and instruction cache arithmetic logic unit branch prediction unit memory memory bus DRAM

6

slide-18
SLIDE 18

DRAM and side channels

slide-19
SLIDE 19

DRAM organization

7

slide-20
SLIDE 20

DRAM organization

channel 0 channel 1

7

slide-21
SLIDE 21

DRAM organization

channel 0 channel 1 back of DIMM: rank 1 front of DIMM: rank 0

7

slide-22
SLIDE 22

DRAM organization

channel 0 channel 1 back of DIMM: rank 1 front of DIMM: rank 0 chip

7

slide-23
SLIDE 23

DRAM organization

chip

bank 0 row 0 row 1 row 2 ... row 32767 row buffer 8

slide-24
SLIDE 24

DRAM organization

chip

bank 0 row 0 row 1 row 2 ... row 32767 row buffer

64k cells 1 capacitor, 1 transitor each

8

slide-25
SLIDE 25

DRAM row buffer

  • DRAM internally is only capable of reading entire rows

9

slide-26
SLIDE 26

DRAM row buffer

  • DRAM internally is only capable of reading entire rows
  • capacitors in cells discharge when you “read the bits”
  • buffer the bits when reading them from the cells
  • write the bits back to the cells when you’re done

9

slide-27
SLIDE 27

DRAM row buffer

  • DRAM internally is only capable of reading entire rows
  • capacitors in cells discharge when you “read the bits”
  • buffer the bits when reading them from the cells
  • write the bits back to the cells when you’re done

→ row buffer

9

slide-28
SLIDE 28

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 10

slide-29
SLIDE 29

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 1 → row 1 activated

activate 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10

slide-30
SLIDE 30

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 1 → row 1 activated → row 1 copied to row buffer

row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1 copy 10

slide-31
SLIDE 31

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 1 → row 1 activated → row 1 copied to row buffer

row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1 return 10

slide-32
SLIDE 32

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer

CPU wants to access row 2

1 1 1 1 1 1 1 1 1 1 1 1 1 1 10

slide-33
SLIDE 33

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer

CPU wants to access row 2 → row 2 activated

activate 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10

slide-34
SLIDE 34

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 2 → row 2 activated → row 2 copied to row buffer

row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1 copy 10

slide-35
SLIDE 35

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 2 → row 2 activated → row 2 copied to row buffer

row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1 return 10

slide-36
SLIDE 36

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

CPU wants to access row 2 → row 2 activated → row 2 copied to row buffer

row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1

→ slow (row conflict)

10

slide-37
SLIDE 37

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1

CPU wants to access row 2—again

10

slide-38
SLIDE 38

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1

CPU wants to access row 2—again → row 2 already in row buffer

10

slide-39
SLIDE 39

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1

CPU wants to access row 2—again → row 2 already in row buffer

return 10

slide-40
SLIDE 40

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer 1 1 1 1 1 1 1 1 1 1 1 1 1 1

CPU wants to access row 2—again → row 2 already in row buffer → fast (row hit)

10

slide-41
SLIDE 41

How reading from DRAM works

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

row buffer = cache

10

slide-42
SLIDE 42

DRAM timing differences

72 84 96 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 101 103 105 107 Access time [CPU cycles] Number of cases Cache hit Cache miss, row hit Cache miss, row conflict

11

slide-43
SLIDE 43

DRAM timing differences

72 84 96 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 101 103 105 107 Access time [CPU cycles] Number of cases Cache hit Cache miss, row hit Cache miss, row conflict

11

slide-44
SLIDE 44

DRAM side channels?

  • row buffers are caches

12

slide-45
SLIDE 45

DRAM side channels?

  • row buffers are caches
  • we can observe timing differences

12

slide-46
SLIDE 46

DRAM side channels?

  • row buffers are caches
  • we can observe timing differences
  • how to exploit these timing differences?

12

slide-47
SLIDE 47

DRAM side channels?

  • row buffers are caches
  • we can observe timing differences
  • how to exploit these timing differences?
  • target addresses in the same channel, rank and bank

12

slide-48
SLIDE 48

DRAM side channels?

  • row buffers are caches
  • we can observe timing differences
  • how to exploit these timing differences?
  • target addresses in the same channel, rank and bank
  • but DRAM mapping functions are undocumented

12

slide-49
SLIDE 49

DRAM side channels?

  • row buffers are caches
  • we can observe timing differences
  • how to exploit these timing differences?
  • target addresses in the same channel, rank and bank
  • but DRAM mapping functions are undocumented

→ we reverse-engineered them! https://github.com/IAIK/drama

  • P. Pessl et al. “DRAMA: Exploiting DRAM Addressing for Cross-CPU Attacks”. In: USENIX Security Symposium. 2016

12

slide-50
SLIDE 50

DRAMA: DRAM Addressing attacks

  • infer behavior from memory accesses similarly to cache attacks

13

slide-51
SLIDE 51

DRAMA: DRAM Addressing attacks

  • infer behavior from memory accesses similarly to cache attacks
  • works across VMs, across cores, across CPUs

13

slide-52
SLIDE 52

DRAMA: DRAM Addressing attacks

  • infer behavior from memory accesses similarly to cache attacks
  • works across VMs, across cores, across CPUs
  • covert channels and side-channel attacks

13

slide-53
SLIDE 53

DRAMA: DRAM Addressing attacks

  • infer behavior from memory accesses similarly to cache attacks
  • works across VMs, across cores, across CPUs
  • covert channels and side-channel attacks
  • covert channel: two processes communicating with each other
  • not allowed to do so, e.g., across VMs

13

slide-54
SLIDE 54

DRAMA: DRAM Addressing attacks

  • infer behavior from memory accesses similarly to cache attacks
  • works across VMs, across cores, across CPUs
  • covert channels and side-channel attacks
  • covert channel: two processes communicating with each other
  • not allowed to do so, e.g., across VMs
  • side-channel attack: one malicious process spies on benign processes
  • e.g., spies on keystrokes

13

slide-55
SLIDE 55

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i 14

slide-56
SLIDE 56

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i

activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 copy 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

14

slide-57
SLIDE 57

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

case #1: sender transmits 1 14

slide-58
SLIDE 58

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i case #1: sender transmits 1 sender accesses row j = i

activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 copy 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

14

slide-59
SLIDE 59

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i case #1: sender transmits 1 sender accesses row j = i

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

14

slide-60
SLIDE 60

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i case #1: sender transmits 1 sender accesses row j = i next receiver access → copy row buffer

activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 copy 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

14

slide-61
SLIDE 61

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i case #1: sender transmits 1 sender accesses row j = i next receiver access → copy row buffer

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

→ slow 14

slide-62
SLIDE 62

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

case #2: sender transmits 0 14

slide-63
SLIDE 63

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

case #2: sender transmits 0 sender does nothing 14

slide-64
SLIDE 64

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

case #2: sender transmits 0 sender does nothing next receiver access → already in buffer

activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

14

slide-65
SLIDE 65

DRAMA covert channel

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

sender and receiver agree on one bank receiver continuously accesses a row i

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

case #2: sender transmits 0 sender does nothing next receiver access → already in buffer → fast 14

slide-66
SLIDE 66

Two applications can covertly communicate with each other But can we use that for spying?

slide-67
SLIDE 67

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i 16

slide-68
SLIDE 68

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #1 spy accesses row j = i, copy to row buffer

activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

16

slide-69
SLIDE 69

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #1 spy accesses row j = i, copy to row buffer victim accesses row i, copy to row buffer

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

16

slide-70
SLIDE 70

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #1 spy accesses row j = i, copy to row buffer victim accesses row i, copy to row buffer spy accesses row i, no copy

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

16

slide-71
SLIDE 71

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #1 spy accesses row j = i, copy to row buffer victim accesses row i, copy to row buffer spy accesses row i, no copy

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

→ fast 16

slide-72
SLIDE 72

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #2 spy accesses row j = i, copy to row buffer

activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

16

slide-73
SLIDE 73

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #2 spy accesses row j = i, copy to row buffer

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

no victim access on row i 16

slide-74
SLIDE 74

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #2 spy accesses row j = i, copy to row buffer no victim access on row i spy accesses row i, copy to row buffer

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 activate 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

16

slide-75
SLIDE 75

DRAMA side-channel attacks

DRAM bank

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 row buffer

spy and victim share a row i case #2 spy accesses row j = i, copy to row buffer no victim access on row i spy accesses row i, copy to row buffer

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

→ slow 16

slide-76
SLIDE 76

Spying on keystrokes on the Firefox URL bar

  • side-channel: template attack
  • allocate a large fraction of memory to be in a row with the victim
  • profile memory and record row-hit ratio for each address

2 4 6 8 10 12 14 150 200 250 300 w w w . f a c e b o

  • k .

c o m Time in seconds Access time

17

slide-77
SLIDE 77

I’m sure we’ll need to write a lot of C code At least we’re safe with JavaScript!

slide-78
SLIDE 78

Member Rowhammer.js?

slide-79
SLIDE 79

DRAM covert channels in JavaScript?

slide-80
SLIDE 80

Why JavaScript?

  • JavaScript is code executed in a sandbox

20

slide-81
SLIDE 81

Why JavaScript?

  • JavaScript is code executed in a sandbox
  • can’t do anything nasty since it is in a sandbox, right?

20

slide-82
SLIDE 82

Why JavaScript?

  • JavaScript is code executed in a sandbox
  • can’t do anything nasty since it is in a sandbox, right?
  • except side channels are only doing benign operations

20

slide-83
SLIDE 83

Why JavaScript?

  • JavaScript is code executed in a sandbox
  • can’t do anything nasty since it is in a sandbox, right?
  • except side channels are only doing benign operations
  • 1. accessing their own memory

20

slide-84
SLIDE 84

Why JavaScript?

  • JavaScript is code executed in a sandbox
  • can’t do anything nasty since it is in a sandbox, right?
  • except side channels are only doing benign operations
  • 1. accessing their own memory
  • 2. measuring time

20

slide-85
SLIDE 85

Challenges with JavaScript

  • 1. No knowledge about

physical addresses

  • 2. No instruction to

flush the cache

  • 3. No high-resolution

timers

21

slide-86
SLIDE 86

#1. No knowledge about physical addresses

  • OS optimization: use Transparent Huge Pages (THP, 2MB pages)
  • = last 21 bits (2MB) of physical address
  • = last 21 bits (2MB) of virtual address

22

slide-87
SLIDE 87

#1. No knowledge about physical addresses

  • OS optimization: use Transparent Huge Pages (THP, 2MB pages)
  • = last 21 bits (2MB) of physical address
  • = last 21 bits (2MB) of virtual address

→ which JS array indices?

22

slide-88
SLIDE 88

#1. Obtaining the beginning of a THP

2 4 6 8 10 12 14 102 104 106 Array index [MB] Access time [ns]

  • physical pages for these THPs are mapped on-demand

→ page fault when an allocated THP is accessed for the first time

  • D. Gruss et al. “Practical Memory Deduplication Attacks in Sandboxed JavaScript”. In: ESORICS’15. 2015.

23

slide-89
SLIDE 89

#1. Choosing physical addresses

  • we now know the last 21 bits of physical addresses
  • enough for most systems, e.g., Sandy Bridge with DDR3

... 6 7 8 9 11 10 12 13 14 16 17 18 19 20 21 22 ... BA0 BA1 BA2 Ch. 15 Rank

24

slide-90
SLIDE 90

#2. No instruction to flush the cache

CPU core CPU cache DRAM

  • measure DRAM timing
  • only non-cached accesses reach DRAM
  • no clflush instruction

→ evict data with other memory accesses

25

slide-91
SLIDE 91

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-92
SLIDE 92

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-93
SLIDE 93

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-94
SLIDE 94

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-95
SLIDE 95

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-96
SLIDE 96

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-97
SLIDE 97

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-98
SLIDE 98

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-99
SLIDE 99

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

load

  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-100
SLIDE 100

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

  • it’s a bit more complicated than that: replacement policy is not LRU
  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-101
SLIDE 101

#2. Bypassing the CPU cache: Basic idea

  • evicting cache line only using memory accesses

cache set

  • it’s a bit more complicated than that: replacement policy is not LRU
  • but we already solved this problem before :)
  • D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16. 2016.

26

slide-102
SLIDE 102

#3. High-resolution timers?

  • measure small timing differences: need a high-resolution timer

27

slide-103
SLIDE 103

#3. High-resolution timers?

  • measure small timing differences: need a high-resolution timer
  • native: rdtsc, timestamp in CPU cycles

27

slide-104
SLIDE 104

#3. High-resolution timers?

  • measure small timing differences: need a high-resolution timer
  • native: rdtsc, timestamp in CPU cycles
  • JavaScript: performance.now() has the highest resolution

27

slide-105
SLIDE 105

#3. High-resolution timers?

  • measure small timing differences: need a high-resolution timer
  • native: rdtsc, timestamp in CPU cycles
  • JavaScript: performance.now() has the highest resolution

performance.now() [...] represent times as floating-point numbers with up to microsecond precision.

— Mozilla Developer Network

27

slide-106
SLIDE 106

High-resolution timers in JavaScript

slide-107
SLIDE 107

It was better before

  • before September 2015: performance.now() had a nanosecond resolution
  • Y. Oren et al. “The Spy in the Sandbox: Practical Cache Attacks in JavaScript and their Implications”. In: CCS’15. 2015.

https://www.mozilla.org/en-US/security/advisories/mfsa2015-114/

28

slide-108
SLIDE 108

It was better before

  • before September 2015: performance.now() had a nanosecond resolution
  • Oren et al. demonstrated cache side-channel attacks in JavaScript
  • Y. Oren et al. “The Spy in the Sandbox: Practical Cache Attacks in JavaScript and their Implications”. In: CCS’15. 2015.

https://www.mozilla.org/en-US/security/advisories/mfsa2015-114/

28

slide-109
SLIDE 109

It was better before

  • before September 2015: performance.now() had a nanosecond resolution
  • Oren et al. demonstrated cache side-channel attacks in JavaScript
  • “fixed” in Firefox 41: rounding to 5 µs
  • Y. Oren et al. “The Spy in the Sandbox: Practical Cache Attacks in JavaScript and their Implications”. In: CCS’15. 2015.

https://www.mozilla.org/en-US/security/advisories/mfsa2015-114/

28

slide-110
SLIDE 110

Microsecond precision?

Firefox < 41 (1 ns) 1·10−3 1 5 5 1·10−3

29

slide-111
SLIDE 111

Microsecond precision?

Firefox < 41 (1 ns) Edge 38 (1 µs) 1·10−3 1 5 5 1·10−3 1

29

slide-112
SLIDE 112

Microsecond precision?

Firefox < 41 (1 ns) Edge 38 (1 µs) W3C standard (5 µs) 1·10−3 1 5 5 1·10−3 1 5

29

slide-113
SLIDE 113

Microsecond precision?

Firefox < 41 (1 ns) Edge 38 (1 µs) W3C standard (5 µs) Firefox ≥ 41/Chrome/Safari (5 µs) 1·10−3 1 5 5 1·10−3 1 5 5

29

slide-114
SLIDE 114

Microsecond precision?

Firefox < 41 (1 ns) Edge 38 (1 µs) W3C standard (5 µs) Firefox ≥ 41/Chrome/Safari (5 µs) Tor (100 ms) 1·10−3 1 5 5 1·10−3 1 5 5 1·105

29

slide-115
SLIDE 115

Microsecond precision?

Firefox < 41 (1 ns) Edge 38 (1 µs) W3C standard (5 µs) Firefox ≥ 41/Chrome/Safari (5 µs) Tor (100 ms) Fuzzyfox (100 ms) 1·10−3 1 5 5 1·10−3 1 5 5 1·105 1·105

  • D. Kohlbrenner et al. “Trusted Browsers for Uncertain Times”. In: USENIX Security Symposium. 2016

29

slide-116
SLIDE 116

We can do better!

  • microsecond resolution is not enough
  • M. Schwarz et al. “Fantastic Timers and Where to Find Them: High-Resolution Microarchitectural Attacks in JavaScript”. In: FC’17. 2017.

30

slide-117
SLIDE 117

We can do better!

  • microsecond resolution is not enough
  • two approaches
  • M. Schwarz et al. “Fantastic Timers and Where to Find Them: High-Resolution Microarchitectural Attacks in JavaScript”. In: FC’17. 2017.

30

slide-118
SLIDE 118

We can do better!

  • microsecond resolution is not enough
  • two approaches
  • 1. recover a higher resolution from the available timer
  • M. Schwarz et al. “Fantastic Timers and Where to Find Them: High-Resolution Microarchitectural Attacks in JavaScript”. In: FC’17. 2017.

30

slide-119
SLIDE 119

We can do better!

  • microsecond resolution is not enough
  • two approaches
  • 1. recover a higher resolution from the available timer
  • 2. build our own high-resolution timer
  • M. Schwarz et al. “Fantastic Timers and Where to Find Them: High-Resolution Microarchitectural Attacks in JavaScript”. In: FC’17. 2017.

30

slide-120
SLIDE 120

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

31

slide-121
SLIDE 121

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

31

slide-122
SLIDE 122

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

+1 +1 +1 +1 +1 +1 +1 +1 +1

31

slide-123
SLIDE 123

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

+1 +1 +1 +1 +1 +1 +1 +1 +1

31

slide-124
SLIDE 124

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

+1 +1 +1 +1 +1 +1 +1 +1 +1

  • to measure with high resolution

31

slide-125
SLIDE 125

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

+1 +1 +1 +1 +1 +1 +1 +1 +1

  • to measure with high resolution
  • start measurement at clock edge

31

slide-126
SLIDE 126

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

+1 +1 +1 +1 +1 +1 +1 +1 +1

  • to measure with high resolution
  • start measurement at clock edge
  • increment a variable until next clock edge

31

slide-127
SLIDE 127

Recovering resolution: Clock interpolation

  • measure how ofen we can increment a variable between two timer ticks

+1 +1 +1 +1 +1 +1 +1 +1 +1

  • to measure with high resolution
  • start measurement at clock edge
  • increment a variable until next clock edge
  • Firefox/Chrome: 500 ns, Tor: 15 µs

31

slide-128
SLIDE 128

Recovering resolution: Edge thresholding

  • ofen sufficient to just see which of two functions takes longer

32

slide-129
SLIDE 129

Recovering resolution: Edge thresholding

  • ofen sufficient to just see which of two functions takes longer

32

slide-130
SLIDE 130

Recovering resolution: Edge thresholding

  • ofen sufficient to just see which of two functions takes longer

fslow ffast

32

slide-131
SLIDE 131

Recovering resolution: Edge thresholding

  • ofen sufficient to just see which of two functions takes longer

fslow ffast

Padding Padding

→ padding so the slow function crosses one more clock edge than the fast one

32

slide-132
SLIDE 132

Recovering resolution: Edge thresholding

unaligned aligned padded 50 100 13 82 87 100 18 percentage both correct fslow misclassified ffast misclassified

33

slide-133
SLIDE 133

Recovering resolution: Edge thresholding

unaligned aligned padded 50 100 13 82 87 100 18 percentage both correct fslow misclassified ffast misclassified

  • nanosecond resolution

33

slide-134
SLIDE 134

Recovering resolution: Edge thresholding

unaligned aligned padded 50 100 13 82 87 100 18 percentage both correct fslow misclassified ffast misclassified

  • nanosecond resolution
  • Firefox/Tor: 2 ns, Edge: 10 ns, Chrome: 15 ns

33

slide-135
SLIDE 135

Building a timer

  • goal: counter that does not block main thread

34

slide-136
SLIDE 136

Building a timer

  • goal: counter that does not block main thread
  • baseline setTimeout: 4 ms (except Edge: 2 ms)

34

slide-137
SLIDE 137

Building a timer

  • goal: counter that does not block main thread
  • baseline setTimeout: 4 ms (except Edge: 2 ms)
  • CSS animation → increase width of element as fast as possible

34

slide-138
SLIDE 138

Building a timer

  • goal: counter that does not block main thread
  • baseline setTimeout: 4 ms (except Edge: 2 ms)
  • CSS animation → increase width of element as fast as possible
  • timestamp = width of element

34

slide-139
SLIDE 139

Building a timer

  • goal: counter that does not block main thread
  • baseline setTimeout: 4 ms (except Edge: 2 ms)
  • CSS animation → increase width of element as fast as possible
  • timestamp = width of element
  • but animation limited to 60 fps → 16 ms resolution

34

slide-140
SLIDE 140

Building a timer: Web worker

  • JavaScript can spawn new threads called web worker

35

slide-141
SLIDE 141

Building a timer: Web worker

  • JavaScript can spawn new threads called web worker
  • web worker communicate using message passing

35

slide-142
SLIDE 142

Building a timer: Web worker

  • JavaScript can spawn new threads called web worker
  • web worker communicate using message passing
  • let worker count and request timestamp in main thread

35

slide-143
SLIDE 143

Building a timer: Web worker

  • JavaScript can spawn new threads called web worker
  • web worker communicate using message passing
  • let worker count and request timestamp in main thread
  • possibilities: postMessage, MessageChannel or BroadcastChannel

35

slide-144
SLIDE 144

Building a timer: Web worker

  • JavaScript can spawn new threads called web worker
  • web worker communicate using message passing
  • let worker count and request timestamp in main thread
  • possibilities: postMessage, MessageChannel or BroadcastChannel
  • microsecond resolution (even on Tor and Fuzzyfox)

35

slide-145
SLIDE 145

Building a timer: Web worker

  • experimental feature to share data: SharedArrayBuffer

36

slide-146
SLIDE 146

Building a timer: Web worker

  • experimental feature to share data: SharedArrayBuffer
  • web worker can simultaneously read/write data

36

slide-147
SLIDE 147

Building a timer: Web worker

  • experimental feature to share data: SharedArrayBuffer
  • web worker can simultaneously read/write data
  • no message passing overhead

36

slide-148
SLIDE 148

Building a timer: Web worker

  • experimental feature to share data: SharedArrayBuffer
  • web worker can simultaneously read/write data
  • no message passing overhead
  • one dedicated worker for incrementing the shared variable

36

slide-149
SLIDE 149

Building a timer: Web worker

  • experimental feature to share data: SharedArrayBuffer
  • web worker can simultaneously read/write data
  • no message passing overhead
  • one dedicated worker for incrementing the shared variable
  • Firefox/Fuzzyfox: 2 ns, Chrome: 15 ns

36

slide-150
SLIDE 150

Building a timer: Is it good enough?

300 350 400 450 500 550 600 650 700 750 100 200 300 Access time [SharedArrayBuffer increments] Number of cases cache hit cache miss

37

slide-151
SLIDE 151

Building a timer: Is it good enough?

300 350 400 450 500 550 600 650 700 750 100 200 300 Access time [SharedArrayBuffer increments] Number of cases cache hit cache miss

→ we can distinguish cache hits from cache misses (only ≈ 150 cycles difference)!

37

slide-152
SLIDE 152

Take-away

38

slide-153
SLIDE 153

Bonus: What else can we do with this?

  • idea is not new: Wray (1992)
  • we also exploited it in other contexts
  • on ARM
  • inside an SGX enclave
  • J. C. Wray. “An analysis of covert timing channels”. In: Journal of Computer Security 1.3-4 (1992), pp. 219–232.
  • M. Lipp et al. “ARMageddon: Cache Attacks on Mobile Devices”. In: USENIX Security Symposium. 2016.
  • M. Schwarz et al. “Malware Guard Extension: Using SGX to Conceal Cache Attacks”. In: DIMVA’17. 2017.

39

slide-154
SLIDE 154

DRAM covert channels in JavaScript!

slide-155
SLIDE 155

Setup

  • sender: native application in a VM

40

slide-156
SLIDE 156

Setup

  • sender: native application in a VM
  • receiver: JavaScript in a web page on the host

40

slide-157
SLIDE 157

Setup

  • sender: native application in a VM
  • receiver: JavaScript in a web page on the host
  • sender and receiver select the same bank

40

slide-158
SLIDE 158

Setup

  • sender: native application in a VM
  • receiver: JavaScript in a web page on the host
  • sender and receiver select the same bank
  • sender and receiver select a different row inside this bank

40

slide-159
SLIDE 159

Setup

  • sender: native application in a VM
  • receiver: JavaScript in a web page on the host
  • sender and receiver select the same bank
  • sender and receiver select a different row inside this bank
  • sender transmits 0 by doing nothing and 1 by causing row conflict

40

slide-160
SLIDE 160

Setup

  • sender: native application in a VM
  • receiver: JavaScript in a web page on the host
  • sender and receiver select the same bank
  • sender and receiver select a different row inside this bank
  • sender transmits 0 by doing nothing and 1 by causing row conflict
  • receiver measures access time for its row: fast → 0, slow → 1

40

slide-161
SLIDE 161

Sending packets

1 2 3 4 5 6 7 8 9 10

10 Data EDC

S e q

  • communication based on 11-bit packets, with 5-bit of data

41

slide-162
SLIDE 162

Sending packets

1 2 3 4 5 6 7 8 9 10

10 Data EDC

S e q

  • communication based on 11-bit packets, with 5-bit of data
  • packet starts with a 2-bit preamble

41

slide-163
SLIDE 163

Sending packets

1 2 3 4 5 6 7 8 9 10

10 Data EDC

S e q

  • communication based on 11-bit packets, with 5-bit of data
  • packet starts with a 2-bit preamble
  • data integrity checked by an error-detection code

41

slide-164
SLIDE 164

Sending packets

1 2 3 4 5 6 7 8 9 10

10 Data EDC

S e q

  • communication based on 11-bit packets, with 5-bit of data
  • packet starts with a 2-bit preamble
  • data integrity checked by an error-detection code
  • sequence bit indicates whether it is a retransmission or a new packet

41

slide-165
SLIDE 165

Evaluation

  • transmission of approximately 11 bits/s

42

slide-166
SLIDE 166

Evaluation

  • transmission of approximately 11 bits/s
  • can be improved using

42

slide-167
SLIDE 167

Evaluation

  • transmission of approximately 11 bits/s
  • can be improved using
  • fewer re-transmits

42

slide-168
SLIDE 168

Evaluation

  • transmission of approximately 11 bits/s
  • can be improved using
  • fewer re-transmits
  • error correction

42

slide-169
SLIDE 169

Evaluation

  • transmission of approximately 11 bits/s
  • can be improved using
  • fewer re-transmits
  • error correction
  • multithreading → multiple banks in parallel

42

slide-170
SLIDE 170

Evaluation

  • transmission of approximately 11 bits/s
  • can be improved using
  • fewer re-transmits
  • error correction
  • multithreading → multiple banks in parallel
  • native code: 596 kbit/s cross CPU and cross VM

42

slide-171
SLIDE 171

DRAM side-channel attack

slide-172
SLIDE 172

Conclusion

slide-173
SLIDE 173

Conclusion

  • information leaks because of the underlying hardware

44

slide-174
SLIDE 174

Conclusion

  • information leaks because of the underlying hardware
  • vulnerabilities exploitable at the browser level

44

slide-175
SLIDE 175

Conclusion

  • information leaks because of the underlying hardware
  • vulnerabilities exploitable at the browser level
  • running arbitrary JavaScript allows building high-resolution timers

44

slide-176
SLIDE 176

Conclusion

  • information leaks because of the underlying hardware
  • vulnerabilities exploitable at the browser level
  • running arbitrary JavaScript allows building high-resolution timers
  • hard to mitigate without reducing functionality

44

slide-177
SLIDE 177

Thank you!

Contact clementine@cmaurice.fr @BloodyTangerine

slide-178
SLIDE 178

From bottom to top: Exploiting hardware side channels in web browsers

Cl´ ementine Maurice, Graz University of Technology July 4, 2017—RMLL, Saint-´ Etienne, France