# GotaTun: Oversized UDP datagram can stop default Windows Device reception

Oversized UDP datagram (>4096 bytes) triggers WSAEMSGSIZE on Windows, killing GotaTun's receive worker and halting inbound traffic for all peers until Device rebuild.

- Payout: Research
- Severity: high
- Program: GotaTun
- Found by: zerox80
- Disclosed: 2026-12-04
- CVE: CVE-2026-144412
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-fc57-wfhg-7c2w
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-fc57-wfhg-7c2w
- Tags: area:devices domain:desktop domain:network impact:dos kind:research platform:ghsa sev:high tech:rust tech:windows technique:source-review vuln:dos

**Target:** Windows UDP receive path in gotatun library (BufferedUdpReceive / non-GRO socket)
**Root cause:** The non-GRO Windows receiver reads directly into a 4096-byte PacketBufPool buffer; a larger datagram makes Winsock return WSAEMSGSIZE, which propagates through recv_many_from and terminates the BufferedUdpReceive producer task. DeviceState::handle_incoming then exits its receive loop with Ok(()), bypassing fatal-error registration and never restarting reception.
**Steps:**
1. Configure a Windows Device with default transport (no `windows-gro`), 4096-byte PacketBufPool.
2. Send a single UDP datagram larger than 4096 bytes (e.g. 8192 bytes) to the Device's UDP port.
3. First `recv_from` returns `WSAEMSGSIZE` (10040); producer task in `gotatun/src/udp/buffer.rs` returns from its producer task on the error.
4. Queued packets drain, channel closes, consumer errors; `handle_incoming` returns `Ok(())` before packet verification.
5. Send a subsequent short marker packet: it is never delivered to the Device within 5s (unpatched); patched build continues receiving.
**How found:** Source review of the receive path: noted default 4096-byte pool passed to BufferedUdpReceive, cross-referenced Mio 1.1.1 docs/source preserving WSAEMSGSIZE and Tokio 1.50.0 propagating non-WouldBlock errors, then traced the error through buffer.rs producer termination and device/mod.rs successful task exit; confirmed with native Windows 11 loopback tests (Device data path only; VPN product and recovery by rebuilding not tested).
**Exploitation:** Unauthenticated attacker who can deliver one oversized UDP datagram to the Device's listening port causes persistent loss of inbound handshakes and data for all peers on that Device; service only restored by application rebuilding the connection. Requires network delivery to the port.
**Insight:** When auditing UDP/TUN receive loops, check whether the recv buffer size matches the max datagram the OS can deliver: on Windows any datagram exceeding the buffer yields WSAEMSGSIZE, and a single unhandled recv error that returns Ok(()) from the loop silently kills the worker without triggering fatal-error restart.

