Dragonblood : Attacking the Dragonfly Handshake of WPA3 Mathy - - PowerPoint PPT Presentation

β–Ά
dragonblood attacking the dragonfly
SMART_READER_LITE
LIVE PREVIEW

Dragonblood : Attacking the Dragonfly Handshake of WPA3 Mathy - - PowerPoint PPT Presentation

Dragonblood : Attacking the Dragonfly Handshake of WPA3 Mathy Vanhoef and Eyal Ronen Black Hat USA. Las Vegas, 7 August 2019. Background: Dragonfly in WPA3 and EAP-pwd = Password Authenticated Key Exchange (PAKE) Negotiate Provide mutual


slide-1
SLIDE 1

Dragonblood: Attacking the Dragonfly Handshake of WPA3

Mathy Vanhoef and Eyal Ronen Black Hat USA. Las Vegas, 7 August 2019.

slide-2
SLIDE 2

Background: Dragonfly in WPA3 and EAP-pwd

2

Negotiate session key Provide mutual authentication

Forward secrecy & prevent offline dictionary attacks Protect against server compromise

= Password Authenticated Key Exchange (PAKE)

slide-3
SLIDE 3

Dragonfly

3

Convert password to group element P Convert password to group element P

Commit phase Confirm phase

Negotiate shared key Confirm peer negotiated same key

slide-4
SLIDE 4

Dragonfly

4

Convert password to group element P Convert password to group element P

Commit phase Confirm phase

Supports two crypto groups:

  • 1. MODP groups
  • 2. Elliptic curves
slide-5
SLIDE 5

What are MODP groups?

οƒ  All operations are MODulo the Prime (= MODP)

5

Operations performed on integers x where: β€Ί x < π‘ž with π‘ž a prime β€Ί π‘¦π‘Ÿ mod π‘ž = 1 must hold β€Ί π‘Ÿ = #elements in the group

slide-6
SLIDE 6

Convert password to MODP element

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: continue P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ return P

6

Convert value to a MODP element

slide-7
SLIDE 7

Convert password to MODP element

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: continue P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ return P

7

Problem for groups 22-24: high chance that value >= p

slide-8
SLIDE 8

Convert password to MODP element

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: ??? P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ return P

8

slide-9
SLIDE 9

Convert password to MODP element

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: continue P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ return P

9

slide-10
SLIDE 10

Convert password to MODP element

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: continue P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ return P

10

#iterations depends on password

slide-11
SLIDE 11

Convert password to MODP element

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: continue P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ return P

11

No timing leak countermeasures, despite warnings by IETF & CFRG! #iterations depends on password

slide-12
SLIDE 12

IETF mailing list in 2010

12

β€œ[..] susceptible to side channel (timing) attacks and may leak the shared password.” β€œnot so sure how important that is [..] doesn't leak the shared password [..] not a trivial attack.”

slide-13
SLIDE 13

Leaked information: #iterations needed

13

Client address addrA Measured

slide-14
SLIDE 14

Leaked information: #iterations needed

14

Client address addrA Measured Password 1 Password 2 Password 3

slide-15
SLIDE 15

Leaked information: #iterations needed

15

Client address addrA Measured Password 1 Password 2 Password 3

slide-16
SLIDE 16

What information is leaked?

for (counter = 1; counter < 256; counter++) value = hash(pw, counter, addr1, addr2) if value >= p: continue P = π‘€π‘π‘šπ‘£π‘“(π‘žβˆ’1)/π‘Ÿ

16

Spoof client address to obtain different execution & leak new data

slide-17
SLIDE 17

Leaked information: #iterations needed

17

Client address addrA addrB Measured Password 1 Password 2 Password 3

slide-18
SLIDE 18

Leaked information: #iterations needed

18

Client address addrA addrB Measured Password 1 Password 2 Password 3

slide-19
SLIDE 19

Leaked information: #iterations needed

19

Client address addrA addrB addrC Measured Password 1 Password 2 Password 3

slide-20
SLIDE 20

Leaked information: #iterations needed

20

Client address addrA addrB addrC Measured Password 1 Password 2 Password 3

slide-21
SLIDE 21

Leaked information: #iterations needed

21

Client address addrA addrB addrC Measured Password 1 Password 2 Password 3

Forms a signature of the password Need ~17 addresses to determine password in RockYou dump

slide-22
SLIDE 22

Raspberry Pi 1 B+: differences are measurable

22

slide-23
SLIDE 23

Raspberry Pi 1 B+: differences are measurable

23

Hostap AP: ~75 measurements / address

slide-24
SLIDE 24

What about elliptic curves?

οƒ  Need to convert password to point (x,y) on the curve

24

Operations performed on points (x, y) where: β€Ί x < π‘ž and y < π‘ž with π‘ž a prime β€Ί 𝑧2 = 𝑦3 + 𝑏𝑦 + 𝑐 mod π‘ž must hold

slide-25
SLIDE 25

Hash-to-curve: EAP-pwd

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: return (x, 𝑦3 + 𝑏𝑦 + 𝑐)

25

EAP-pwd: similar timing leak with elliptic curves

slide-26
SLIDE 26

Hash-to-curve: WPA3 (simplified)

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

26

WPA3: always do 40 loops & return first P

slide-27
SLIDE 27

Hash-to-curve: WPA3 (simplified)

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

27

Problem for Bainpool curves: high chance that x >= p

slide-28
SLIDE 28

Hash-to-curve: WPA3 (simplified)

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

28

Code may be skipped!

slide-29
SLIDE 29

Hash-to-curve: WPA3 (simplified)

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

29

#Times skipped depends on password

slide-30
SLIDE 30

Hash-to-curve: WPA3 (simplified)

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

30

οƒ  simplified, execution time for several client MAC addresses forms a signature of the password.

slide-31
SLIDE 31

31

Cache Attacks

slide-32
SLIDE 32

NIST Elliptic Curves

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

32

Monitor using Flush+Reload to know in which iteration we are NIST curves: use Flush+Reload to detect when code is executed

slide-33
SLIDE 33

Bainpool Elliptic Curves

for (counter = 1; counter < 40; counter++) x = hash(pw, counter, addr1, addr2) if x >= p: continue if square_root_exists(x) and not P: P = (x, 𝑦3 + 𝑏𝑦 + 𝑐) return P

33

Monitor using Flush+Reload to know in which iteration we are Brainpool curves: use Flush+Reload to detect when code is executed

slide-34
SLIDE 34

Cache-attacks in practice

Requires powerfull adversary: β€Ί Run unpriviliged code on victim’s machine β€Ί Act as malicious client/AP within range of victim

34

Abuse leaked info to recover the password β€Ί Spoof various client addresses similar to timing attack β€Ί Use resulting password signature in dictionary attack

slide-35
SLIDE 35

Attack Optimizations

Timing & cache attack result in password signature β€Ί Both use the same brute-force algorithm Improve performance using GPU code: β€Ί We can brute-force 𝟐𝟏𝟐𝟏 passwords for $1 β€Ί MODP / Brainpool: all 8 symbols costs $67 β€Ί NIST curves: all 8 symbols costs $14k

35

slide-36
SLIDE 36

Implementation Inspection

36

slide-37
SLIDE 37

Invalid Curve Attack

37

Commit(x’, y’)

Point isn’t on curve

Negotiated key is predictable

slide-38
SLIDE 38

Invalid Curve Attack

38

Commit(x’, y’) Commit reply

Point isn’t on curve

Negotiated key is predictable Guess key and send confirm Confirm phase

slide-39
SLIDE 39

Invalid Curve Attack

39

Commit(x’, y’) Commit reply

Point isn’t on curve

Negotiated key is predictable Guess key and send confirm Confirm phase

Bypasses authentication

  • EAP-pwd: all implementations affected
  • WPA3: only iwd is vulnerable
slide-40
SLIDE 40

Implementation Vulnerabilities II

40

Bad randomness: β€Ί Can recover password element P β€Ί Aruba’s EAP-pwd client for Windows is affected β€Ί With WPA2 bad randomness has lower impact! Side-channels: β€Ί FreeRADIUS aborts if >10 iterations are needed β€Ί Aruba’s EAP-pwd aborts if >30 are needed β€Ί Can use leaked info to recover password

slide-41
SLIDE 41

Wi-Fi Specific Attacks

41

slide-42
SLIDE 42

Denial-of-Service Attack

42

Convert password to group element P Convert password to group element P

AP converts password to EC point when client connects

β€Ί Conversion is computationally expensive (40 iterations) β€Ί Forging 8 connections/sec saturates AP’s CPU

slide-43
SLIDE 43

Downgrade Against WPA3-Transition

Transition mode: WPA2/3 use the same password β€Ί WPA2’s handshake detects downgrades οƒ  forward secrecy β€Ί Performing partial WPA2 handshake οƒ  dictionary attacks Solution is to remember which networks support WPA3 β€Ί Similar to trust on first use of SSH & HSTS β€Ί Implemented by Pixel 3 and Linux’s NetworkManager

43

slide-44
SLIDE 44

Crypto Group Downgrade

Handshake can be performed with multiple curves β€Ί Initiator proposes curve & responder accepts/rejects β€Ί Spoof reject messages to downgrade used curve

44

= design flaw, all client & AP implementations vulnerable

slide-45
SLIDE 45

45

Disclosure

slide-46
SLIDE 46

Disclosure process

Notified parties early with hope to influence WPA3 β€Ί Some initially sceptic, considered it implementation flaws β€Ί Group downgrade: β€œwas known, but forgot to warn about it” Reaction of the Wi-Fi Alliance β€Ί Privately created backwards-compatible security guidelines β€Ί 2nd disclosure round to address Brainpool side-channels

46

slide-47
SLIDE 47

Fundamental issue still unsolved

β€Ί On lightweight devices, doing 40 iterations is too costly β€Ί Even powerfull devices are at risk: handshake might be

  • ffloaded the lightweight Wi-Fi chip itself

47

!

Wi-Fi standard now being updated β€Ί Prevent crypto group downgrade attack β€Ί Allow offline computation of password element

slide-48
SLIDE 48

Additional upates to Wi-Fi standard

48

Elliptic curve groups: β€Ί Restrict usage of weak elliptic curves β€Ί Constant-time algo (simplified SWU)

MODP crypto groups: β€Ί Restrict usage of weak MODP groups β€Ί Constant-time algo (modulo intead of iterations)

slide-49
SLIDE 49

Updates aren’t backwards-compatible

Might lead to WPA3.1? β€Ί Not yet clear how this will be handled β€Ί Risk of downgrade attacks to original WPA3

49

Will people be able to easily attack WPA3? β€Ί No, WPA3 > WPA2 even with its flaws β€Ί Timing leaks: non-trival to determine if vulnerable

slide-50
SLIDE 50

Conclusion

β€Ί WPA3 vulnerable to side-channels β€Ί Countermeasures are costly β€Ί Standard now being updated β€Ί WPA3 > WPA2 & planned updates are strong https://wpa3.mathyvanhoef.com

50