⚠️

Disclaimer & Liability

The content provided on this website is for educational, research, and security awareness purposes only. Any unauthorized, illegal, or abusive use of the information, tools, and techniques discussed is solely the responsibility of the user. The author and publisher assume no liability for any damages, injuries, or consequences resulting from the misuse of this content.

CVE-2026-140003: websocket-driver draft76 handshake flaw enables remote denial of service | Alireza Bolbolabadi - Red Team Security
LOADING

CVE-2026-140003: websocket-driver draft76 handshake flaw enables remote denial of service

Executive summary

CVE-2026-140003 affects the legacy draft76 WebSocket handshake parser in Faye's websocket-driver package, published as websocket-driver on npm and maintained in the faye/websocket-driver-node repository. A remote, unauthenticated client can supply a malformed Sec-WebSocket-Key1 or Sec-WebSocket-Key2 header whose derived value exceeds the capacity of an unsigned 32-bit buffer. On Node.js v22 and earlier, the resulting Buffer range exception is not handled by the parser and can terminate the host process.

The vendor addressed the defect in websocket-driver version 0.8.0; all earlier versions are affected. Although the issue has a reported CVSS 3.1 score of 7.5 and is network exploitable without credentials, practical exposure depends on whether the service accepts or attempts draft76 handshakes and whether it runs on Node.js v22 or earlier. The supplied sources do not report exploitation in the wild, inclusion in the CISA Known Exploited Vulnerabilities catalog, or a usable public proof of concept.

Affected systems

  • Vendor: Faye

  • Product: websocket-driver / faye/websocket-driver-node

  • Affected versions: Versions earlier than 0.8.0

  • Fixed version: 0.8.0

  • Observed runtime constraint: The process crash occurs on Node.js v22 and below

  • Weakness: CWE-248 — Uncaught Exception

  • Impact type: Availability loss through process termination

Downstream applications are affected when they use an unpatched websocket-driver release and expose an endpoint that accepts or attempts to parse the legacy draft76 handshake. The advisory does not enumerate every affected application. Services that reject draft76 before parsing its challenge headers, as well as environments running a Node.js version newer than v22, may not be exploitable through the described path even if their dependency remains unpatched.

Technical analysis

The draft76 opening handshake uses the unusual Sec-WebSocket-Key1 and Sec-WebSocket-Key2 headers rather than the single challenge key used by the standardized RFC 6455 handshake. In affected versions, the parser extracts digits from each header and divides the resulting numeric value by the number of spaces in that header.

The parser then serializes each derived integer into an 8-byte buffer slot while treating the value as an unsigned 32-bit quantity. No range validation occurs between calculating that value and writing it into the fixed-width buffer. A sufficiently large digit sequence can therefore produce a derived number greater than 0xFFFFFFFF, causing the buffer write to exceed its permitted range.

Node.js raises a Buffer range exception during this operation. Because the exception is not caught within the draft76 parser, it propagates through the upgrade handling path and may terminate the worker process. The resulting issue is an availability failure rather than evidence of memory corruption, credential disclosure, or modification of application data.

Attack conditions

A remote peer must be able to send an HTTP-style WebSocket upgrade request to a listening service that accepts or attempts draft76 parsing. No authentication is required because the failure occurs during handshake processing. The supplied analysis identifies the header Sec-WebSocket-Key1 as the primary trigger and notes that Sec-WebSocket-Key2 is handled by the same vulnerable logic.

The attack does not depend on a valid WebSocket session or prior interaction. Once the endpoint processes the crafted upgrade request, the malformed challenge can trigger the exception and terminate the process.

Exploitability assessment

The primitive is conceptually straightforward: an attacker needs a reachable draft76-capable endpoint and a challenge header that causes the derived integer to overflow 32 bits. Repeated requests could sustain an outage when a process supervisor automatically restarts the crashed worker and the front end does not throttle the offending client.

Exposure is narrower than the headline CVSS score might initially suggest. Most current WebSocket clients use RFC 6455 and do not send draft76 challenge headers. The attack also requires the service to attempt legacy protocol parsing rather than reject the handshake earlier. Finally, the supplied advisory specifically identifies Node.js v22 and earlier as the affected runtime line; behavior on newer runtimes is not characterized by the available sources.

No evidence of active exploitation appears in the supplied material. The CVE record is not listed in the CISA Known Exploited Vulnerabilities catalog, and the referenced portals describe PoC scanning without presenting a usable exploit in the supplied context. Nevertheless, the vulnerability is easy to reproduce conceptually wherever all exposure conditions are met.

Mitigation

  1. Upgrade websocket-driver to version 0.8.0 or later in every affected application, including transitive dependencies that remain below that version.

  1. Review package manifests and lockfiles to identify services pinned to websocket-driver versions earlier than 0.8.0.

  1. Disable draft76 handshake support where the application exposes a configuration option, as the legacy protocol is not required for standard RFC 6455 WebSocket connections.

  1. Apply protocol filtering at the reverse proxy or load balancer when legacy support cannot immediately be removed.

  1. Use a Node.js runtime newer than v22 when compatible with the application, noting that runtime changes do not replace updating the vulnerable dependency.

  1. Monitor Node.js crash logs and uncaught exception stack traces for Buffer range errors associated with the websocket-driver draft76 parser.

  1. Alert on unusually long, digit-heavy Sec-WebSocket-Key1 or Sec-WebSocket-Key2 values in inbound upgrade requests, especially values containing very few whitespace separators.

  1. Use process supervision and connection rate limiting to reduce the operational impact of repeated crashes while the permanent fix is deployed.

The upstream fix is documented in commit 851117d21fa8eb98f22856b5600e0688c5337214 and security advisory GHSA-c4gv-fww2-jp3r.

Expert insight

This vulnerability illustrates how compatibility with obsolete protocol variants can preserve attack surface long after mainstream adoption has moved elsewhere. The parser trusts a computed result without validating that it fits the destination buffer, turning a malformed header into an uncaught exception. The resulting crash is easy to trigger but remains conditional on draft76 parsing and the reported Node.js runtime range.

For organizations, dependency remediation is the primary control because it removes the vulnerable behavior at its source. Configuration filters are useful defense in depth, particularly for services that cannot be upgraded promptly, but they must not create a false sense of completeness: proxy rules can be bypassed by alternate paths or inconsistent deployment configurations. Runtime hardening and automated restarts can reduce outage duration, yet neither prevents the exception from occurring.

The practical significance of CVE-2026-140003 is therefore its targeted combination of low-complexity remote triggering and constrained exposure. It is most consequential in services that retain legacy draft76 compatibility, run on Node.js v22 or earlier, and expose WebSocket endpoints directly to untrusted networks.

References

·
← News