CVE-2026-102952: TFTP client accepts a transfer from any source, allowing hijack of TFTP get/put
The Zephyr TFTP client in subsys/net/lib/tftp/tftpclient.c does not check where the reply to its request comes from. After sending a read or write request to the configured server, sendrequest() accepts the first UDP datagram that arrives on the client's socket from any address and port. It then calls zsockconnect() to that sender, so the sender becomes the peer for the rest of the transfer. RFC 1350 requires a client to discard datagrams whose source does not match the transfer ID it expects.
A host that can send a UDP datagram to the client's ephemeral port before the real server replies can take over the transfer. It can reply from its own address and does not need to spoof the server. A host on the same network segment that sees the request can do this easily. An off-path attacker must guess the randomized ephemeral port and win the race, which is easier when the server is slow or unreachable. No authentication or user interaction is needed beyond the device starting a transfer through tftpget() or tftpput(), for example from an application or the net tftp shell command.
For tftpget(), the attacker chooses the entire content handed to the application's data callback. For tftpput(), the whole upload buffer is sent to the attacker. There is no memory corruption. TFTP itself has no authentication, and after the fix an attacker who can spoof the server's IP address can still interfere with a transfer. The fix checks the server's address on the first reply and the full address and port on every later datagram, and drops mismatches without using up the transfer's retries.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Zephyr TFTP client, verify the server address on the first reply and the full address and port on every later datagram; drop mismatches without using up the transfer's retries.
Event History
Frequently Asked Questions
Which deployments are most exposed to this issue?
Devices that initiate TFTP reads or writes using tftp_get() or tftp_put(), including through the net tftp shell command, are exposed while a transfer is starting. An attacker on the same network segment that can observe the request can hijack the transfer easily.
What does an attacker need to do to hijack a transfer?
The attacker must send a UDP datagram to the client's ephemeral port before the legitimate TFTP server replies. They do not need to authenticate, interact with a user, or spoof the configured server address.
Can an off-path attacker exploit this?
Yes, but they must guess the randomized ephemeral port and win the race against the legitimate server response. This is easier when the server is slow or unreachable.
What is the impact on TFTP downloads?
For tftp_get(), the attacker controls the entire content delivered to the application's data callback. The provided data does not state further impacts for tftp_put().