Mar 3, 2026·5 min read·14 visits
OpenClaw authentication tokens are vulnerable to timing attacks due to non-constant-time string comparison. Attackers can brute-force secrets by analyzing response latency.
OpenClaw versions prior to 2026.2.12 contain a timing side-channel vulnerability in the webhook and device token authentication mechanisms. The application utilized standard string comparison logic for validating security tokens, allowing remote attackers to infer the correct token characters by measuring microsecond differences in server response times. Successful exploitation permits unauthorized execution of AI agent hooks and illicit device pairing.
The OpenClaw AI assistant platform exposes endpoints for webhooks and device pairing that are protected by shared secret tokens. In versions prior to 2026.2.12, the authentication logic for these endpoints relies on insecure string comparison operations. This flaw introduces a timing side-channel that correlates the server's response time with the correctness of the provided token.
Timing side-channels occur when an algorithm's execution time depends on secret data. In this specific instance, the vulnerability allows an unauthenticated attacker to discern how many characters of their guessed token match the actual server-side secret. By iteratively guessing characters and statistically analyzing the response latency, an attacker can reconstruct the full authentication token, bypassing security controls entirely.
The vulnerability stems from the use of the standard JavaScript inequality operator (!==) to compare the incoming request token against the configured secret. The affected logic was primarily located in src/gateway/server-http.ts and src/infra/device-pairing.ts.
Modern JavaScript engines, such as V8, optimize string comparison using a byte-by-byte approach that returns false immediately upon encountering a mismatch. This optimization creates a linear relationship between the time taken to compare two strings and the length of their common prefix. If the first character matches, the engine checks the second; if that matches, it checks the third, and so on.
Consequently, a guess that matches the first N characters of the secret will take slightly longer to process than a guess that matches only N-1 characters. Although this time difference is often measured in nanoseconds or microseconds, it aggregates to a measurable signal over a network, particularly in low-latency environments or when averaging thousands of requests to filter out network jitter.
The following analysis contrasts the vulnerable implementation with the patched version introduced in commit 113ebfd6a23c4beb8a575d48f7482593254506ec.
Vulnerable Implementation
In src/gateway/server-http.ts, the code performed a direct comparison. This operation is not constant-time.
// src/gateway/server-http.ts
const token = extractHookToken(req);
// VULNERABLE: The !== operator exits early on mismatch
if (!token || token !== hooksConfig.token) {
res.statusCode = 401;
// ... return error
}Patched Implementation
The fix introduces a dedicated security utility safeEqualSecret in src/security/secret-equal.ts. This utility leverages Node.js's crypto module to perform a constant-time comparison.
// src/security/secret-equal.ts
import { timingSafeEqual } from "node:crypto";
export function safeEqualSecret(
provided: string | undefined | null,
expected: string | undefined | null,
): boolean {
// ... type checks ...
const providedBuffer = Buffer.from(provided);
const expectedBuffer = Buffer.from(expected);
// NOTE: This check still leaks the length of the secret via timing
if (providedBuffer.length !== expectedBuffer.length) {
return false;
}
// FIXED: Constant-time comparison prevents content leakage
return timingSafeEqual(providedBuffer, expectedBuffer);
}> [!NOTE]
> While crypto.timingSafeEqual prevents the leakage of the content of the secret, the explicit length check (!==) still leaks the length of the secret. An attacker can determine the token length before attempting to guess its content.
To exploit this vulnerability, an attacker acts as an oracle, submitting candidate tokens and measuring the time to receive the 401 Unauthorized response. The attack proceeds in two phases:
This attack vector allows for the recovery of API keys, webhook secrets, and device pairing tokens without any prior credentials.
The vulnerability was addressed in OpenClaw version 2026.2.12. The remediation strategy involved two key changes:
crypto.timingSafeEqual ensures that the comparison time remains independent of the input's correctness, provided the lengths match.Residual Risks Despite the patch, technical analysis reveals two lingering concerns:
hookAuthFailures map, used to track failed attempts, clears entirely when it reaches 2048 entries. A sophisticated attacker could flood the server with requests from spoofed IPs to fill this map, forcing a reset of the rate limit counters and effectively bypassing the throttling mechanism.CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | < 2026.2.12 | 2026.2.12 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-208 |
| CVSS Score | 5.9 (Medium) |
| Attack Vector | Network (Remote) |
| Attack Complexity | High (Requires statistical analysis) |
| Fix Commit | 113ebfd6a23c4beb8a575d48f7482593254506ec |
| Impact | Credential Access |
The application performs a comparison operation that takes a variable amount of time depending on the internal state or the value of the secret being compared, allowing an attacker to determine the secret.
A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.
CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.
The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.
GHSA-QQQM-5547-774X is a critical path traversal vulnerability in the FileBrowser Quantum application, specifically within the Go backend package. The vulnerability resides in the HTTP handler responsible for processing bulk file modifications via the public API. Unauthenticated attackers can exploit an order-of-operations flaw in the path sanitization logic to bypass intended directory restrictions. This allows adversaries to arbitrarily read, move, and overwrite files on the underlying filesystem by supplying specially crafted HTTP PATCH requests.
The qs query string parsing and serialization library for Node.js is vulnerable to a synchronous Denial of Service (DoS) attack. The vulnerability manifests as a process-terminating TypeError when processing arrays with null or undefined elements under specific configuration parameters.
The aiosend library prior to version 3.0.6 contains a pre-authentication Denial of Service (DoS) vulnerability in its webhook handling mechanism. The software processes and deserializes incoming JSON payloads before verifying the cryptographic signature, allowing unauthenticated attackers to exhaust server CPU and memory resources by sending large, complex payloads.