CVE-2026-93673: WebSocket client accepts a handshake without verifying the full Sec-WebSocket-Accept value

Published Nov 16, 2026
·
Updated

The Zephyr WebSocket client validates the server's handshake response in onheadervalue() 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->secacceptok with no comparison performed at all. The header-value callback also cleared ctx->secacceptpresent after the first chunk, so a value split across receive-buffer boundaries was only ever examined in part.

ctx->secacceptok is the sole WebSocket-specific gate in websocketconnect(); 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/httpparser.c, and is reached by every user of websocketconnect(), including MQTT over WebSocket (subsys/net/lib/mqtt/mqtttransportwebsocket.c) and subsys/net/lib/ocpp/ocpp.c.

The Sec-WebSocket-Accept exchange is not a secret-based authentication -- an endpoint or on-path attacker that sees the request can compute the expected value -- so the impact is bounded to parties that never observed the handshake request: a caching or transparent intermediary replaying a canned response, an off-path attacker injecting a spoofed response, or a non-WebSocket endpoint the client was induced to talk to. For those, the per-connection binding that RFC 6455 requires the client to enforce provided no protection at all, letting a single crafted response convince the device it holds a live WebSocket session and causing it to send application data to, and accept frames from, an unverified peer. There is no memory-safety consequence.

The fix compares each delivered chunk against the expected value at the position reached so far, refuses a chunk that would overrun it, and accepts only once every byte of the expected value -- and no more -- has been matched; onheaderfield() now also clears the flag for any other header so a partial value cannot be continued across an intervening header.

Affected Software

1 affected component
Zephyr Project Zephyr

Event History

Nov 16, 2026
CVE Published
via MITRE·09:19 PM
Data Sourced
via MITRE·09:19 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What would an attacker need to exploit this issue?

An attacker would need to act as, or control the response from, the server a Zephyr WebSocket client is connecting to. No client-side privileges or user interaction are required, but the attacker must be able to return an HTTP response containing an empty or prefix-matching Sec-WebSocket-Accept header.

2

Are normal WebSocket handshake checks sufficient to prevent exploitation?

No. The affected client treats ctx->sec_accept_ok as the only WebSocket-specific gate for completing the connection, and it does not verify the HTTP status code or the Upgrade and Connection headers. An otherwise invalid HTTP response can therefore be accepted if it includes the malformed Sec-WebSocket-Accept value described.

3

How can I determine whether a connection was accepted incorrectly?

Review handshake responses received by the client. Affected behavior can occur when Sec-WebSocket-Accept is empty, contains only an initial matching prefix of the expected value, or is split across receive-buffer boundaries such that only part of its value is checked.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203