Weaknesses in WPA3's Dragonfly Handshake
Mathy Vanhoef (Postdoctoral Researcher · New York University Abu Dhabi)
BruCON 0x0B · Day 2
Overview
This talk, delivered by Mathy Vanhoef, a Postdoctoral Researcher at New York University Abu Dhabi, delves into critical cryptographic weaknesses discovered in the Dragonfly Handshake, the foundational Password Authenticated Key Exchange (PAKE) protocol used in WPA3 and the EPWD enterprise Wi-Fi standard. The presentation, which earned a Pwnie Award for "Best Cryptographic Attack," meticulously details various side-channel attacks, implementation flaws, and downgrade vulnerabilities that undermine WPA3's core security promises. Specifically, the research demonstrates how WPA3, despite being designed to prevent offline dictionary attacks, is susceptible to them through timing and cache-based side channels.

Key moments
- 0:00 Introduction and Pwnie Award for WPA3 weaknesses
- 2:10 Dragonfly Handshake: Goals, Properties, and Password Storage
- 8:40 The Core Timing Attack: Password to Group Element
- 17:40 Practical Timing Attack: Brute-Forcing Passwords with MAC Spoofing
- 28:00 WPA3's Elliptic Curve Countermeasure Fails for Brainpool
- 40:00 Critical Implementation Flaws: Invalid Curve Attacks & Predictable Randomness
- 48:00 DoS, Downgrade Attacks, Standard Updates & WPA3 Conclusion
Weaknesses in WPA3's Dragonfly Handshake
Speakers: Mathy Vanhoef, Postdoctoral Researcher, New York University Abu Dhabi
Conference: BruCON
YouTube: https://www.youtube.com/watch?v=uzN7twQbEdQ
Overview
This talk, delivered by Mathy Vanhoef, a Postdoctoral Researcher at New York University Abu Dhabi, delves into critical cryptographic weaknesses discovered in the Dragonfly Handshake, the foundational Password Authenticated Key Exchange (PAKE) protocol used in WPA3 and the EPW_D enterprise Wi-Fi standard. The presentation, which earned a Pwnie Award for "Best Cryptographic Attack," meticulously details various side-channel attacks, implementation flaws, and downgrade vulnerabilities that undermine WPA3's core security promises. Specifically, the research demonstrates how WPA3, despite being designed to prevent offline dictionary attacks, is susceptible to them through timing and cache-based side channels.
WPA3 was introduced as the successor to WPA2, aiming to address long-standing security deficiencies, most notably WPA2's vulnerability to offline dictionary attacks where an attacker could passively capture a handshake and brute-force the password without further interaction. The Dragonfly Handshake was intended to provide mutual authentication, negotiate a fresh session key, and crucially, ensure forward secrecy and dictionary attack resistance. However, Vanhoef's work reveals that the initial WPA3 specification and its early implementations failed to robustly deliver on these promises, introducing new avenues for adversaries to deduce network passwords and even bypass authentication in certain scenarios.
The significance of this research cannot be overstated. WPA3 is the future of Wi-Fi security, and vulnerabilities at its cryptographic core pose a substantial threat to wireless network integrity. The talk highlights how known cryptographic pitfalls, such as non-constant-time operations, were either overlooked or dismissed during the protocol's design phase, leading to fundamental flaws. While the Wi-Fi Alliance has initiated updates to address these issues, the findings serve as a stark reminder of the complexities involved in designing secure cryptographic protocols and the importance of rigorous security analysis before widespread deployment.
Background
▶ Watch: Introduction and Pwnie Award for WPA3 weaknesses (0:00)
The evolution of Wi-Fi security protocols has been a continuous race against increasingly sophisticated attacks. WPA2, prevalent for many years, suffers from a critical flaw: an attacker can passively capture the four-way handshake and perform offline dictionary attacks or brute-force attempts to discover the network password. This means that even a strong password can eventually be cracked given enough computational resources and a sufficiently large dictionary.
To counter this, the Wi-Fi Alliance introduced WPA3, which relies on the Dragonfly Handshake, a type of Password Authenticated Key Exchange (PAKE). A PAKE protocol is designed to establish a shared cryptographic key between two parties who share a low-entropy secret (like a password) without revealing the password itself to an eavesdropper, even if the key exchange is monitored. Key properties of Dragonfly, as intended for WPA3, include:
- Mutual Authentication: Both the client and the access point (AP) prove knowledge of the password.
- Session Key Negotiation: A unique, fresh key is generated for each session to encrypt subsequent data traffic.
- Forward Secrecy: Compromise of the long-term password does not compromise past session keys. If an attacker captures traffic today and learns the password a year later, they cannot decrypt the old traffic.
- Dictionary Attack Resistance: This is the primary improvement WPA3 aimed for. Unlike WPA2, passively captured WPA3 handshakes should not be usable for offline dictionary or brute-force attacks.
However, Vanhoef points out a crucial property that Dragonfly lacks: protection against server compromise. In WPA3, both the client and the AP must store a plaintext version of the password. This means if an AP or client is compromised, the plaintext password is leaked, unlike some other PAKE protocols that can operate with salted password hashes.
The fundamental step in the Dragonfly handshake is the conversion of a human-readable plaintext password into a group element P, a mathematical object suitable for cryptographic operations. This conversion process is critical, as it directly impacts the security of the subsequent key exchange. Dragonfly can operate over two different cryptographic groups: Mod P groups (finite fields of integers modulo a prime) or elliptic curves. As detailed in the talk, the specific algorithms used for this password-to-group-element conversion, particularly for Mod P groups and Brainpool elliptic curves, introduce the very vulnerabilities WPA3 was designed to prevent.
Key Findings
▶ Watch: The Core Timing Attack: Password to Group Element (8:40)
The research uncovered a range of vulnerabilities in WPA3's Dragonfly Handshake, broadly categorized into side-channel attacks, implementation flaws, and denial-of-service/downgrade attacks. These findings collectively demonstrate that the initial WPA3 specification and its implementations failed to provide the robust security promised, particularly concerning dictionary attack resistance.
- Timing Side-Channels in Password-to-Group-Element Conversion:
- The core discovery is that the algorithm for converting a plaintext password into a cryptographic group element (P) is not constant-time. For Mod P groups and EPW_D's use of elliptic curves, the number of iterations required for this conversion depends directly on the password itself. This creates a timing side-channel, allowing an attacker to deduce information about the password by measuring the execution time of the AP's handshake process.
- Crucially, this vulnerability was reportedly known and warned about by the IETF and CFRG mailing lists as early as 2010 but was dismissed by designers as not serious or trivial to exploit.
- Even WPA3's attempted countermeasure for elliptic curves (always performing 40 iterations) was bypassed for Brainpool curves due to an additional conditional check (
if X >= P), reintroducing a timing leak.
- Cache Attacks (Flush+Reload):
- Beyond timing, the talk describes cache-timing attacks using techniques like Flush+Reload. An attacker can monitor CPU cache behavior to determine precisely which iteration of the password conversion algorithm a solution was found.
- While requiring a more powerful adversary (e.g., unprivileged code execution on the victim's machine, like a malicious app on a smartphone or JavaScript in an old browser), these attacks provide even more precise information to build a password "signature."
- Feasible Offline Dictionary and Brute-Force Attacks:
- The information gleaned from timing and cache attacks (the number of iterations needed for a given password and client MAC address) forms a unique "signature" of the password.
- By spoofing multiple client MAC addresses and repeating the timing/cache measurements, an adversary can gather enough signatures to significantly prune a dictionary of potential passwords. For instance, determining a password from the RockYou database requires an average of only 17 spoofed MAC addresses.
- The computational cost of these offline attacks is surprisingly low: a dictionary of 10^10 passwords (exceeding common password dumps and English dictionaries) can be processed for less than $1 on Amazon EC2. A full 8-character brute-force attack against Mod P or Brainpool groups costs less than $70, while NIST curves are more expensive at $14,000, still deemed unacceptable for a modern crypto protocol.
- Implementation-Specific Flaws:
- Invalid Curve Attacks: Several EPW_D implementations (and one WPA3 variant) were found to not validate if received elliptic curve points were actually on the curve. This allowed an attacker to craft specific points, reducing the possible session keys to a very small set (e.g., 3 values), leading to a complete authentication bypass with over 60% success rate. All tested EPW_D implementations were vulnerable unless using a newer OpenSSL version.
- Predictable Random Numbers: The Aruba EPW_D implementation used predictable random numbers. In WPA3, a bad source of randomness allows an attacker to recover the password's group element P, effectively revealing the password and enabling network access. This is a significant risk for resource-constrained IoT devices.
- Premature Handshake Aborts: FreeRADIUS's EPW_D implementation aborts the handshake if more than 10 iterations are needed for password conversion. This abort itself acts as a timing side-channel, leaking information about the password and enabling dictionary attacks. Aruba had a similar, but harder to exploit, issue at 30 iterations.
- Denial of Service (DoS) Vulnerability:
- The computational intensity of the password-to-group-element conversion, especially when countermeasures (like 40 fixed iterations) are implemented for security, makes WPA3 vulnerable to DoS.
- Professional WPA3 APs using the most secure elliptic curves could be saturated (100% CPU usage) with just 8 connection attempts per second, making them highly susceptible to DoS attacks.
- Downgrade Attacks:
- WPA3 Transition Mode Downgrade: When an AP supports both WPA2 and WPA3 (transition mode), an adversary can still perform a man-in-the-middle attack to downgrade clients to WPA2. Even though the WPA2 handshake might eventually be aborted by the client (due to WPA3 support), enough information is leaked to perform an old-school WPA2 dictionary attack.
- Cryptographic Group Downgrade: The negotiation mechanism for cryptographic groups (Mod P vs. elliptic curves) is vulnerable. An attacker can spoof reject messages to force a client or AP into using a less secure group, which might be more susceptible to other attacks.
- Implementation-Specific Client Downgrade: Certain client devices (e.g., Galaxy S10, Linux iwd client) would happily connect to a WPA2 network if it had the same SSID, even after previously connecting to a WPA3-only network. This allowed attackers to force WPA3-capable clients back to WPA2.
Technical Deep Dive
▶ Watch: Practical Timing Attack: Brute-Forcing Passwords with MAC Spoofing (17:40)
The core of WPA3's Dragonfly handshake relies on converting a human-readable password into a mathematical group element P. This process is where most of the discussed vulnerabilities originate. The algorithm involves hashing the password along with the MAC addresses of the client and AP, and a counter. The output of this hash is then processed to ensure it's a valid element within the chosen cryptographic group (either Mod P or elliptic curve).
For Mod P groups, where all operations are performed modulo a large prime P, the initial naive approach was to hash (password || counter || MACs) and interpret the result as an integer. However, a critical issue arises if this integer output is greater than or equal to the prime P. This scenario can introduce biases in the cryptographic calculations. The proposed fix was to introduce a loop: if the hash output value was value >= P, the counter would increment, and the hash function would be re-executed until value < P.
This "fix" introduced a fatal timing side-channel. The number of iterations required to find a valid value directly depends on the password. A password that quickly yields a value < P will require fewer iterations and thus less execution time than a password that requires multiple iterations. This variable execution time, even if very slight, can be measured by an attacker. This exact issue was flagged by cryptographic experts on the IETF and CFRG mailing lists in 2010 when the Dragonfly handshake was first proposed, but their concerns were unfortunately dismissed.
For elliptic curves, the process is similar. The hash output is treated as the x-coordinate of a point. Then, a corresponding y-coordinate is calculated. If no valid y-coordinate exists (e.g., taking the square root of a negative number in the field), the process iterates with an incremented counter. The EPW_D protocol, which also uses Dragonfly, implements this without specific timing attack countermeasures, making it vulnerable to the same timing leak as the Mod P groups.
WPA3, recognizing the potential for timing leaks in elliptic curves, attempted a countermeasure: always executing 40 iterations of the conversion algorithm. The idea was to find the first valid point P, assign it, but then continue executing 39 additional "dummy" iterations to ensure a constant execution time, regardless of when the actual solution was found. This number 40 was chosen because the probability of needing more than 40 iterations is extremely low. However, this countermeasure is flawed when using Brainpool curves. For these curves, an additional check if X >= P is performed on the x-coordinate. If X is too large, the remaining (computationally intensive) parts of the loop are skipped, leading to a shorter execution time. This reintroduces a timing leak, as the number of times this block is skipped again depends on the password.
The exploitation of these timing leaks is practical. Vanhoef demonstrated this using a Raspberry Pi 1B running hostapd, a common configuration for home routers. By initiating incomplete WPA3 handshakes, the attacker can measure the response time of the AP. The talk showed a clear distinction in response times between handshakes requiring one iteration versus two iterations. To determine the exact number of iterations with high probability against this setup, an attacker needs approximately 75 timing measurements (incomplete handshakes).
Once an attacker can reliably measure the iteration count for a given password and client MAC address, they can build a "signature" of the password. To overcome the influence of the MAC address in the hash function, the attacker can spoof multiple client MAC addresses. By repeating the timing attack for different spoofed MACs, they gather more information. For a password in the RockYou database, an average of 17 spoofed MAC addresses is sufficient to uniquely determine the password. This allows for highly efficient offline dictionary attacks. The talk highlights that GPU-optimized attacks can iterate through a dictionary of 10^10 passwords for less than $1 on Amazon EC2, and a full 8-character brute-force attack against Mod P or Brainpool groups costs less than $70.
Beyond timing, cache attacks (specifically Flush+Reload) offer an even more granular side-channel. By monitoring the CPU cache, an attacker can detect precisely when specific code blocks within the password conversion algorithm are executed, including the hash function and the solution-finding logic. This allows the attacker to determine the exact iteration in which a valid group element P was found, providing a powerful "signature" for offline brute-forcing. While requiring a more privileged adversary (e.g., running unprivileged code on the victim's machine, or even JavaScript in an old browser), it demonstrates a fundamental cryptographic weakness.
Demo / Proof of Concept
▶ Watch: Critical Implementation Flaws: Invalid Curve Attacks & Predictable Randomness (40:00)
The talk included a clear demonstration of the feasibility of the timing attack in a real-world scenario. The speaker described setting up a test environment using a Raspberry Pi 1B running hostapd, an open-source access point implementation widely used in Linux, Android, and many home routers. The Raspberry Pi 1B was chosen because its CPU performance is comparable to that of typical home routers and some professional access points, making it a realistic target for such attacks.
The core of the demonstration involved showing that the variable execution time of the password-to-group-element conversion algorithm could be reliably measured. The speaker presented a graph illustrating a clear and measurable difference in response times between the access point needing one iteration versus two iterations to convert the password. The orange line, representing two iterations, consistently showed a longer response time than the blue line for one iteration.
Quantitatively, the research found that an adversary needed to perform approximately 75 incomplete WPA3 handshake attempts to determine the number of iterations executed by the access point with a high probability. This was achieved even in an "average day environment" (the speaker's apartment), indicating that the attack is robust enough to work outside of controlled lab conditions with minimal noise.
The overall attack flow, demonstrated conceptually, involved:
- Initial Measurement: An attacker initiates an incomplete WPA3 handshake with the target access point using a client with a specific MAC address (e.g., MAC address A). They then perform timing measurements to determine how many iterations the AP's password conversion algorithm required.
- Offline Filtering: With this iteration count (e.g., two iterations), the attacker takes a dictionary of potential passwords and, on their own offline machine, simulates the password conversion algorithm for each password using MAC address A. Any password that doesn't yield two iterations is immediately discarded.
- MAC Address Spoofing: To further narrow down the possibilities, the attacker spoofs a different client MAC address (e.g., MAC address B) and repeats the timing measurement against the AP. This provides a new iteration count.
- Further Filtering: The attacker then takes the remaining possible passwords from the previous step and simulates the conversion with MAC address B. Passwords that don't match the newly observed iteration count are again discarded.
- Iterative Refinement: This process is repeated. The research found that, on average, spoofing approximately 17 different client MAC addresses is sufficient to uniquely determine a password from a database like RockYou. Each new MAC address measurement effectively eliminates roughly half of the remaining candidate passwords.
This proof-of-concept effectively validated that the timing side-channel is not merely a theoretical flaw but a practical vulnerability that can be exploited to recover WPA3 passwords through offline dictionary attacks, directly contradicting WPA3's primary security guarantee.
Defensive Implications
▶ Watch: DoS, Downgrade Attacks, Standard Updates & WPA3 Conclusion (48:00)
The findings presented in this talk have significant implications for both Wi-Fi users and manufacturers. While the vulnerabilities are serious, it's crucial to understand the immediate and long-term defensive strategies.
Immediate User Action:
- Use WPA3 if available: Despite the flaws, the speaker strongly emphasizes that WPA3 is still better than WPA2. The attacks described are more complex and resource-intensive than WPA2's passive capture and offline dictionary attacks. WPA2 requires only passive sniffing, whereas WPA3 attacks require active interaction and sophisticated side-channel exploitation. Therefore, users should enable WPA3 on their devices and networks if supported.
Vendor and Standard Body Responsibilities:
- Constant-Time Cryptography: The most critical implication is the absolute necessity of implementing cryptographic operations in a constant-time manner. This means that the execution time of sensitive operations (like password conversion) must not depend on secret values (like the password itself). The Wi-Fi Alliance is already updating the standard to include a new, constant-time algorithm for password-to-group-element conversion for both Mod P and elliptic curve groups.
- Input Validation: Implementations must rigorously validate all cryptographic inputs. The widespread vulnerability to invalid curve attacks in EPW_D implementations highlights the danger of skipping checks to ensure received points actually lie on the specified elliptic curve. Newer versions of OpenSSL already incorporate these defensive checks.
- Strong Randomness: Devices, especially resource-constrained IoT devices, must use high-quality, unpredictable sources of randomness. The discovery of predictable random numbers in Aruba's EPW_D implementation, leading to password recovery, underscores this fundamental cryptographic requirement.
- Avoid Aborting Handshakes on Iteration Count: Prematurely aborting handshakes based on the number of iterations required for password conversion (as seen in FreeRADIUS and Aruba) creates an inadvertent side-channel. Implementations should avoid such behavior.
- Downgrade Protection:
- Trust on First Use (TOFU): Clients should implement mechanisms similar to SSH's TOFU or HTTPS's Strict Transport Security. If a client has previously connected to a network using WPA3, it should refuse to downgrade to WPA2 for that same network in the future. The Linux Network Manager and Pixel 3 smartphones are already implementing this defense.
- Secure Group Negotiation: The negotiation of cryptographic groups (Mod P vs. elliptic curves) must be robust against spoofing. The standard is being updated with clearer guidelines on which groups are secure and which are weak, and the negotiation process needs to be secured to prevent attackers from forcing clients into weaker groups.
- Patch Client-Side Downgrade Bugs: Client-specific downgrade vulnerabilities (e.g., Galaxy S10, iwd client connecting to WPA2 after WPA3-only network) must be patched promptly.
Long-Term Outlook:
- The Wi-Fi standard is being updated (potentially leading to WPA3.1), addressing many of the identified design flaws. This includes the constant-time password derivation algorithm and clearer guidelines for cryptographic group usage.
- However, a lingering risk remains: the possibility of **downgrade attacks to the first version of WPA3**, even with updated standards. This would allow an attacker to exploit the vulnerabilities present in the original specification.
- The speaker's expectation is that most vendors will quickly patch these flaws, especially given that the new constant-time algorithm is also more efficient, providing a strong incentive for adoption. This proactive patching could make these specific dictionary and brute-force attacks impractical for real-world adversaries.
In essence, while WPA3 had a rocky start with these vulnerabilities, the security community's rapid identification and the Wi-Fi Alliance's commitment to updates are pushing towards a more secure wireless ecosystem. Vigilance in implementation and deployment, however, remains paramount.
Key Takeaways
- WPA3's Dragonfly Handshake is vulnerable to side-channel attacks: The protocol's initial design for converting passwords to cryptographic group elements was not constant-time, leading to timing and cache leaks.
- Dictionary attacks are feasible against WPA3: By measuring the variable execution time (or observing cache behavior) of the access point's password conversion, an attacker can build a unique "signature" of the password, enabling efficient offline dictionary and brute-force attacks.
- Known cryptographic pitfalls were overlooked: The timing leak in the password conversion algorithm was warned about by cryptographic experts as early as 2010 but was dismissed, highlighting a critical failure in the design review process.
- Implementation flaws add to the insecurity: Invalid curve attacks in EPW_D (and some WPA3 variants) allowed authentication bypass, while predictable random numbers and premature handshake aborts further compromised security.
- Denial of Service and Downgrade attacks are present: WPA3 is susceptible to DoS due to the computational cost of the handshake, and various downgrade attacks can force clients into weaker WPA2 modes or less secure cryptographic groups.
- WPA3 is still better than WPA2, and fixes are underway: Despite these significant vulnerabilities, WPA3 remains a more secure choice than WPA2. The Wi-Fi Alliance is updating the standard with constant-time algorithms and clearer guidelines, and vendors are patching existing implementations.
About the Speaker(s)
Mathy Vanhoef is a Postdoctoral Researcher at New York University Abu Dhabi. His research primarily focuses on wireless security, with a strong emphasis on uncovering and analyzing vulnerabilities in Wi-Fi protocols. He is widely recognized for his significant contributions to the field, including his discovery of the KRACK attacks against WPA2. His work on the weaknesses in WPA3's Dragonfly Handshake earned him a prestigious Pwnie Award for "Best Cryptographic Attack," underscoring the impact and technical depth of his research in identifying critical flaws in modern cryptographic protocols. He is a frequent speaker at major security conferences, sharing his findings and insights with the broader cybersecurity community.
Reviews
- Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★
- Heather Calloway (CISO) — MUST SEE ★★★★★