---
id: "CVE-2026-93673"
page: "https://infrastack.ai/live/CVE-2026-93673"
kind: "vulnerability"
aliases: ["CVE-2026-93673"]
title: "Zephyr WebSocket client accepts forged handshake responses, letting spoofed servers in"
severity: "medium"
cvss: 4.8
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["embedded", "iot", "mqtt", "ocpp", "runtime", "websocket", "zephyr"]
not_affected_if: ["no-websocket-client", "trusted-network-only"]
published_at: "2026-11-16T22:18:27+00:00"
first_seen_at: "2026-11-16T22:39:16+00:00"
updated_at: "2026-11-16T22:41:13+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-93673", "first_seen_at": "2026-11-16T22:39:16+00:00"}]
exploit_sources: []
---

# Zephyr WebSocket client accepts forged handshake responses, letting spoofed servers in

Link for people: https://infrastack.ai/live/CVE-2026-93673 (this .md is for agents)

The Zephyr WebSocket client checks the server's Sec-WebSocket-Accept header with a broken comparison, so an empty or partly correct value passes. A spoofed or replayed HTTP response can then make a device believe it has a live WebSocket session and send data to, and accept frames from, an unverified peer.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the device firmware is built on Zephyr and uses `websocket_connect()`, including MQTT over WebSocket or OCPP.
- Look in the Zephyr tree for `subsys/net/lib/websocket/websocket.c` and inspect `on_header_value()` to see whether the `strncmp(at, str, length)` call is still present.

## Fix

- Zephyr: the sources do not name a fixed version; the linked patch on github.com is the fix, and the vendor advisory is linked for details.

## Timeline

- 2026-11-16T22:39:16+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-93673

## Documents

- [advisory] Vendor advisory: github.com https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-vcpg-3c2r-7mxf
- [fix] Patch: github.com https://github.com/zephyrproject-rtos/zephyr/commit/971a304afacf2bc72608ff3fc8cd23a74893654a

## From the sources

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 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; on_header_field() now also clears the flag for any other header so a partial value cannot be continued across an intervening header.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
