CVE-2026-93671 in Zephyrinfo

Summary

by MITRE • 11/17/2026

The websocket client's HTTP header callback on_header_value() in subsys/net/lib/websocket/websocket.c receives the Sec-WebSocket-Accept header value as a pointer/length pair from the HTTP parser. The referenced bytes live inside the application-supplied receive buffer and are not NUL terminated. When the received value did not match the expected accept key, the pointer was passed directly to a %s conversion in a NET_DBG() call, so the logging code measured the string with strlen() and read on past the end of the header value looking for a terminator.

The value is supplied by the peer during the WebSocket handshake, before any application-level authentication, so a malicious or man-in-the-middle server reached over a ws:// (or otherwise attacker-terminated) connection can trigger the mismatch branch at will simply by answering with a wrong accept key. By sizing the response so the header value ends at the tail of the buffer passed to websocket_connect() as wreq->tmp_buf, the peer can make the scan run off the end of that buffer and into adjacent memory. The defective log statement is compiled in only when websocket debug logging is enabled (CONFIG_NET_WEBSOCKET_LOG_LEVEL_DBG=y, or CONFIG_LOG_DEFAULT_LEVEL=4); it is absent from a default build, which bounds exposure to diagnostic configurations.

The consequence is an out-of-bounds read whose contents are emitted to the log stream: memory adjacent to the receive buffer is disclosed wherever the device's logs are collected or displayed. On targets where the memory following the buffer is not mapped, the scan can instead fault and terminate the connection or thread. No out-of-bounds write occurs, so there is no integrity impact.

The fix copies at most sizeof(got) - 1 bytes of the parser-provided slice into a bounded stack buffer, NUL terminates the copy, and logs that instead, so the formatter never reads beyond the bytes the parser actually offered.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 11/17/2026

This vulnerability represents an out-of-bounds read flaw within the WebSocket client implementation of Zephyr RTOS, specifically located in the HTTP header callback function on_header_value() found in subsys/net/lib/websocket/websocket.c. The root cause stems from how the system handles string formatting for debug logging during the WebSocket handshake process. When the websocket client receives headers from an HTTP parser, it obtains values such as Sec-WebSocket-Accept as a pointer and length pair rather than as a standard NUL-terminated C-string. This design is technically sound for performance but introduces risk if not handled correctly in subsequent operations that expect traditional string semantics.

The critical failure occurs when the received accept key does not match the expected value calculated by the client, triggering an error logging path via NET_DBG(). The code passes the raw pointer from the parser directly into a printf-style format specifier using %s. Standard C library functions like strlen(), which are implicitly or explicitly used to determine string length for formatting, rely on finding a NUL terminator byte. Since the data in question resides within a fixed-size application-supplied receive buffer and is not guaranteed to be terminated with a zero byte, the logging routine continues scanning memory beyond the intended header value boundary until it encounters an arbitrary null byte or hits unmapped memory.

From a threat modeling perspective, this vulnerability allows for remote exploitation by a malicious server acting as a man-in-the-middle during the initial WebSocket handshake. Because the handshake occurs before any application-level authentication is performed, an attacker can easily trigger this condition simply by responding to the connection request with an incorrect Sec-WebSocket-Accept header value. By carefully crafting the response size so that the malformed header ends at or near the tail of the buffer passed to websocket_connect(), the attacker forces the strlen() operation to read into adjacent memory regions outside the allocated buffer space.

The primary impact of this flaw is information disclosure through log leakage. The out-of-bounds data read from adjacent memory is emitted directly to the system's logging stream. If the device logs are collected, stored, or displayed in a manner that exposes internal state, sensitive memory contents can be leaked to an external observer. In environments where the memory immediately following the receive buffer is not mapped or protected by hardware segmentation, this out-of-bounds read will result in a segmentation fault, causing denial of service by terminating the connection thread or crashing the application entirely. It is important to note that since no write operations are performed on these adjacent regions, there is no integrity impact associated with this specific vulnerability vector.

The severity and exposure window of this issue are heavily dependent on build configuration. The defective log statement is compiled only when debug logging for WebSocket is explicitly enabled via CONFIG_NET_WEBSOCKET_LOG_LEVEL_DBG or a similar high verbosity setting like CONFIG_LOG_DEFAULT_LEVEL=4. In default production builds where such verbose diagnostic logging is disabled, the vulnerable code path remains uncompiled and inactive, thereby bounding exposure to systems that prioritize runtime diagnostics over security hardening in their development phases.

To mitigate this vulnerability, developers must ensure they are running patched versions of Zephyr RTOS that implement proper bounds checking for string operations involving parser-provided data slices. The recommended fix involves copying at most sizeof(got) minus one byte from the untrusted input into a bounded stack buffer, explicitly NUL-terminating that copy, and then passing this safe buffer to the logging function. This ensures the formatter never reads beyond the actual bytes provided by the HTTP parser. Additionally, organizations should audit their build configurations to disable verbose debug logging in production environments unless strictly necessary for troubleshooting, thereby reducing the attack surface even if patching is delayed.

This vulnerability aligns with CWE-125: Out-of-bounds Read and CWE-787: Out-of-Bounds Write (in terms of potential crash scenarios), as it involves accessing memory outside the intended buffer boundaries due to improper string handling. In the context of the MITRE ATT&CK framework, this behavior facilitates Information Discovery through Log Exposure or potentially Denial of Service via Application Crash depending on the target architecture's memory protection mechanisms. Security teams should prioritize patching affected systems and reviewing logging configurations to prevent accidental exposure of internal memory states during network protocol handshakes.

Responsible

Zephyr

Reservation

09/18/2026

Disclosure

11/17/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!