Mar 3, 2026·5 min read·22 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.
CVE-2026-12243 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) version 3.9.4. The flaw exists because the input validation routine fails to account for percent-encoded directory traversal sequences like '..%2f' before passing them to urllib.request.url2pathname(), which decodes them into active traversal sequences.
CVE-2026-73654 is a high-severity prototype pollution vulnerability in Trigger.dev. The flaw occurs during the handling of run-metadata updates through the PUT /api/v1/runs/:runId/metadata endpoint. Because user-supplied keys are parsed directly by the @jsonhero/path library without sanitization, an authenticated attacker with low privileges can pollute the global Object.prototype. This causes database queries via Prisma ORM to fail validation and induces unhandled exceptions in the Prometheus metrics client, resulting in a process-wide denial of service.
CVE-2026-73559 is an uncontrolled resource consumption vulnerability in the vLLM engine, specifically within the /v1/completions API endpoint, allowing authenticated attackers to cause application-level denial of service via unbounded prompt arrays.
A critical security bypass vulnerability in Argo Workflows allows authenticated attackers with workflow submission privileges to bypass 'Strict' or 'Secure' template referencing restrictions. By injecting unvalidated fields into the nested ArtifactGC configuration, attackers can execute arbitrary pod patches, leading to host namespace escape and cluster-wide privilege escalation.
A Server-Side Request Forgery (SSRF) / Confused Deputy vulnerability has been identified in Pydantic AI UI Adapters (such as VercelAIAdapter). Under certain conditions, a malicious client can supply manipulated message history with provider metadata that forces the server to resolve files within privileged cloud environments (AWS S3, Google Cloud Storage) or model providers. This occurs because the adapters deserialize client-provided metadata structures directly into UploadedFile instances without validation, which are subsequently fetched using high-privilege server credentials.
A path traversal vulnerability in the optional dashboard server of atomic-agents-stack before version 1.1.0 allows unauthenticated remote attackers to read arbitrary files from the host filesystem.