/

CVE-2026-79977

Severity:

HIGH RISK

(8.2)

Unauthenticated Endpoint Update (CWE-346) in WireGuard

CVE-2026-79977

Awaiting Analysis

Vulnerability type

Category:

Improper Authentication of Network Endpoint

CWE:

CWE-306, CWE-346

Impact:

Tunnel Denial of Service and Limited Traffic Confidentiality

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A WireGuard endpoint-handling flaw accepts a peer address from an unauthenticated transport-data message when no matching session exists. A network attacker able to send UDP traffic to the WireGuard listener may redirect subsequent handshakes and tunnel traffic, causing denial of service and potentially exposing traffic metadata through relaying, while WireGuard's cryptography continues to protect tunnel contents.

A WireGuard endpoint-handling flaw accepts a peer address from an unauthenticated transport-data message when no matching session exists. A network attacker able to send UDP traffic to the WireGuard listener may redirect subsequent handshakes and tunnel traffic, causing denial of service and potentially exposing traffic metadata through relaying, while WireGuard's cryptography continues to protect tunnel contents.

Affected context

The issue occurs in WireGuard deployments using the affected experimental implementation when a peer has no valid handshake or current keypair, such as during startup or after session expiration. The listener accepts UDP datagrams without a remote address or port filter, and the vulnerable path updates the peer endpoint before authenticating the message. Deployments in which peers actively initiate authenticated handshakes may reduce persistence of the redirection, but do not eliminate the underlying flaw.

The issue occurs in WireGuard deployments using the affected experimental implementation when a peer has no valid handshake or current keypair, such as during startup or after session expiration. The listener accepts UDP datagrams without a remote address or port filter, and the vulnerable path updates the peer endpoint before authenticating the message. Deployments in which peers actively initiate authenticated handshakes may reduce persistence of the redirection, but do not eliminate the underlying flaw.

Exploit preconditions

  • Attack surface: The WireGuard UDP listener and its transport-data handling path
  • Required access: Ability to send UDP datagrams to the listener's reachable address and port; access to legitimate tunnel traffic is not required
  • Trigger point: Receipt of a transport-data message while the peer lacks a valid handshake or current keypair
  • Why exploitation is possible: The implementation uses the datagram source address to update the peer endpoint before a cryptographic identity or message authentication check succeeds
  • Attack surface: The WireGuard UDP listener and its transport-data handling path
  • Required access: Ability to send UDP datagrams to the listener's reachable address and port; access to legitimate tunnel traffic is not required
  • Trigger point: Receipt of a transport-data message while the peer lacks a valid handshake or current keypair
  • Why exploitation is possible: The implementation uses the datagram source address to update the peer endpoint before a cryptographic identity or message authentication check succeeds

Why this happens

The root cause is an unauthenticated state update in a protocol path that handles messages with an unknown receiver index. When no session key is available, the message cannot be cryptographically verified, yet its source address is copied into the peer endpoint and later used for handshake and data transmission.

This behavior maps primarily to CWE-346: Origin Validation Error, because network-origin information is trusted without validating that it belongs to the authenticated peer. It also relates to CWE-306: Missing Authentication for Critical Function, since changing a routing-critical endpoint is permitted without authentication.

The root cause is an unauthenticated state update in a protocol path that handles messages with an unknown receiver index. When no session key is available, the message cannot be cryptographically verified, yet its source address is copied into the peer endpoint and later used for handshake and data transmission.

This behavior maps primarily to CWE-346: Origin Validation Error, because network-origin information is trusted without validating that it belongs to the authenticated peer. It also relates to CWE-306: Missing Authentication for Critical Function, since changing a routing-critical endpoint is permitted without authentication.

Potential impact

  • An attacker may redirect handshake initiations and encrypted packets away from the legitimate peer.
  • The tunnel could remain unavailable until an authenticated endpoint update or other recovery event occurs.
  • An attacker could selectively drop, delay, or relay redirected traffic.
  • Traffic metadata and communication patterns may be exposed through relay positioning.
  • The attacker should not be able to decrypt or forge tunnel contents solely through this flaw.
  • An attacker may redirect handshake initiations and encrypted packets away from the legitimate peer.
  • The tunnel could remain unavailable until an authenticated endpoint update or other recovery event occurs.
  • An attacker could selectively drop, delay, or relay redirected traffic.
  • Traffic metadata and communication patterns may be exposed through relay positioning.
  • The attacker should not be able to decrypt or forge tunnel contents solely through this flaw.

General mitigation guidance

Mitigation generally focuses on ensuring that endpoint learning is driven only by authenticated protocol state.

Defensive design patterns include:

  • Update peer endpoints only after successful handshake authentication or authenticated, replay-protected data processing.
  • Prefer a configured endpoint when no authenticated endpoint is available.
  • Drop messages that cannot be associated with a valid authenticated session rather than learning routing state from them.
  • Treat packet source addresses as untrusted metadata and avoid using them for security-sensitive state changes.
  • Apply restrictive network policy to the WireGuard listener where operationally appropriate.
  • Run the VPN service with least privilege and monitor unexpected endpoint changes.

Mitigation generally focuses on ensuring that endpoint learning is driven only by authenticated protocol state.

Defensive design patterns include:

  • Update peer endpoints only after successful handshake authentication or authenticated, replay-protected data processing.
  • Prefer a configured endpoint when no authenticated endpoint is available.
  • Drop messages that cannot be associated with a valid authenticated session rather than learning routing state from them.
  • Treat packet source addresses as untrusted metadata and avoid using them for security-sensitive state changes.
  • Apply restrictive network policy to the WireGuard listener where operationally appropriate.
  • Run the VPN service with least privilege and monitor unexpected endpoint changes.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying writes to security-sensitive endpoint or routing state before authentication checks.
  • Code review checks that compare every endpoint update with the protocol's authentication and anti-replay boundaries.
  • Tests that send unauthenticated or unknown-session traffic during startup and key-expiration states and verify that peer endpoints remain unchanged.
  • Runtime telemetry or policy enforcement for unexpected peer endpoint changes, especially changes triggered before a successful handshake.
  • Automated security review tools that flag trust in packet source addresses without cryptographic origin validation.

Organizations can look for this class of issue through:

  • Static analysis rules identifying writes to security-sensitive endpoint or routing state before authentication checks.
  • Code review checks that compare every endpoint update with the protocol's authentication and anti-replay boundaries.
  • Tests that send unauthenticated or unknown-session traffic during startup and key-expiration states and verify that peer endpoints remain unchanged.
  • Runtime telemetry or policy enforcement for unexpected peer endpoint changes, especially changes triggered before a successful handshake.
  • Automated security review tools that flag trust in packet source addresses without cryptographic origin validation.

Sources

SourceLink
github.comgithub.com/zephyrproject-rtos/zephyr/commit/cbaaf3e9dbe08be21f01bd23142e1ffe91fd4db6
github.comgithub.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-w8h4-r8m3-rf5j

Frequently asked

questions

Yes, within the network reachability of the WireGuard UDP listener. An attacker does not need to observe legitimate traffic, but must be able to send datagrams to the exposed listener.

No. WireGuard's authenticated encryption remains in place, so the issue primarily affects availability and may expose traffic metadata if redirected traffic is relayed.

Do not update peer endpoints from unauthenticated messages. Learn endpoints only after successful cryptographic authentication, otherwise use a trusted configured endpoint or discard the message.

Treat all network-derived addresses as untrusted, enforce authentication before security-sensitive state changes, test stale-session and startup paths, and monitor unexpected endpoint transitions.

Yes, within the network reachability of the WireGuard UDP listener. An attacker does not need to observe legitimate traffic, but must be able to send datagrams to the exposed listener.

No. WireGuard's authenticated encryption remains in place, so the issue primarily affects availability and may expose traffic metadata if redirected traffic is relayed.

Do not update peer endpoints from unauthenticated messages. Learn endpoints only after successful cryptographic authentication, otherwise use a trusted configured endpoint or discard the message.

Treat all network-derived addresses as untrusted, enforce authentication before security-sensitive state changes, test stale-session and startup paths, and monitor unexpected endpoint transitions.

Find out what's already
exploitable in your codebase.