Lucene search

K
hackeroneVanhoefmH1:286740
HistoryNov 02, 2017 - 10:08 p.m.

Internet Bug Bounty: Key Reinstallation Attacks: Breaking WPA2 by forcing nonce reuse

2017-11-0222:08:43
vanhoefm
hackerone.com
201

8.1 High

CVSS3

Attack Vector

ADJACENT_NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

5.8 Medium

CVSS2

Access Vector

ADJACENT_NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:A/AC:L/Au:N/C:P/I:P/A:P

0.002 Low

EPSS

Percentile

52.3%

Full background information is at krackattacks.com and all detailed information can be found in our research paper.

Key Reinstallation Attack: 4-way handshake example

We use the 4-way handshake to illustrate the idea behind key reinstallation attacks (CVE-2017-13077).
Note that in practice, all protected Wi-Fi network rely on the 4-way handshake to derive a fresh session key (PTK) from some shared secret.

Step 1. Channel-based man-in-the-middle and initial handshake messages:

  • The adversary clones the access point (AP) on a different channel. Say the real AP is on channel 6, and it will be cloned on channel 1.
  • The adversary uses Channel Switch Announcements to force victims into connecting to the cloned AP on channel 1.
  • The adversary forwards the first three message of the 4-way handshake between the client and AP (i.e. the adversary fowards frames over the different channels).
  • After the client receives message 3 of the handshake, it will install the fresh session key (PTK) for the first time.

Step 2. Triggering a key reinstallation:

  • The attacker does not forward message 4 of the handshake to the AP, effectively blocking it.
  • As a result, the AP will retransmit message 3 to the client.
  • After the client receives message 3, it responds with message 4. In practice all clients encrypt this retransmitted message 4 at the link layer. Note that itā€™s encrypted because message 4 an ordinary data frame, and the victim has already installed the session key to encrypt data frames (recall end of step 1). The victim will use a nonce value of 1 to encrypt message 4.
  • After sending message 4, the client will reinstall the session key. This resets the transmit nonce to zero.

Step 3. Abusing nonce reuse:

  • When the client now transmit a normal encrypted data frame, it will increment the nonce counter, and then reuse the nonce value 1 when encrypting the data frame.
  • We can derive known keystream from the encrypted retransmitted message 4 (recall step 2), and use this to decrypt parts of the just transmitted encrypted data frame.
  • Other predictable packets (ARP, DHCP, HTML, and so on) can be used to obtain additional known plaintext and keystream, which can in turn be used to decrypt more and bigger packets.

The above example attack against the 4-way handshake is also illustrated in my CCSā€™17 presentation.

Other handshakes

Other Wi-Fi handshakes or features that were found to be vulnerable to key reinstallation attacks are:

  • Reinstallation of group keys in the 4-way handshake: CVE-2017-13078 and CVE-2017-13079
  • The group key handshake: CVE-2017-13080 and CVE-2017-13081
  • The Fast BSS Transition (FT) handshake: CVE-2017-13082
  • The PeerKey handshake: CVE-2017-13084
  • The Tunneled Direct-Link Setup (TDLS) handshake: CVE-2017-13086
  • Handling of Wireless Network Management (WNM) Sleep Mode Response frame: CVE-2017-13087 and CVE-2017-13088.

Countermeasures

Implementations can be updated to prevent key reinstallation attacks in a backwards-compatible manner.

As an additional mitigation, an access point can also prevent most attacks against vulnerable clients.
In particular, attacks against the 4-way handshake can be prevented by not retransmitting message 3.
Similarly, attacks against the group key handshake can be prevented by not retransmitting message 1 of the group key handshake. Alternatively, the access point can retransmit these two handshake messages using the previously used EAPOL-Key replay counter.

Additional Contributions

8.1 High

CVSS3

Attack Vector

ADJACENT_NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

5.8 Medium

CVSS2

Access Vector

ADJACENT_NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:A/AC:L/Au:N/C:P/I:P/A:P

0.002 Low

EPSS

Percentile

52.3%