{"id":"CVE-2026-93673","kind":"vulnerability","aliases":["CVE-2026-93673"],"related":[],"title":"Zephyr WebSocket client accepts forged handshake responses, letting spoofed servers in","description":"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.\n\nctx->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.\n\nThe 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.\n\nThe 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.","summary":"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.","severity":"medium","cvss":4.8,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["embedded","iot","mqtt","ocpp","runtime","websocket","zephyr"],"not_affected_if":["no-websocket-client","trusted-network-only"],"how_to_check":"- Check whether the device firmware is built on Zephyr and uses `websocket_connect()`, including MQTT over WebSocket or OCPP.\n- 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.","status":"open","published_at":"2026-11-16T22:18:27+00:00","first_seen_at":"2026-11-16T22:39:16+00:00","triaged_at":"2026-11-16T22:41:13+00:00","updated_at":"2026-11-16T22:41:13+00:00","category":"runtime","confidence":0.7,"triage":{"at":"2026-11-16T22:41:13Z","model":"claude-haiku-5-5","output":{"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.","reach":"network","title":"Zephyr WebSocket client accepts forged handshake responses, letting spoofed servers in","impact":"medium","summary":"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.","audience":"developers","category":"runtime","nicknames":[],"who_cares":["zephyr","embedded","iot","mqtt","ocpp","websocket"],"confidence":0.7,"fix_status":"available","needs_auth":"no","worst_case":"device accepts a forged WebSocket session from an unverified peer","analyst_note":"Confirm the fixed Zephyr version from the linked patch and vendor advisory on github.com; the sources give no version.","how_to_check":"- Check whether the device firmware is built on Zephyr and uses `websocket_connect()`, including MQTT over WebSocket or OCPP.\n- 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.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["no-websocket-client","trusted-network-only"],"who_is_affected":"Only devices or applications built on Zephyr that open WebSocket connections with websocket_connect(), directly or via MQTT over WebSocket or OCPP. The exposure comes from remote server responses, so devices that talk only to trusted fixed endpoints over a protected path face lower risk. Systems that never use the WebSocket client can skip it.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"medium"},"cost_usd":0.000885,"input_tokens":5318,"output_tokens":707,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-1':139C '-2026':12A,15A '-93673':13A,16A '/connection':244C '0':175C '6455':392C 'accept':4A,35B,72B,161C,180C,197C,220C,259C,314C,426C,463C 'across':207C,497C 'affect':284C 'also':193C,482C 'applic':422C 'ask':126C 'attack':329C,365C 'authent':322C 'base':321C 'base64':137C 'believ':60B 'bind':389C 'bound':343C 'boundari':211C 'broken':39B 'buffer':210C 'byte':278C,467C 'cach':353C 'call':167C 'callback':192C 'can':359C 'cannot':494C 'carri':155C 'caus':163C,418C 'charact':150C 'check':28B,124C,236C 'chunk':202C,444C,457C 'clear':194C,483C 'client':3A,27B,81C,233C,377C,395C 'code':240C 'compar':441C 'comparison':40B,95C,184C 'complet':262C 'comput':335C 'connect':231C,302C,388C 'consequ':438C 'contain':249C 'continu':496C 'convinc':408C 'correct':46B,149C 'count':170C 'craft':406C 'ctx':178C,195C,218C 'cve':11A,14A 'data':69B,423C 'deliv':443C 'devic':59B,410C 'direct':288C 'driven':287C 'embed':17B 'empti':43B,157C,251C 'endpoint':324C,375C 'enforc':397C 'ever':214C 'everi':298C,466C 'examin':215C 'exchang':315C 'expect':120C,136C,337C,447C,470C 'far':454C 'field':480C 'final':270C 'first':201C 'fix':440C 'flag':485C 'forg':5A 'frame':73B,282C,427C 'gate':228C 'guid':141C 'hand':147C 'handshak':6A,86C,264C,350C 'header':36B,90C,162C,190C,245C,260C,479C,489C,500C 'header-valu':189C 'hold':412C 'http':53B,238C,247C 'impact':341C 'includ':303C 'induc':379C 'inject':366C 'input':291C 'intermediari':356C 'interven':499C 'iot':18B 'key':140C 'length':102C,104C,107C,117C 'let':8A,403C 'live':64B,414C 'make':57B 'match':255C,477C 'memori':436C 'memory-safeti':435C 'mqtt':19B,304C 'never':347C 'non':373C 'non-websocket':372C 'observ':348C 'ocpp':20B 'off-path':362C 'ok':181C,221C 'on-path':326C 'overrun':460C 'pars':280C 'part':45B,217C 'parti':345C 'partial':492C 'pass':48B,151C 'path':285C,328C,364C 'peer':77B,277C,431C 'per':387C 'per-connect':386C 'perform':97C,185C 'posit':451C 'prefix':133C,254C 'prefix-match':253C 'present':198C 'protect':400C 'provid':398C 'rather':114C 'reach':296C,452C 'receiv':129C,209C 'receive-buff':208C 'refus':455C 'remot':290C 'replay':52B,357C 'request':333C,351C 'requir':393C 'respons':7A,54B,87C,154C,248C,360C,369C,407C 'return':145C,174C 'rfc':391C 'runtim':21B 'safeti':437C 'sec':33B,159C,179C,196C,219C,257C,312C 'sec-websocket-accept':32B,158C,256C,311C 'secret':320C 'secret-bas':319C 'see':331C 'send':68B,421C 'sent':113C 'server':10A,30B,84C,112C,143C 'session':66B,416C 'set':177C 'sha':138C 'singl':405C 'socket':268C 'sole':224C 'specif':227C 'split':206C 'spoof':9A,50B,368C 'status':239C 'str':101C 'strncmp':99C,164C 'subsys/net/lib/http/http_parser.c':293C 'subsys/net/lib/mqtt/mqtt_transport_websocket.c':307C 'subsys/net/lib/ocpp/ocpp.c':309C 'subsys/net/lib/websocket/websocket.c':93C 'talk':381C 'therefor':261C 'transpar':355C 'unverifi':76B,430C 'upgrad':243C 'user':299C 'valid':82C 'valu':47B,91C,110C,121C,130C,191C,205C,338C,448C,471C,493C 'websocket':2A,22B,26B,34B,65B,80C,160C,226C,230C,258C,273C,301C,306C,313C,374C,415C 'websocket-specif':225C 'whether':127C 'would':459C 'zephyr':1A,23B,25B,79C 'zero':172C","nicknames":[],"mitigations":[],"who_affected":"Only devices or applications built on Zephyr that open WebSocket connections with websocket_connect(), directly or via MQTT over WebSocket or OCPP. The exposure comes from remote server responses, so devices that talk only to trusted fixed endpoints over a protected path face lower risk. Systems that never use the WebSocket client can skip it.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["embedded","iot","medium","mqtt","ocpp","runtime","websocket","zephyr"],"campaign_type":null,"search_a":"'-2026':12A,15A '-93673':13A,16A 'accept':4A 'client':3A 'cve':11A,14A 'forg':5A 'handshak':6A 'let':8A 'respons':7A 'server':10A 'spoof':9A 'websocket':2A 'zephyr':1A","search_b":"'accept':35B,72B 'believ':60B 'broken':39B 'check':28B 'client':27B 'comparison':40B 'correct':46B 'data':69B 'devic':59B 'embed':17B 'empti':43B 'frame':73B 'header':36B 'http':53B 'iot':18B 'live':64B 'make':57B 'mqtt':19B 'ocpp':20B 'part':45B 'pass':48B 'peer':77B 'replay':52B 'respons':54B 'runtim':21B 'sec':33B 'sec-websocket-accept':32B 'send':68B 'server':30B 'session':66B 'spoof':50B 'unverifi':76B 'valu':47B 'websocket':22B,26B,34B,65B 'zephyr':23B,25B","search_c":"'-1':139C '/connection':244C '0':175C '6455':392C 'accept':161C,180C,197C,220C,259C,314C,426C,463C 'across':207C,497C 'affect':284C 'also':193C,482C 'applic':422C 'ask':126C 'attack':329C,365C 'authent':322C 'base':321C 'base64':137C 'bind':389C 'bound':343C 'boundari':211C 'buffer':210C 'byte':278C,467C 'cach':353C 'call':167C 'callback':192C 'can':359C 'cannot':494C 'carri':155C 'caus':163C,418C 'charact':150C 'check':124C,236C 'chunk':202C,444C,457C 'clear':194C,483C 'client':81C,233C,377C,395C 'code':240C 'compar':441C 'comparison':95C,184C 'complet':262C 'comput':335C 'connect':231C,302C,388C 'consequ':438C 'contain':249C 'continu':496C 'convinc':408C 'correct':149C 'count':170C 'craft':406C 'ctx':178C,195C,218C 'data':423C 'deliv':443C 'devic':410C 'direct':288C 'driven':287C 'empti':157C,251C 'endpoint':324C,375C 'enforc':397C 'ever':214C 'everi':298C,466C 'examin':215C 'exchang':315C 'expect':120C,136C,337C,447C,470C 'far':454C 'field':480C 'final':270C 'first':201C 'fix':440C 'flag':485C 'frame':282C,427C 'gate':228C 'guid':141C 'hand':147C 'handshak':86C,264C,350C 'header':90C,162C,190C,245C,260C,479C,489C,500C 'header-valu':189C 'hold':412C 'http':238C,247C 'impact':341C 'includ':303C 'induc':379C 'inject':366C 'input':291C 'intermediari':356C 'interven':499C 'key':140C 'length':102C,104C,107C,117C 'let':403C 'live':414C 'match':255C,477C 'memori':436C 'memory-safeti':435C 'mqtt':304C 'never':347C 'non':373C 'non-websocket':372C 'observ':348C 'off-path':362C 'ok':181C,221C 'on-path':326C 'overrun':460C 'pars':280C 'part':217C 'parti':345C 'partial':492C 'pass':151C 'path':285C,328C,364C 'peer':277C,431C 'per':387C 'per-connect':386C 'perform':97C,185C 'posit':451C 'prefix':133C,254C 'prefix-match':253C 'present':198C 'protect':400C 'provid':398C 'rather':114C 'reach':296C,452C 'receiv':129C,209C 'receive-buff':208C 'refus':455C 'remot':290C 'replay':357C 'request':333C,351C 'requir':393C 'respons':87C,154C,248C,360C,369C,407C 'return':145C,174C 'rfc':391C 'safeti':437C 'sec':159C,179C,196C,219C,257C,312C 'sec-websocket-accept':158C,256C,311C 'secret':320C 'secret-bas':319C 'see':331C 'send':421C 'sent':113C 'server':84C,112C,143C 'session':416C 'set':177C 'sha':138C 'singl':405C 'socket':268C 'sole':224C 'specif':227C 'split':206C 'spoof':368C 'status':239C 'str':101C 'strncmp':99C,164C 'subsys/net/lib/http/http_parser.c':293C 'subsys/net/lib/mqtt/mqtt_transport_websocket.c':307C 'subsys/net/lib/ocpp/ocpp.c':309C 'subsys/net/lib/websocket/websocket.c':93C 'talk':381C 'therefor':261C 'transpar':355C 'unverifi':430C 'upgrad':243C 'user':299C 'valid':82C 'valu':91C,110C,121C,130C,191C,205C,338C,448C,471C,493C 'websocket':80C,160C,226C,230C,258C,273C,301C,306C,313C,374C,415C 'websocket-specif':225C 'whether':127C 'would':459C 'zephyr':79C 'zero':172C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-16T21:18:24+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","cvss_by":"vulnerabilities@zephyrproject.org","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-93673","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-93673","severity":null,"published_at":"2026-11-16T22:18:27+00:00","modified_at":"2026-11-16T22:18:27+00:00","first_seen_at":"2026-11-16T22:39:16+00:00","fetched_at":"2026-11-16T22:39:16+00:00","note":null}],"documents":[{"id":172964,"url":"https://github.com/zephyrproject-rtos/zephyr/commit/971a304afacf2bc72608ff3fc8cd23a74893654a","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":172965,"url":"https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-vcpg-3c2r-7mxf","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-11-16T21:18:24+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}