GHSA-wr79-332c-ff8f: Unbounded DATA datagram in the NetX Duo TFTP server causes an out-of-bounds read and a permanent stall
GHSA ID |
|
|---|---|
CVE ID |
CVE‑2026‑102713 |
Severity |
High |
CWE |
|
Published |
2026‑10‑13 |
Last updated |
2026‑10‑13 |
Affected packages
| Package | Vulnerable versions | Patched versions |
|---|---|---|
NetX Duo |
⇐ 6.5.2.202603 |
6.5.2.202603a |
Description
Summary
The TFTP server never bounds the length of a received DATA datagram. _nx_tftp_server_process_received_data() rejects a datagram shorter than four bytes and nothing anywhere imposes an upper limit, in particular not the protocol maximum of four bytes plus NX_TFTP_FILE_TRANSFER_MAX. One oversized datagram both writes memory from beyond the received packet into the file being uploaded and suspends the server thread permanently.
TFTP has no authentication, the server offers no option to refuse write requests, and the block number check is satisfied by any peer driving its own transfer, so both outcomes are reachable by an unauthenticated peer that can reach the server port.
Details
_nx_tftp_server_data_process() passes the datagram to FileX as nx_packet_length - 4 bytes starting at the first packet’s payload. nx_packet_length is the length of a packet chain, not of one contiguous buffer, so FileX reads past the end of the first packet and into whatever follows it in the packet pool — the control blocks and payloads of adjacent packets, which hold other traffic. Those bytes are written into the file the peer is uploading, and a subsequent read request for that file returns them, so the disclosure has a retrieval channel.
The copy that was meant to prevent this only works at the intended sizing. When the received packet is chained the handler calls nx_packet_copy() to flatten it into the server’s own pool, which the surrounding comment expects to have a payload of at least 560 bytes so that a full 512-byte block fits in one packet. nx_packet_copy() is built on _nx_packet_data_append(), which allocates and chains further packets whenever the data exceeds one pool payload. A datagram larger than the server pool’s payload is therefore copied into a new chain rather than flattened, and the contiguous read happens anyway.
The same call stalls the server. nx_packet_copy() is invoked with NX_WAIT_FOREVER, and that wait is inherited by _nx_packet_data_append(). Once the datagram needs more packets than the pool can supply, the append suspends on the empty pool and never returns, leaving the server thread suspended and no later client served.
The download path already guards against an undersized pool, checking that four bytes plus NX_TFTP_FILE_TRANSFER_MAX fit in an allocated packet before it serves a read request. The upload path has no equivalent check.
The bound is not missing from the upload path either. _nx_tftp_server_data_process() twice tests nx_packet_length - 4 < NX_TFTP_FILE_TRANSFER_MAX, both times to recognise the final short block of a transfer and close the file. The protocol maximum is therefore already in hand at the point the datagram is written to FileX: it is consulted to decide when a transfer ends, and never to reject a datagram that exceeds it.
Impact
An unauthenticated peer that can send UDP to the TFTP server port can read memory beyond the received packet and recover it by downloading the file it just uploaded. The bytes come from adjacent packets in the pool, so they are other clients' traffic rather than attacker-chosen addresses.
The same datagram suspends the server thread for good, ending TFTP availability until the device is restarted. No credentials, prior session, or race are required.
Both outcomes depend on the deployment. The disclosure requires the datagram to exceed the server pool’s payload size, and the stall requires it to exceed what the whole pool can supply, which past roughly one MTU means IP fragment reassembly must be both compiled in and enabled at runtime. Where received packets are never chained, the write stays inside the packet and neither outcome occurs.
Affected configurations
Builds with the TFTP server enabled and packet chaining available, that is without NX_DISABLE_PACKET_CHAIN.
Versions up to and including 6.5.2.202603.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N, 8.3, High. CWE-125 and CWE-770.
AT:P because both outcomes turn on the relationship between the datagram size and the server pool’s geometry, which is a property of the deployment rather than something the attacker selects.
Patches
Fixed in NetX Duo 6.5.2.202603a.
The DATA branch now rejects a datagram longer than four bytes plus NX_TFTP_FILE_TRANSFER_MAX before either the copy or the write, answering it with a TFTP ERROR of ILLEGAL OPERATION and closing the transfer. The copy that flattens a chained datagram now uses a bounded wait rather than NX_WAIT_FOREVER: that call is made on the server’s single thread, so waiting there stalls every client rather than only the sender. No public API changes, so applications need no source change.
Workarounds
Defining NX_DISABLE_PACKET_CHAIN removes both outcomes, at the cost of refusing any datagram larger than one packet. Leaving IP fragment reassembly disabled removes the stall and bounds the disclosure to deployments whose server pool payload is smaller than one MTU. Otherwise, restrict which peers can reach the TFTP server port.