from bottom to top exploiting hardware side channels in
play

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


  1. 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

  2. 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

  3. DRAMA: DRAM Addressing attacks • infer behavior from memory accesses similarly to cache attacks 13

  4. DRAMA: DRAM Addressing attacks • infer behavior from memory accesses similarly to cache attacks • works across VMs, across cores, across CPUs 13

  5. 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

  6. 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

  7. 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

  8. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 14

  9. DRAMA covert channel DRAM bank 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 row buffer 0 0 0 0 0 0 0 0 14

  10. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1: sender transmits 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 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 0 0 0 0 0 0 0 0 14

  11. DRAMA covert channel DRAM bank 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 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 case #1: sender transmits 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sender accesses row j � = i 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 0 0 0 0 0 0 0 0 row buffer 0 0 0 0 0 0 0 0 14

  12. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1: sender transmits 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sender accesses row j � = i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 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 0 0 0 0 0 0 0 0 14

  13. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1: sender transmits 1 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 sender accesses row j � = i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 next receiver access → copy row buffer ... copy 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 0 0 0 0 0 0 0 0 14

  14. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1: sender transmits 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sender accesses row j � = i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 next receiver access → copy row buffer ... → slow 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 0 0 0 0 0 0 0 0 14

  15. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2: sender transmits 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 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 0 0 0 0 0 0 0 0 14

  16. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2: sender transmits 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sender does nothing 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 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 0 0 0 0 0 0 0 0 14

  17. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2: sender transmits 0 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 sender does nothing 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 next receiver access → already in buffer ... 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 0 0 0 0 0 0 0 0 14

  18. DRAMA covert channel DRAM bank 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2: sender transmits 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sender does nothing 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 next receiver access → already in buffer ... → fast 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 0 0 0 0 0 0 0 0 14

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

  20. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 16

  21. DRAMA side-channel attacks DRAM bank spy and victim share a row i 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 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 16

  22. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1 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 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 victim accesses row i , copy to row buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 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 16

  23. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1 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 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 victim accesses row i , copy to row buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 spy accesses row i , no copy ... 0 0 0 0 0 0 0 0 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 16

  24. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 victim accesses row i , copy to row buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 spy accesses row i , no copy ... → fast 0 0 0 0 0 0 0 0 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 16

  25. DRAMA side-channel attacks DRAM bank spy and victim share a row i 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 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 16

  26. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 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 16

  27. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 spy accesses row i , copy to row buffer ... 0 0 0 0 0 0 0 0 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 16

  28. DRAMA side-channel attacks DRAM bank spy and victim share a row i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 case #2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 spy accesses row i , copy to row buffer ... → slow 0 0 0 0 0 0 0 0 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 16

  29. 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 300 Access time 250 200 w w w . f a c e b o o k . c o m 150 0 2 4 10 12 14 6 8 Time in seconds 17

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

  31. Member Rowhammer.js?

  32. DRAM covert channels in JavaScript?

  33. Why JavaScript? • JavaScript is code executed in a sandbox 20

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

  35. 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

  36. 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

  37. 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

  38. Challenges with JavaScript 1. No knowledge about 2. No instruction to 3. No high-resolution physical addresses flush the cache timers 21

  39. #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

  40. #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

  41. #1. Obtaining the beginning of a THP Access time [ns] 10 6 10 4 10 2 0 2 4 10 12 14 6 8 Array index [MB] • 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

  42. #1. Choosing physical addresses • we now know the last 21 bits of physical addresses • enough for most systems, e.g., Sandy Bridge with DDR3 BA0 BA1 BA2 Rank ... 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 ... Ch. 24

  43. #2. No instruction to flush the cache CPU core • measure DRAM timing CPU • only non-cached accesses reach DRAM cache • no clflush instruction → evict data with other memory accesses DRAM 25

  44. #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

  45. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  46. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  47. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  48. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  49. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  50. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  51. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  52. #2. Bypassing the CPU cache: Basic idea • evicting cache line only using memory accesses load cache set D. Gruss et al. “Rowhammer.js: A Remote Sofware-Induced Fault Attack in JavaScript”. In: DIMVA’16 . 2016. 26

  53. #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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend