A study on NetSpectre

A Study on NetSpectre
@ 若渴 2019.4.14
<ajblane0612@gmail.com>
AjMaChInE
No code can be injected and Attacker
only calls the API via network requests
-> ?
-> leak information (ASLR/ Password)
NetSpectre
Key idea
在程式碼中,找到某些程式碼 (gadget) ,這個
gadget 搭配手法 (attacker-controlled) 會使得
microarchitecture elements 有些 side effect ,而這 side
effect 可以透過一些測量 (measurement) 來觀察,
透過 side effect 與 gadget 搭配可以達到某些目的
(E.g. 推敲出一些重要的訊息 ) 。
● cache-side channel attack
● spectre variant 1
● ...
Cache-side channel attack
– how to retrieve information [0]
e.g. E= (1,…,0,0)
I cache
attacker victim
Cache-side channel attack
– how to retrieve information [0]
Cache-side channel attack
– how to retrieve information [0]
Access
● Gadget
● Montgomery ladder RSA
● Attacker-controlled
● Flush and reload
● Microarchitecture element
● I Cache
● Measure access time
● Purpose
● Secret E
Speculate execution [1]
Speculate execution [1]
Speculate execution [1]
Speculate execution [1]
Assumptions [1]
共用
cache into not
same entry
cache into not
same entry
can reset cache
Spectre-PHT (aka Spectre Variant 1) [1]
Step 1: reset cache
Spectre-PHT (aka Spectre Variant 1) [1]
Step 2: out-of-bounds
read
Spectre-PHT (aka Spectre Variant 1) [1]
* glyph[X] – X is attacker-controlled
* cache-side channel attack
→ cache hit → X=K
→ cache miss → X!=K
Step 3: cache-side
channel attack
Repeatly run step 1 ~ 3 -> leak memory via
byte by byte
● Gadget
●
● Attacker-controlled
● If (x < array1_size)
● array2[X * 4096], array2 is shared memory
● Chache-side channel attack
● Microarchitecture element
● D Cache
● Purpose
● Memory content of out-of-bounds array
NetSpectre - the big picture
● Gadget
● Leak gadget
● Attacker-controlled
● Network API -> x
● Microarchitecture element
● Transmit gadget
● Network latency depends on API execution time (transmit
gadget)
→ Measure the network roundtrip time
● Information
● Memory content of out-of-bounds array
Measuring the response time of a simple transmit gadget,
that accesses a certain variable. Only by performing a large
number of measurements, the difference in the response
timings depending on the cache state of the variable
becomes visible. The average values of the two distributions
are shown as dashed vertical lines [2]
Leaking a byte via bit by bit
[2][3]
Problem - how to find a gadget [2]
● Finding Spectre gadgets is still an open problem
● Out of all papers, only 4 show real-world gadgets [3]
● Among them, only 2 Spectre-PHT (v1) gadgets
● Still no fully automated approach
● Tainted flow analysis
● Gadget
● ??
● Attacker-controlled
● ??
● Microarchitecture element
● ??
● Measure ??
● Purpose
● ??
NetSpectre
ALSR
Network API (x)
A study on NetSpectre
Remote AVX-based covert channel against
cache [2]
Reference
● [0] 2017, Cache Side Channel Attack: Exploitability and
Countermeasures
● [1] 2019, NetSpectre A Truly Remote Spectre Variant
● [2] 2018, NetSpectre: Read Arbitrary Memory over
Network
● [3] 2018, Spectre Attacks: Exploiting Speculative
Execution
1 of 27

More Related Content

What's hot(20)

Careful PackingCareful Packing
Careful Packing
Flavio Toffalini68 views
Spectre & MeltdownSpectre & Meltdown
Spectre & Meltdown
Murray Security Services2.6K views
Troopers15 Lightning talk: VMI & DRAKVUFTroopers15 Lightning talk: VMI & DRAKVUF
Troopers15 Lightning talk: VMI & DRAKVUF
Tamas K Lengyel1.1K views

Similar to A study on NetSpectre(20)

Shall we play a game?Shall we play a game?
Shall we play a game?
Maciej Lasyk519.9K views
Sparksummit2016 shareSparksummit2016 share
Sparksummit2016 share
Ping Yan112 views
OpenTelemetry For DevelopersOpenTelemetry For Developers
OpenTelemetry For Developers
Kevin Brockhoff2.1K views
FALCON.pptxFALCON.pptx
FALCON.pptx
AvinashRanjan8014 views
Monitoring  - deeper diveMonitoring  - deeper dive
Monitoring - deeper dive
Robert Kubiś68 views

Recently uploaded(20)

Green Leaf Consulting: Capabilities DeckGreen Leaf Consulting: Capabilities Deck
Green Leaf Consulting: Capabilities Deck
GreenLeafConsulting170 views
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver23 views
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation23 views

A study on NetSpectre

  • 1. A Study on NetSpectre @ 若渴 2019.4.14 <ajblane0612@gmail.com> AjMaChInE
  • 2. No code can be injected and Attacker only calls the API via network requests -> ? -> leak information (ASLR/ Password) NetSpectre
  • 3. Key idea 在程式碼中,找到某些程式碼 (gadget) ,這個 gadget 搭配手法 (attacker-controlled) 會使得 microarchitecture elements 有些 side effect ,而這 side effect 可以透過一些測量 (measurement) 來觀察, 透過 side effect 與 gadget 搭配可以達到某些目的 (E.g. 推敲出一些重要的訊息 ) 。 ● cache-side channel attack ● spectre variant 1 ● ...
  • 4. Cache-side channel attack – how to retrieve information [0] e.g. E= (1,…,0,0) I cache attacker victim
  • 5. Cache-side channel attack – how to retrieve information [0]
  • 6. Cache-side channel attack – how to retrieve information [0] Access
  • 7. ● Gadget ● Montgomery ladder RSA ● Attacker-controlled ● Flush and reload ● Microarchitecture element ● I Cache ● Measure access time ● Purpose ● Secret E
  • 12. Assumptions [1] 共用 cache into not same entry cache into not same entry can reset cache
  • 13. Spectre-PHT (aka Spectre Variant 1) [1] Step 1: reset cache
  • 14. Spectre-PHT (aka Spectre Variant 1) [1] Step 2: out-of-bounds read
  • 15. Spectre-PHT (aka Spectre Variant 1) [1] * glyph[X] – X is attacker-controlled * cache-side channel attack → cache hit → X=K → cache miss → X!=K Step 3: cache-side channel attack
  • 16. Repeatly run step 1 ~ 3 -> leak memory via byte by byte
  • 17. ● Gadget ● ● Attacker-controlled ● If (x < array1_size) ● array2[X * 4096], array2 is shared memory ● Chache-side channel attack ● Microarchitecture element ● D Cache ● Purpose ● Memory content of out-of-bounds array
  • 18. NetSpectre - the big picture
  • 19. ● Gadget ● Leak gadget ● Attacker-controlled ● Network API -> x ● Microarchitecture element ● Transmit gadget ● Network latency depends on API execution time (transmit gadget) → Measure the network roundtrip time ● Information ● Memory content of out-of-bounds array
  • 20. Measuring the response time of a simple transmit gadget, that accesses a certain variable. Only by performing a large number of measurements, the difference in the response timings depending on the cache state of the variable becomes visible. The average values of the two distributions are shown as dashed vertical lines [2]
  • 21. Leaking a byte via bit by bit [2][3]
  • 22. Problem - how to find a gadget [2] ● Finding Spectre gadgets is still an open problem ● Out of all papers, only 4 show real-world gadgets [3] ● Among them, only 2 Spectre-PHT (v1) gadgets ● Still no fully automated approach ● Tainted flow analysis
  • 23. ● Gadget ● ?? ● Attacker-controlled ● ?? ● Microarchitecture element ● ?? ● Measure ?? ● Purpose ● ??
  • 26. Remote AVX-based covert channel against cache [2]
  • 27. Reference ● [0] 2017, Cache Side Channel Attack: Exploitability and Countermeasures ● [1] 2019, NetSpectre A Truly Remote Spectre Variant ● [2] 2018, NetSpectre: Read Arbitrary Memory over Network ● [3] 2018, Spectre Attacks: Exploiting Speculative Execution