Skip to content
Medium 4.8

WebSocket client accepts a handshake without verifying the full Sec-WebSocket-Accept value

CVE-2026-93673 First seen on SecPulse

Affected packages

PackageAffected → Fixed
zephyrprojectzephyr
≥ 2.1.0, < 4.3.2→ 4.3.2
≥ 4.4.0, < 4.5.0→ 4.5.0
Original description The description as published by the source.

The Zephyr WebSocket client validates the server's handshake response in on_header_value() in subsys/net/lib/websocket/websocket.c. The comparison was performed as strncmp(at, str, length), where length is the length of the value the server sent rather than the length of the expected value, so the check only asked whether the received value was a prefix of the expected base64(SHA-1(key || GUID)). A server that returned a handful of correct characters passed, and a response carrying an empty Sec-WebSocket-Accept: header caused strncmp() to be called with a count of zero, which returns 0 and set ctx->sec_accept_ok with no comparison performed at all. The header-value callback also cleared ctx->sec_accept_present after the first chunk, so a value split across receive-buffer boundaries was only ever examined in part.

ctx->sec_accept_ok is the sole WebSocket-specific gate in websocket_connect(); the client does not check the HTTP status code or the Upgrade:/Connection: headers. Any HTTP response containing an empty or prefix-matching Sec-WebSocket-Accept header therefore completed the handshake, after which the socket is finalized as a WebSocket and all further peer bytes are parsed as frames. The affected path is driven directly by remote input through subsys/net/lib/http/http_parser.c, and is reached by every user of websocket_connect(), including MQTT over WebSocket (subsys/net/lib/mqtt/mqtt_transport_websocket.c) and subsys/net/lib/ocpp/ocpp.c.

The Sec-WebSocket-Accept excha…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details