Description
The Zephyr TFTP client library (subsys/net/lib/tftp/tftp_client.c) reports server ERROR packets to the application through a TFTP_EVT_ERROR event whose evt.param.error.msg field is a bare char * pointing at client->tftp_buf + TFTP_HEADER_SIZE, with no length. RFC 1350 requires the ERROR message to be NUL-terminated, but tftp_get(), tftp_put() and send_data() never checked or enforced this before invoking the callback.

A TFTP server (or an on-path/spoofing attacker able to inject a UDP datagram from the server's address) can answer a client request with a full-size 516-byte ERROR datagram whose message has no terminator. The callback then receives a string that runs to the end of tftp_buf, which is the last member of the application-owned struct tftpc, so any string operation on it (for example the %s logging done by the in-tree sample and net tftp shell callbacks) reads past the end of the object until a stray zero byte is found. A 4-byte ERROR with no message similarly exposes stale, possibly unterminated buffer contents from the previous packet.

The impact is an out-of-bounds read of memory adjacent to the struct tftpc object in the context of the application callback. Depending on what the application does with the message, this can disclose adjacent memory (e.g. into logs or anything the application forwards) or fault if the read reaches unmapped or protected memory. No out-of-bounds write is possible. The fix NUL-terminates the message inside tftp_buf at the received length, clamped to the last byte of the buffer.
Published: 2026-11-29
Score: 3.7 Low
EPSS: n/a
KEV: No
AI Analysis

Analysis and contextual insights are available on OpenCVE Cloud.

Remediation

No vendor fix or workaround currently provided.

Additional remediation guidance may be available on OpenCVE Cloud.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sun, 29 Nov 2026 21:15:00 +0000

Type Values Removed Values Added
Description The Zephyr TFTP client library (subsys/net/lib/tftp/tftp_client.c) reports server ERROR packets to the application through a TFTP_EVT_ERROR event whose evt.param.error.msg field is a bare char * pointing at client->tftp_buf + TFTP_HEADER_SIZE, with no length. RFC 1350 requires the ERROR message to be NUL-terminated, but tftp_get(), tftp_put() and send_data() never checked or enforced this before invoking the callback. A TFTP server (or an on-path/spoofing attacker able to inject a UDP datagram from the server's address) can answer a client request with a full-size 516-byte ERROR datagram whose message has no terminator. The callback then receives a string that runs to the end of tftp_buf, which is the last member of the application-owned struct tftpc, so any string operation on it (for example the %s logging done by the in-tree sample and net tftp shell callbacks) reads past the end of the object until a stray zero byte is found. A 4-byte ERROR with no message similarly exposes stale, possibly unterminated buffer contents from the previous packet. The impact is an out-of-bounds read of memory adjacent to the struct tftpc object in the context of the application callback. Depending on what the application does with the message, this can disclose adjacent memory (e.g. into logs or anything the application forwards) or fault if the read reaches unmapped or protected memory. No out-of-bounds write is possible. The fix NUL-terminates the message inside tftp_buf at the received length, clamped to the last byte of the buffer.
Title Out-of-bounds read via unterminated TFTP ERROR message in Zephyr TFTP client
Weaknesses CWE-125
References
Metrics cvssV3_1

{'score': 3.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: zephyr

Published:

Updated: 2026-11-29T20:56:42.845Z

Reserved: 2026-10-01T22:27:57.203Z

Link: CVE-2026-104377

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-11-29T21:17:01.160

Modified: 2026-11-29T21:17:01.273

Link: CVE-2026-104377

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

No data.

Weaknesses