CVE-2026-10665: Heap buffer overflow on WireGuard receive path via unbounded incoming packet length
In Zephyr's WireGuard subsystem (subsys/net/lib/wireguard), wgprocessdatamessage() in wgcrypto.c linearizes an inbound transport-data payload into a fixed pool buffer of CONFIGWIREGUARDBUFLEN bytes before decryption. The call netbuflinearize(buf->data, datalen, pkt->buffer, ..., datalen) passed the attacker-derived datalen as both the destination capacity and the copy length, defeating the function's internal len = min(len, dstlen) bound. datalen is derived from the received UDP datagram length and is only lower-bounded by wgctrlrecv() (no upper bound). When datalen exceeds CONFIGWIREGUARDBUFLEN — e.g. when the buffer length is lowered below the link MTU, on links with MTU above the buffer size, or via reassembled IPv4/IPv6 fragments that exceed it — the underlying memcpy writes past the end of the pool buffer, an out-of-bounds write (CWE-787). The overflow occurs before the Poly1305 authentication check, so it requires only a valid receiver session index rather than a valid authenticator, and is reachable by a malicious or compromised peer (or an on-path attacker driving an established session) over the network, yielding remote memory corruption and at minimum a reliable denial of service. The defect was present in the WireGuard implementation shipped in Zephyr 4.4.0. The fix adds an explicit datalen > CONFIGWIREGUARDBUFLEN rejection and corrects the linearize call to pass netbufmaxlen(buf) as the destination capacity.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Zephyr WireGuard (subsys/net/lib/wireguard)to a version that resolves this vulnerability.Fixed in 4.4.0 - Configuration
Ensure CONFIG_WIREGUARD_BUF_LEN is large enough for the maximum inbound transport-data payload length; the fix rejects data_len > CONFIG_WIREGUARD_BUF_LEN and prevents the linearize copy from using attacker-controlled length.
Zephyr WireGuard CONFIG_WIREGUARD_BUF_LEN = (no explicit new value provided) - Compensating control
If possible, reduce the maximum UDP payload that can be delivered to WireGuard peers (e.g., by constraining link/MSS/MTU so reassembly/fragmentation cannot produce transport-data payloads larger than CONFIG_WIREGUARD_BUF_LEN).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-10665?
The severity of CVE-2026-10665 is classified as high with a score of 7.4.
What type of vulnerability is CVE-2026-10665?
CVE-2026-10665 is a heap buffer overflow vulnerability that occurs in the WireGuard receive path.
How does CVE-2026-10665 affect the Zephyr Project?
CVE-2026-10665 could lead to potential remote code execution due to improper handling of unbounded incoming packet lengths in the WireGuard subsystem.
How do I fix CVE-2026-10665?
To mitigate CVE-2026-10665, ensure that you are using the latest version of the Zephyr Project that includes the patch for this vulnerability.
What should I do if I am using a vulnerable version related to CVE-2026-10665?
If you are using a vulnerable version of the Zephyr Project, you should immediately update to a patched version to prevent exploitation.