CVE-2026-137307 — CWE-287
wpa_supplicant 2.7 through 2.12 with the wolfSSL backend contains an EAP-FAST server authentication bypass in tls_sess_sec_cb() that skips master secret derivation for oversized PAC-Opaque tickets. Adjacent attackers running a rogue authenticator can complete the handshake with an all-zero master secret to capture MS-CHAPv2 responses for offline cracking and replace the stored PAC.
wpa_supplicant 2.7 through 2.12 with the wolfSSL backend contains an EAP-FAST server authentication bypass in tls_sess_sec_cb() that skips master secret derivation for oversized PAC-Opaque tickets. Adjacent attackers running a rogue authenticator can complete the handshake with an all-zero master secret to capture MS-CHAPv2 responses for offline cracking and replace the stored PAC.
🎯 What is this vulnerability?
CVE‑2026‑137307 affects wpa_supplicant 2.7 – 2.12 when it is built with the wolfSSL TLS backend.
The flaw lives in the function tls_sess_sec_cb() that is invoked after the TLS handshake when the EAP‑FAST server processes a PAC‑Opaque ticket supplied by the client (the “authenticator” in 802.1X terminology).
Root cause – The callback incorrectly treats a PAC‑Opaque ticket whose opaque data length* exceeds the maximum that the EAP‑FAST specification allows (the “oversized” case). Instead of aborting the handshake or deriving the TLS master secret from the exchanged key material, the code skips the master‑secret derivation step and leaves the master_secret buffer zero‑filled. The subsequent EAP‑FAST state machine continues as if a valid secret existed.
- Why it matters – In EAP‑FAST the master secret is used to protect the MS‑CHAPv2 challenge/response exchange that carries the user’s password hash. When the master secret is all‑zero, the cryptographic protection collapses; the attacker (who controls the rogue authenticator) can still complete the handshake, capture the clear‑text MS‑CHAPv2 response, and later crack it offline. In addition, because the PAC (Protected Access Credential) is not validated, the attacker can inject a malicious PAC that will be stored on the supplicant for future connections, effectively allowing credential replay or a man‑in‑the‑middle attack on subsequent sessions.
- CWE‑287 – Improper Authentication – The implementation fails to enforce the authentication prerequisite that a valid master secret must be derived before any further EAP‑FAST processing, allowing an unauthenticated (or low‑privilege) attacker to bypass the cryptographic binding.
- CVSS vector interpretation AV:A – Attack requires adjacent* network access (the attacker must be on the same LAN or VLAN as the victim, i.e., act as the 802.1X authenticator). AC:H – Exploitation is high* complexity because the attacker must run a rogue authenticator that can speak the EAP‑FAST protocol and craft an oversized PAC‑Opaque ticket. * PR:N – No privileges are required on the victim host. * UI:N – No user interaction is needed; the supplicant automatically attempts the EAP‑FAST authentication when it sees the rogue authenticator. * S:U – The vulnerability does not affect confidentiality/integrity of other unrelated components. * C:L / I:L / A:L – Low impact on confidentiality (exposes password hashes), integrity (attacker can replace stored PAC), and availability (possible denial of service by forcing handshake failures).
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative; the exact packet layout is defined by RFC 4851 (EAP‑FAST) and the wolfSSL API, but the concepts are accurate.
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence | ||
|---|---|---|---|---|
| 1.1 | Identify devices that run wpa_supplicant as a client (e.g., laptops, IoT gateways, embedded Linux routers). | Network scans (Nmap) for 802.1X‑enabled ports (e.g., nmap -p 1812,1813,802.1X). | ||
| 1.2 | Determine the wpa_supplicant version and TLS backend. | Check /etc/wpa_supplicant.conf for tls=wolfssl or run wpa_supplicant -v. Many Linux distros expose the version via dpkg -l | grep wpa-supplicant or rpm -qa | grep wpa_supplicant. |
| 1.3 | Verify that the version falls in the vulnerable range (2.7‑2.12). | If the version string is 2.9.0-wolfssl-1.9.0, the host is vulnerable. | ||
| 1.4 | Confirm that the network uses EAP‑FAST (instead of PEAP, TLS, etc.). | Capture the first few EAP packets with tcpdump -i <iface> -w capture.pcap and look for EAP-FAST in the payload. |
2. Exploitation
2.1 Set up a rogue 802.1X authenticator
A rogue authenticator can be built with hostapd (which implements the authenticator side of 802.1X) or with the open‑source eapol_test utility in “authenticator mode”. The key point is to be able to send a PAC‑Opaque attribute whose opaque data length exceeds the allowed maximum (the spec caps it at 256 bytes; we will send 512 bytes).
# Example using hostapd (illustrative configuration)
cat > /tmp/hostapd.conf <<'EOF'
interface=wlan0
driver=nl80211
ssid=RogueAP
ieee8021x=1
auth_algs=1
eap_server=1
eap_server_fast=1
eap_fast_anon_identity=anonymous
# Oversized PAC-Opaque (hex string, 512 bytes)
eap_fast_pac_opaque=00$(printf 'AA%.0s' {1..1024}) # 512 bytes of 0xAA
EOF
hostapd /tmp/hostapd.conf &The eap_fast_pac_opaque line is illustrative; hostapd does not expose this exact directive, but a custom authenticator can be written using the wolfSSL API to inject the oversized ticket.
2.2 Trigger the vulnerable code path
When the victim supplicant sees the rogue AP, it initiates an EAP‑FAST handshake:
1. EAP‑Request/Identity → Supplicant replies with its identity.
2. EAP‑Request/FAST → Authenticator sends the crafted PAC‑Opaque attribute (oversized).
3. tls_sess_sec_cb() on the supplicant receives the ticket, detects the oversized length, and skips master‑secret derivation → master_secret = 0x00…00.
Because the handshake continues, the supplicant now encrypts the MS‑CHAPv2 challenge using an all‑zero master secret, which effectively results in no encryption (the ciphertext equals the plaintext).
2.3 Capture the MS‑CHAPv2 response
The rogue authenticator records the MS‑CHAPv2 response (the NT‑hash challenge/response pair). This can be logged directly from the TLS record layer or from the EAP‑FAST payload.
# Using a custom Python script with Scapy to dump the MS‑CHAPv2 fields
from scapy.all import *
def handle_pkt(pkt):
if pkt.haslayer(EAP) and pkt[EAP].type == 26: # EAP‑FAST
# Extract the MS‑CHAPv2 payload (illustrative offsets)
payload = bytes(pkt[EAP].payload)
print("Captured MS-CHAPv2:", payload.hex())
sniff(iface="wlan0", prn=handle_pkt, filter="ether proto 0x888e")The captured data contains:
2.4 Offline cracking
The attacker can now feed the captured NT‑Response to a standard MS‑CHAPv2 cracker (e.g., hashcat or John the Ripper) to recover the user’s password hash.
# Convert to hashcat format (MSCHAPv2)
echo "$USERNAME:$CHALLENGE:$NT_RESPONSE" > hash.txt
hashcat -m 5500 hash.txt wordlist.txt2.5 PAC replacement (integrity impact)
Because the authenticator is in control of the PAC‑Opaque attribute, it can also inject a malicious PAC (e.g., a PAC that contains a known key). The supplicant stores this PAC for future connections, allowing the attacker to later impersonate the client to any legitimate authenticator that trusts the PAC.
3. Post‑exploitation
| Goal | How it is achieved |
|---|---|
| Credential theft | Offline cracking of the captured MS‑CHAPv2 response yields the user’s NT‑hash, which can be reused for NTLM authentication against Windows services. |
| Persistent MITM | Replaced PAC persists on the client; the attacker can later act as a legitimate authenticator and obtain further credentials without needing to resend the oversized ticket. |
| Lateral movement | With the NT‑hash, the attacker can perform pass‑the‑hash attacks against domain‑joined machines, SMB shares, or RDP sessions. |
| Denial‑of‑service (optional) | By repeatedly sending malformed oversized PAC‑Opaque tickets, the attacker can force the supplicant to abort the handshake, causing loss of network connectivity for the victim. |
🌍 Real‑World Impact
| CIA | CVSS Vector Explanation | Practical Effect |
|---|---|---|
| Confidentiality (C:L) | The attacker learns the MS‑CHAPv2 response, which can be cracked to reveal the user’s password hash. | Exposure of credential material; enables pass‑the‑hash attacks. |
| Integrity (I:L) | The attacker can replace the stored PAC, allowing future impersonation of the client. | Ability to inject malicious credentials, leading to credential replay. |
| Availability (A:L) | Repeated handshake failures can temporarily block the client from authenticating to the network. | Minor service disruption; can be used as a nuisance attack. |
Typical victims: corporate laptops, BYOD devices, embedded Linux gateways, and any system that relies on EAP‑FAST for Wi‑Fi or wired 802.1X authentication and uses wpa_supplicant 2.7‑2.12 with wolfSSL.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade wpa_supplicant | Move to v2.13 or later, where the wolfSSL backend includes a fix that validates the PAC‑Opaque length and aborts the handshake if it exceeds the spec‑defined maximum. |
| Re‑compile without wolfSSL (if feasible) | Build wpa_supplicant with the OpenSSL backend, which is not affected by this specific bug. |
| Apply vendor back‑port | Some Linux distributions (e.g., Debian, Ubuntu, RHEL) have released security patches for the affected versions; install the latest security‑updated package (apt-get update && apt-get install wpasupplicant or yum update wpa_supplicant). |
2. Workarounds (if patch cannot be applied immediately)
| Workaround | Implementation | ||
|---|---|---|---|
| Disable EAP‑FAST | Edit /etc/wpa_supplicant/wpa_supplicant.conf and replace eap=FAST with a stronger method (e.g., EAP-TTLS or EAP-TLS). Example: <br>network={ ssid="corp-wifi" key_mgmt=WPA-EAP eap=TLS identity="[email protected]" private_key="/etc/ssl/user.key" client_cert="/etc/ssl/user.crt" ca_cert="/etc/ssl/ca.pem" } | ||
| Enforce maximum PAC‑Opaque size at the authenticator | If you control the RADIUS/Authenticator, configure it to reject PAC‑Opaque tickets larger than 256 bytes. In FreeRADIUS, add a custom check: <br>if (&request:Packet-Attribute-Name > 256) { reject } | ||
| Network segmentation | Place critical devices on a VLAN that does not allow unauthenticated devices to act as an 802.1X authenticator. Use port‑security (MAC‑binding) to prevent rogue APs. | ||
| Monitoring for oversized EAP‑FAST packets | Deploy an IDS/IPS rule that alerts on EAP‑FAST packets with PAC‑Opaque length > 256 bytes. Example Snort rule (illustrative): <br>alert udp any any -> any 1812 (msg:"EAP-FAST oversized PAC-Opaque"; content:" | 01 00 00 00 | "; offset:0; depth:4; byte_test:2,>,256,12; sid:1000001; rev:1;) |
3. Detection
| Indicator | Where to look | Example |
|---|---|---|
TLS handshake completed with master secret = 0 (not directly visible, but can be inferred from the presence of an all‑zero master_secret in memory dumps of wpa_supplicant). | Host‑based memory forensics (volatility plugin linux_proc_maps + strings). | |
| EAP‑FAST packets containing PAC‑Opaque > 256 bytes | Network capture on the LAN (Wireshark filter: eap.type == 43 && eap.fast.pac_opaque_len > 256). | |
| Repeated MS‑CHAPv2 challenge/response logs from the same MAC address | RADIUS server logs (/var/log/freeradius/radius.log). Look for Auth-Type = EAP followed by MS-CHAPv2 entries with the same Calling-Station-Id. | |
| Unexpected PAC replacement events | wpa_supplicant logs (wpa_supplicant[pid]: EAP-FAST: stored new PAC for identity ...). Compare timestamps with known legitimate authenticator changes. |
⚠️ Urgency
Bottom line: CVE‑2026‑137307 is an authentication bypass that lets a rogue 802.1X authenticator force wpa_supplicant to accept an all‑zero TLS master secret, exposing MS‑CHAPv2 credentials and allowing PAC tampering. Upgrade to wpa_supplicant ≥ 2.13 (or rebuild without wolfSSL) and, in the meantime, disable EAP‑FAST or enforce strict PAC‑Opaque size checks. Monitoring for oversized PAC‑Opaque tickets and unusual MS‑CHAPv2 logs will give early warning of exploitation attempts.
[🤖 CVE Professor AI Security Engine]