GHSA-wvc9-5m9h-rvxc: TFTP client and server copy the ERROR packet message without bounding the read against the packet
GHSA ID |
|
|---|---|
CVE ID |
CVE‑2026‑102721 |
Severity |
Medium |
CWE |
|
Published |
2026‑11‑01 |
Last updated |
2026‑11‑01 |
Affected packages
| Package | Vulnerable versions | Patched versions |
|---|---|---|
NetX Duo |
>= 6.0, ⇐ 6.5.2.202603a |
6.5.2.202603b |
Description
Summary
The NetX Duo TFTP client copies the message of a received ERROR packet with a loop bounded only by its 64-byte destination and a NUL byte, never by the end of the datagram. A four-byte ERROR packet with no message makes the first read of the loop out of bounds, and the copy continues through adjacent packet-pool memory. The TFTP server’s equivalent copy does test the packet boundary, but only after reading each byte, so it reads one byte past a minimal ERROR packet.
Details
The client checks only that a received datagram is at least four bytes long. When the opcode is NX_TFTP_CODE_ERROR, it reads the two-byte opcode and the two-byte error code and then copies the message into nx_tftp_client_error_string without comparing buffer_ptr against nx_packet_append_ptr. The same copy appears on all three receive paths: _nx_tftp_client_file_open_internal(), _nxd_tftp_client_file_read() and _nxd_tftp_client_file_write().
With a four-byte ERROR packet, the opcode and error-code reads leave buffer_ptr exactly at nx_packet_append_ptr, so the first byte copied is already past the datagram; no message content is needed. The copy continues until it meets a zero byte or fills the destination, reading up to 64 bytes of adjacent packet-pool memory, which in a shared pool may hold other traffic. The destination holds 64 characters plus a terminator and the loop stops there, so nothing is written out of bounds.
_nx_tftp_server_error_process() performs the same copy with a boundary test, but places the test after the store. For a minimal four-byte ERROR packet it therefore reads one byte past the datagram before stopping.
Impact
Up to 64 bytes of packet-pool memory are copied into nx_tftp_client_error_string, which the application retrieves through nxd_tftp_client_error_info_get() to display or log. Whether the bytes leave the device depends on what the application does with the error text, so they may be disclosed rather than always are. On a target with memory protection, a read into unmapped memory faults the calling thread. The server-side read is a single byte into a server-side string.
The attacker is the TFTP server the client contacts, a compromised server, or an on-path attacker. An off-path attacker must hit the client’s ephemeral transfer identifier, which TFTP does not otherwise protect, so the attack is possible but not free.
Affected configurations
Applications that use the NetX Duo TFTP client; the one-byte server read affects applications that use the TFTP server.
Affected versions: [6.0, 6.5.2.202603a]. Both defects date from the first release.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N, CVSS-B 6.9 (Medium). CWE-125: Out-of-bounds Read.
VC:L because the memory read is adjacent rather than chosen by the attacker, and reaching anyone depends on what the application does with the error text. VI:N because nothing is written out of bounds. VA:L for the fault risk on targets with memory protection.
Patches
Fixed in NetX Duo 6.5.2.202603b. The ERROR message copy on all three client paths and in the server now stops at the end of the received datagram before reading each byte, and the saved string is terminated after the copy, so a message without a terminating NUL is kept exactly as sent. A new regression test covers each path and fails when any one of the four copies is reverted.