Mar 4, 2026·6 min read·7 visits
A logic error in OpenClaw's WebSocket handshake allows attackers with a shared gateway token to bypass device authentication. By impersonating a 'Node' role without a paired device, attackers can inject events that control AI agents.
OpenClaw, an open-source AI assistant infrastructure, contains a critical authorization bypass vulnerability within its WebSocket gateway. The flaw exists in the device-identity validation logic for the `node` role. Specifically, the system incorrectly permitted clients possessing a valid shared gateway token to bypass device pairing requirements, regardless of the requested role. This allowed unauthorized actors to impersonate processing nodes and inject `node.event` messages, potentially triggering arbitrary AI agent execution and voice processing flows.
OpenClaw acts as a central infrastructure for AI agents, managing communication between gateways, processing nodes, and client devices via WebSockets. A critical security flaw was identified in the ws-connection/message-handler.ts component, specifically within the handshake logic responsible for validating device identities. The vulnerability stems from an overly permissive authorization check that allowed clients to bypass device pairing if they presented a valid shared gateway token.
In a secure configuration, OpenClaw requires distinct authentication proofs for different roles. While operators might legitimately use a shared token for administrative access, processing nodes are expected to be paired devices with specific identities. The vulnerability conflated these requirements, treating the possession of a shared token as a universal pass to skip device identity verification. This failure in the authorization model effectively broke the binding between hardware nodes and the central gateway.
The impact of this bypass is significant because the node role possesses privileged capabilities within the system. Nodes are responsible for processing voice streams and triggering agent behaviors. By spoofing this role, an attacker can inject malicious node.event messages, leading to unauthorized command execution within the agent framework or manipulation of the voice processing pipeline.
The root cause of this vulnerability lies in a logic error within the boolean evaluation of connection privileges. The application defines a canSkipDevice flag, which determines whether an incoming WebSocket connection requires a valid device object to proceed. In the vulnerable implementation, this flag was derived solely from the variable sharedAuthOk, which indicated whether the connection was established using a valid shared gateway token.
The code failed to check the context in which the shared token was being used. Specifically, it did not validate the requested role before granting the bypass. The logic can be summarized as: "If the token is valid, device identity is optional." This assumption is valid for operator connections (which may be ephemeral UI sessions) but dangerous for node connections (which represent trusted hardware infrastructure).
Consequently, any client capable of authenticating with the shared token automatically inherited the canSkipDevice privilege. When such a client requested the role: 'node', the system proceeded to establish the session without enforcing the mandatory device pairing protocol. This represents a classic CWE-863 (Incorrect Authorization) flaw, where the system validates credentials (the token) but fails to verify that those credentials grant the specific privilege requested (skipping device identity for a Node).
The vulnerability existed in src/gateway/server/ws-connection/message-handler.ts. The following comparison highlights the defective logic and the subsequent remediation.
Vulnerable Implementation:
In the original code, the decision to skip device validation was purely based on sharedAuthOk. This boolean was true whenever a valid shared token was presented during the handshake.
// VULNERABLE CODE
// If the shared token is valid, we allow skipping the device check
// regardless of the role requested by the client.
const canSkipDevice = sharedAuthOk;
if (!device && !canSkipDevice) {
// Error handling for missing device
}Patched Implementation:
The fix, introduced in commit ddcb2d79, refines the condition. It now explicitly requires that the client is requesting the operator role in addition to having a valid shared token to bypass the device check. For all other roles, including node, canSkipDevice evaluates to false, enforcing the presence of a valid device object.
// PATCHED CODE
// The bypass is now scoped strictly to the 'operator' role.
// A 'node' requesting a connection with a shared token must still provide a device.
const canSkipDevice = role === "operator" && sharedAuthOk;
if (!device && !canSkipDevice) {
// Correctly rejects 'node' roles missing device info
return socket.close(4003, "Device required for this role");
}This change ensures that the security model for nodes—requiring strict device identity—cannot be circumvented simply by possessing a shared token intended for operators.
To exploit this vulnerability, an attacker requires network access to the OpenClaw WebSocket gateway and possession of the shared gateway token. This token is often distributed for internal integrations or operator access, making it a lower-privilege credential compared to a paired hardware identity.
The attack follows a standard WebSocket handshake manipulation:
token, sets the role to node, and explicitly sets the device field to null.sharedAuthOk to true, and consequently sets canSkipDevice to true. The check for the device field is skipped.Once the session is active, the attacker can send frames reserved for processing nodes. The primary vector is the node.event message type. By injecting these events, the attacker can simulate voice commands or hardware triggers, forcing the AI agents to execute actions defined in their logic. This effectively allows remote control over the agent infrastructure without compromising a physical device.
The vulnerability was officially patched in February 2026. The remediation involves updating the OpenClaw gateway code to ensure strict role-based checking during the connection phase. The fix explicitly couples the device-skip privilege to the operator role.
Immediate Actions:
ddcb2d79b17bf2a42c5037d8aeff1537a12b931e. Verify that src/gateway/server/ws-connection/message-handler.ts contains the updated logic const canSkipDevice = role === "operator" && sharedAuthOk.role: 'node' was successfully established without a corresponding device ID. This may indicate past exploitation attempts.For environments where immediate code deployment is not possible, network-level restrictions on the WebSocket endpoint could limit the attack surface, though this does not fix the underlying logic flaw.
| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | < Commit ddcb2d79 | Commit ddcb2d79 |
| Attribute | Detail |
|---|---|
| Attack Vector | Network (WebSocket) |
| Authentication | Required (Shared Token) |
| Privileges Required | Low (Gateway Token) |
| CWE ID | CWE-863 |
| Impact | Integrity & Confidentiality |
| Exploit Status | PoC Available |
CVE-2026-48861 is a client-side HTTP request-line CRLF (Carriage Return Line Feed) injection vulnerability in the popular Elixir HTTP client library, Mint. The vulnerability permits HTTP Request Splitting and HTTP Request Smuggling when an application forwards untrusted, attacker-controlled inputs to Mint's HTTP client requests as either the HTTP request method or target. By embedding CRLF characters within these parameters, an attacker can terminate the request line prematurely, inject malicious headers, or pipeline entirely independent requests. These smuggled requests are then processed by upstream or downstream proxy servers as separate HTTP queries on the same TCP connection. While Mint version 1.7.0 introduced target validation to secure the request target, the HTTP request method parameter remained completely unvalidated. This flaw allows attackers to bypass routing filters, access restricted internal APIs, or poison HTTP caches under default configurations.
An Inconsistent Interpretation of HTTP Requests (HTTP Request/Response Smuggling) vulnerability in the Elixir Mint HTTP client allows attacker-controlled HTTP/1 servers to desynchronize response framing on shared connections due to over-lenient parsing of sign-prefixed Content-Length headers.
An allocation of resources without limits or throttling vulnerability in Elixir Mint allows an attacker-controlled HTTP/2 server to exhaust memory in a Mint client. The vulnerability is exploited by sending a HEADERS frame without the END_HEADERS flag followed by an infinite stream of CONTINUATION frames. Because the client lacks limits on the incoming header-block accumulator, the client continuously consumes memory until an out-of-memory crash occurs.
CVE-2026-48596 is an Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Request/Response Splitting, CWE-113) in the Elixir Tesla HTTP client. The flaw resides in how multipart content-type parameters are joined and serialized, enabling attackers to inject arbitrary headers or split HTTP requests when applications pass untrusted inputs to the parameters of multipart uploads.
An improper handling of highly compressed data (decompression bomb) vulnerability exists in the Elixir Tesla HTTP client when utilizing response decompression middlewares. By serving highly compressed responses or stacked content-encoding headers, a malicious server can cause arbitrary heap exhaustion, leading to a denial of service (DoS) crash in the BEAM virtual machine.
A high-severity security vulnerability in Elixir's Tesla HTTP client library (CVE-2026-48595) allows unauthenticated remote attackers to harvest sensitive credentials, including Authorization headers and cookies. The flaw resides in the 'Tesla.Middleware.FollowRedirects' component, which performs case-sensitive lookups when stripping credentials during cross-origin redirects. Because HTTP headers are case-insensitive by RFC specifications, standard canonical casing (e.g., 'Authorization') bypasses the lowercase-only blocklist, leaking tokens to untrusted external redirect destinations.