---
id: "CVE-2026-79977"
kind: "vulnerability"
aliases: ["CVE-2026-79977"]
title: "Zephyr WireGuard: unauthenticated packet can redirect tunnel endpoint to attacker"
severity: "high"
cvss: 8.2
epss: 0.00242
exploited: false
status: "open"
category: "infrastructure"
products: []
ecosystems: []
tags: ["embedded", "infrastructure", "iot", "wireguard", "zephyr"]
not_affected_if: ["default-config", "port-filtered", "wireguard-disabled"]
published_at: "2026-10-23T20:17:27+00:00"
first_seen_at: "2026-10-23T21:57:34+00:00"
updated_at: "2026-10-25T12:38:49+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-79977", "first_seen_at": "2026-10-23T21:57:34+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-79977", "first_seen_at": "2026-10-25T12:38:49+00:00"}]
---

# Zephyr WireGuard: unauthenticated packet can redirect tunnel endpoint to attacker

The WireGuard implementation in Zephyr copies the source address of an unauthenticated transport-data packet into the peer endpoint when the receiver index matches no session. A single spoofed UDP datagram to port 51820 moves all tunnel traffic to an attacker-chosen address, causing persistent outage and letting the attacker sit in the path to observe metadata.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the device is built with `CONFIG_WIREGUARD=y` in its Zephyr configuration; the option is experimental and off by default.
- Confirm the Zephyr version in use, e.g. `west list zephyr` or the `VERSION` file, and compare it to the fixed release.
- Check whether UDP port 51820 (or the value of `CONFIG_WIREGUARD_PORT`) is reachable from untrusted networks.

## Fix

- Update Zephyr to a release that includes the fix for CVE-2026-79977 (the fixed version is unknown from the sources).
- Until patched, disable `CONFIG_WIREGUARD` or block UDP `51820` from untrusted networks.

## Timeline

- 2026-10-23T21:57:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-79977
- 2026-10-25T12:38:49+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-79977

## From the sources

The WireGuard VPN service in subsys/net/lib/wireguard/wg.c updated the peer endpoint from a message it could not authenticate. In handle_transport_data(), when the 32-bit receiver index of an incoming transport-data message matched no session, the code both scheduled a new handshake and copied the datagram's source address into peer->endpoint with memcpy(&peer->endpoint, peer_addr, sizeof(peer->endpoint)). Because the receiver index is unknown, there is no key with which such a message could be verified, so the address written into peer->endpoint is entirely attacker-supplied. Every other endpoint update in the implementation happens only after authentication — after the Noise handshake in handle_handshake_init(), or after AEAD decryption plus the anti-replay check in wg_process_data_message().

The WireGuard listener is registered with net_udp_register() using no remote address or port filter and defaults to UDP port 51820 (CONFIG_WIREGUARD_PORT), and wg_ctrl_recv() resolves the peer by interface rather than by any cryptographic identity. Any host able to send a UDP datagram to that port can therefore reach the defect off-path, with no need to observe legitimate traffic: a 16-byte datagram carrying the transport-data type, zeroed reserved bytes and an arbitrary receiver index is sufficient. The vulnerable branch runs whenever the peer has neither a valid handshake nor a current keypair — the state at boot and after a session expires.

A single spoofed datagram redirects peer->endpoint to an address of the attacker's choosing, and all subsequent handshake initiations, keepalives and encrypted data packets are sent there. The legitimate peer never receives the initiations and so never re-authenticates, and nothing resets the endpoint afterwards, leaving the tunnel persistently unusable on devices whose peer does not initiate handshakes itself. The attacker can also relay the redirected initiations to the real peer to place itself in the path of the tunnel, observing ciphertext and traffic metadata and selectively dropping packets. WireGuard's end-to-end cryptography still prevents decryption or forgery of tunnel content, so the impact is loss of availability plus limited confidentiality, not key compromise.

The fix removes the endpoint learning from this path entirely: the stale-session recovery is kept, but the handshake is sent only to an endpoint learnt from an authenticated message, falling back to the configured cfg_endpoint, and the message is dropped when neither is known. CONFIG_WIREGUARD is marked experimental and is not enabled by default.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
