Feb 26, 2026·6 min read·5 visits
A critical zero-click RCE in MediaTek Wi-Fi drivers allows attackers within radio range to compromise devices via malformed packets. Affects OpenWrt, Aruba, and generic MediaTek SDK implementations.
CVE-2026-20408 is a critical heap-based buffer overflow in the MediaTek WLAN SDK that allows adjacent attackers to execute arbitrary code with kernel privileges. Affecting a wide range of devices from OpenWrt routers to enterprise Aruba access points, this 'zero-click' vulnerability resides in the handling of wireless management frames. By broadcasting a malformed packet, an attacker can corrupt heap memory, bypass security mechanisms, and gain full control over the device without any user interaction.
If you've ever wondered why security researchers are paranoid about what's flying through the air, look no further than CVE-2026-20408. This isn't your garden-variety SQL injection sitting behind a WAF; this is a vulnerability that lives in the very air you breathe—or rather, the radio waves your laptop and router breathe. The target? The MediaTek WLAN SDK, the beating heart of millions of Wi-Fi devices, including the popular OpenWrt ecosystem and enterprise-grade gear like Aruba.
The vulnerability is a classic Heap-based Buffer Overflow (CWE-122) manifesting as an Out-of-bounds Write (CWE-787). In simple terms, the driver—running with the highest possible privileges (kernel mode)—blindly trusts the size of the data it receives from the air. It's the digital equivalent of a nightclub bouncer letting in a crowd of 500 people into a room with a fire capacity of 50.
What makes this particularly juicy for an attacker is the vector: Adjacent (AV:A). You don't need to be on the victim's VPN. You don't need their Wi-Fi password. You just need to be in the parking lot with a decent antenna. It is a 'zero-click' exploit, meaning the victim does nothing but exist.
Deep down in the MediaTek driver code, specifically within the routines handling OID (Object Identifier) requests and 802.11 management frames, lies a fatal logic error. The driver is responsible for parsing frames that dictate how the Wi-Fi card behaves. These frames contain variable-length data fields.
The root cause is a failure to sanitize the length of incoming data before performing a memory copy operation. When the driver receives a packet, it reads a length field specified by the attacker. Instead of validating that this length fits into the destination buffer allocated on the heap, the driver says, "Sure, looks good to me," and initiates a memcpy (or NdisMoveMemory).
> [!NOTE]
> Heap vs. Stack: This is a heap overflow, not a stack overflow. Stack overflows are often easier to exploit for simple return-address overwrites (ROP chains). Heap overflows are more complex; they require "grooming" the heap to ensure that when you write past the end of your buffer, you overwrite something critical—like a function pointer in a neighboring object or a net_device structure—rather than just empty garbage data.
Let's look at a reconstruction of the vulnerable logic. While the exact proprietary source code isn't public, the mechanics described in the patch analysis (Patch ID: WCNCR00461651) paint a clear picture. The code likely looked something like this:
// VULNERABLE LOGIC RECONSTRUCTION
int mt76_process_oid(struct mt76_dev *dev, void *data, u32 len) {
// 1. Allocate a fixed-size buffer on the heap (e.g., 1024 bytes)
u8 *heap_buffer = kmalloc(1024, GFP_KERNEL);
if (!heap_buffer) return -ENOMEM;
// 2. THE BUG: Copying 'len' bytes without checking if len > 1024
// 'len' is controlled by the attacker via the packet size
memcpy(heap_buffer, data, len);
// ... process data ...
kfree(heap_buffer);
return 0;
}See the issue? The len parameter comes from the user/attacker. If len is 4096, the memcpy will blast 3072 bytes of data past the end of heap_buffer, overwriting whatever poor kernel structures live next door.
The fix is painfully simple: adding a bounds check.
// PATCHED LOGIC
int mt76_process_oid(struct mt76_dev *dev, void *data, u32 len) {
// 1. Define the limit
#define MAX_CMD_LEN 1024
// 2. THE FIX: Validate length before allocation/copy
if (len > MAX_CMD_LEN) {
pr_err("mt76: invalid OID length %d\n", len);
return -EINVAL;
}
u8 *heap_buffer = kmalloc(MAX_CMD_LEN, GFP_KERNEL);
if (!heap_buffer) return -ENOMEM;
memcpy(heap_buffer, data, len);
// ...
}Exploiting this isn't just about sending a big packet; it's an art form. To turn a crash (DoS) into Remote Code Execution (RCE), the attacker needs to perform Heap Grooming (also known as Heap Feng Shui). The goal is to manipulate the kernel heap layout so that a valuable object is placed immediately after our vulnerable buffer.
Here is the theoretical attack chain:
memcpy runs, overflowing the buffer and overwriting the function pointer in the Victim Object with the address of our shellcode (or a ROP gadget).We aren't talking about stealing cookies here. This is kernel-level execution. If an attacker succeeds, they effectively become the hardware. They can install persistent backdoors in the firmware that survive reboots. They can intercept all traffic passing through the router (passwords, banking data, love letters).
For enterprise environments using affected Aruba APs, this is a nightmare scenario. An attacker sitting in the lobby could compromise an Access Point, use it to pivot into the internal management VLAN, and move laterally through the corporate network. Because the attack happens at the 802.11 layer, traditional firewalls and IDS/IPS systems sitting at the network gateway will never even see the packet.
The remediation is straightforward but operationally painful: you need to update firmware. MediaTek released the fix in Patch ID WCNCR00461651.
For OpenWrt users, this means upgrading to a build that includes the patched mt76 driver (post-February 2026). If you are running a snapshot, opkg update && opkg upgrade might save you, but a full firmware flash is safer to ensure the kernel itself is aligned.
For Enterprise (Aruba, etc.) admins: You are at the mercy of your vendor's patch cycle. Check the February 2026 Security Bulletin immediately. If you cannot patch, your only real mitigation is physical security—keep unauthorized people out of radio range, which, let's be honest, is impossible.
> [!TIP]
> Developer Takeaway: Never, ever trust a length field coming from an external source. Always validate len < sizeof(dest) before copying. Using safer APIs like memcpy_s (if available) or explicit bounds checking is mandatory.
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
MediaTek SDK MediaTek | <= 7.6.7.2 | Post-Feb 2026 Release |
OpenWrt OpenWrt | 19.07 - 23.05 | Snapshot Feb 2026 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-787 (OOB Write) |
| Attack Vector | Adjacent (AV:A) |
| CVSS Score | 8.8 (High) |
| Privileges | Kernel / Ring 0 |
| Impact | RCE / Denial of Service |
| Exploit Status | PoC Expected |
The software writes past the end of the intended buffer in a heap-based memory region, capable of corrupting data, crashing the program, or executing code.