CVE-2026-144412: GotaTun: Oversized UDP datagram can stop default Windows Device reception
Summary
An unauthenticated sender able to deliver a UDP datagram larger than 4096 bytes to a Windows Device using the built-in transport without windows-gro can stop inbound processing for all peers on that Device. Source inspection indicates that the outage lasts until the application rebuilds the connection. A native Windows loopback test reproduced the receive error.
Details
In GotaTun 0.9.2, Connection::setup in gotatun/src/device/mod.rs passes the default 4096-byte PacketBufPool to BufferedUdpReceive. The non-GRO receiver in gotatun/src/udp/socket/windows.rs receives directly into that buffer.
Locked Mio 1.1.1 documents WSAEMSGSIZE when a Windows datagram exceeds the receive buffer, and its source preserves the error. Locked Tokio 1.50.0 retries WouldBlock but propagates other errors. GotaTun's default UdpRecv::recvmanyfrom propagates this error to BufferedUdpReceive::new in gotatun/src/udp/buffer.rs, which returns from its producer task. Once queued packets drain, the closed channel becomes a consumer error.
DeviceState::handleincoming ends its receive loop and returns Ok(()), before the offending input reaches packet verification. That successful exit bypasses fatal-error registration and does not restart reception.
The optional windows-gro Device path uses a 65535-byte batch buffer. Linux uses a different receive implementation. Network filtering can prevent delivery. The affected production paths are unchanged between the v0.9.2 tag and the reviewed revision. Earlier affected versions and a fixed release have not been established.
Proposed fix
The proposed patch is included below for private review. It discards datagrams that produce WSAEMSGSIZE and continues receiving, yielding between retries. Both direct Windows receive methods share this handling. The existing receive-buffer size and source-address mapping are preserved; the optional GRO batch path is unchanged.
The patch changes only gotatun/src/udp/socket/windows.rs. Other receive errors continue to propagate as before.
Patch validation
On Windows, an oversized UDP datagram can make the first receive call return WSAEMSGSIZE (10040). The socket remains usable, but the buffered receive worker exits on that error, interrupting packet delivery to its consumer. Native Windows 11 loopback tests reproduced this behavior and confirmed that the patch allows the next packet to be received.
An additional test on native Windows 11 exercised two peered GotaTun Devices with real loopback UDP sockets and in-process TUN channels. Baseline traffic succeeded in both builds. After a single 8192-byte datagram was sent to one Device’s UDP port, the unpatched build failed to deliver a subsequent packet to that Device within five seconds. With only the Windows receive patch applied, traffic continued in both directions. This covers the Device data path; a VPN product and recovery by rebuilding the Device were not tested.
Source reference
Repository: mullvad/gotatun Reviewed revision: 3e25b63e197d2754f7ca37d55faf1980e033b80a
- gotatun/src/udp/socket/windows.rs:166–176 — Windows receive error - gotatun/src/device/mod.rs:179–197 — Device receiver setup - gotatun/src/packet/pool.rs:20–25 — default buffer size - gotatun/src/udp/mod.rs:84–96 — default batch receive - gotatun/src/udp/buffer.rs:135–147 — producer termination - gotatun/src/udp/buffer.rs:171–178 — closed-channel error - gotatun/src/device/mod.rs:626–639 — receive before verification - gotatun/src/device/mod.rs:752–757 — successful task exit - gotatun/tests/udpoversizeddatagram.rs:24–33 — Windows coverage excluded
<details> <summary>Proposed patch</summary>
diff diff --git a/gotatun/src/udp/socket/windows.rs b/gotatun/src/udp/socket/windows.rs index c031d67..9170003 100644 --- a/gotatun/src/udp/socket/windows.rs +++ b/gotatun/src/udp/socket/windows.rs @@ -163,16 +163,32 @@ impl UdpSend for super::UdpSocket { } } +impl super::UdpSocket { + async fn recvdatagram(&self, pool: &mut PacketBufPool) -> io::Result<(Packet, SocketAddr)> { + let mut buf = pool.get(); + loop { + match self.socket().recvfrom(&mut buf).await { + Ok((n, src)) => { + buf.truncate(n); + return Ok((buf, self.mapsrc(src))); + } + // Winsock discards the remainder of an oversized datagram. The socket + // remains usable; never pass its truncated contents to the protocol. + Err(err) if err.rawoserror() == Some(WinSock::WSAEMSGSIZE) => { + tokio::task::yieldnow().await; + } + Err(err) => return Err(err), + } + } + } +} + #[cfg(not(feature = "windows-gro"))] impl UdpRecv for super::UdpSocket { type RecvManyBuf = (); async fn recvfrom(&mut self, pool: &mut PacketBufPool) -> io::Result<(Packet, SocketAddr)> { - let mut buf = pool.get(); - let (n, src) = self.socket().recvfrom(&mut buf).await?; - buf.truncate(n); - let src = self.mapsrc(src); - Ok((buf, src)) + self.recvdatagram(pool).await } } @@ -210,11 +226,7 @@ mod gro { &mut self, pool: &mut PacketBufPool, ) -> io::Result<(Packet, SocketAddr)> { - let mut buf = pool.get(); - let (n, src) = self.socket().recvfrom(&mut buf).await?; - buf.truncate(n); - let src = self.mapsrc(src); - Ok((buf, src)) + self.recvdatagram(pool).await } async fn recvmanyfrom(
</details>
Proof of concept
A loopback-only test on native Windows 11 sent an 8192-byte UDP datagram followed by a short marker to a 4096-byte receive buffer. On the unpatched direct path, the first receive returned WSAEMSGSIZE (10040); a second receive still obtained the queued marker. In the buffered path, the producer exited on the first error, and the marker never reached the consumer. With the patch, the first direct receive and buffered consumer received complete markers.
Impact
Proposed High severity: persistent loss of inbound handshakes and data for every peer on the affected Device, conditional on delivery and the source-derived Windows behavior. This is not a claim of process-wide failure, code execution, decryption, or key disclosure. Application-driven rebuilding can restore service. The scope is the library configuration described above; exposure of any particular deployed VPN product has not been established.
Other sources
GotaTun is a userspace WireGuard implementation in Rust. Prior to 0.10.0, an unauthenticated sender can deliver a UDP datagram larger than the default 4096-byte PacketBufPool to a Windows Device using the built-in non-windows-gro transport. In gotatun/src/device/mod.rs, Connection::setup passes that pool to BufferedUdpReceive, and gotatun/src/udp/socket/windows.rs propagates the resulting WSAEMSGSIZE receive error. The producer task exits, the channel closes after queued packets drain, and DeviceState::handleincoming returns successfully without recording a fatal error or restarting reception, stopping inbound handshakes and data for all peers. Source inspection indicates that reception remains stopped until the application rebuilds the connection, although recovery by rebuilding was not tested. This issue is fixed in version 0.10.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.10.0
Event History
Frequently Asked Questions
Which deployments are affected?
Affected deployments use GotaTun versions before 0.10.0 on Windows Devices with the built-in non-windows-gro transport. The issue involves the default 4096-byte PacketBufPool.
What access does an attacker need?
An attacker only needs to be able to send a UDP datagram to the affected Windows Device. Authentication, privileges, and user interaction are not required.
What operational impact should operators expect?
After the oversized datagram is received, inbound handshakes and data stop for all peers once queued packets drain. The receive path exits without recording a fatal error or restarting itself.
What can be done if an immediate upgrade is not possible?
Source inspection indicates that rebuilding the connection restores reception, although this recovery was not tested. Upgrade to version 0.10.0 when possible.
How can an operator recognize a potentially affected instance?
A potentially affected instance stops receiving inbound handshakes and peer data while not reporting a fatal receive error. Reception is expected to remain stopped until the application rebuilds the connection.