Mar 4, 2026·5 min read·33 visits
A logic flaw in OpenClaw's authorization system allows attackers to bypass access controls for elevated commands. By sending a message to a bot that has its own ID whitelisted, the system validates the request based on the recipient's identity rather than the sender's, granting full administrative access to unauthorized users.
OpenClaw (formerly Clawdbot) contains a critical authorization bypass vulnerability in its elevated permissions module. The vulnerability arises from an overly permissive validation logic in the `isApprovedElevatedSender` function, which incorrectly includes the message recipient's identifier (the bot itself) in the authorization check. If an administrator includes the bot's own identity in the `tools.elevated.allowFrom` configuration—a common configuration pattern for self-testing—any unauthenticated remote user can execute commands with elevated privileges by simply sending a message to the bot.
OpenClaw serves as an AI agent gateway, processing messages from various platforms (e.g., WhatsApp, Discord) and executing tool-based actions. To protect sensitive functionality, the system implements an "elevated mode" restricted to specific users defined in the tools.elevated.allowFrom configuration setting. This setting is intended to act as an allowlist of trusted sender identifiers (phone numbers, user IDs).
The vulnerability exists within the logic that verifies whether a sender is authorized to access this elevated mode. Instead of strictly validating the sender's identity against the allowlist, the system gathered a collection of "tokens" from the message context—including the recipient's address (ctx.To)—and checked if any of these tokens appeared in the configuration. This architectural flaw means that the identity of the target (the bot) effectively vouches for the identity of the requester.
Consequently, if an administrator adds the bot's own identifier to the allowlist (often done to allow the bot to invoke its own internal tools or during testing), the authorization check effectively defaults to true for all incoming messages directed to that bot. This bypasses authentication entirely, exposing privileged tools to the public internet.
The root cause lies in the implementation of the isApprovedElevatedSender function located in src/auto-reply/reply/reply-elevated.ts. The function was designed to offer flexibility by matching against multiple potential identifiers for a user, such as their username, display name, or unique ID. However, the implementation was overly broad in its scope of "identity candidates."
Specifically, the logic constructed a set of tokens derived from the incoming message context (MsgContext). This set erroneously included ctx.To, which represents the recipient of the message (the OpenClaw instance itself). When the authorization loop runs, it iterates through the configured allowFrom strings and checks if any of them exist in the token set.
Furthermore, the logic failed to distinguish between immutable, verified identifiers (like SenderId or E.164 phone numbers) and mutable, user-controlled metadata (like SenderName or SenderUsername). This lack of type safety meant that even without the ctx.To flaw, an attacker could potentially spoof a trusted user's display name to gain access if the configuration relied on non-unique identifiers.
The vulnerability is best understood by examining the authorization logic before and after the patch. The flawed implementation incorrectly conflated message targets with message sources.
Vulnerable Logic (Conceptual):
// The set includes the sender AND the recipient (ctx.To)
const identityTokens = [
ctx.From,
ctx.To, // <--- CRITICAL FLAW: The bot's own ID is included here
ctx.SenderName,
ctx.SenderID
];
// If the config allows the bot's ID, this returns true for EVERYONE
return config.allowFrom.some(allowed => identityTokens.includes(allowed));Patched Logic (Commit 6817c0e): In the patched version, the developers removed the recipient field from the validation scope and introduced strict prefixing to bind allowlist entries to specific field types.
// 1. ctx.To is removed from the check
// 2. Strict prefixes are enforced for mutable fields
// 3. Unprefixed entries ONLY match immutable IDs
function isApproved(ctx, allowList) {
for (const allowed of allowList) {
// Implicitly pins to verified IDs if no prefix is present
if (!allowed.includes(':')) {
if (ctx.SenderId === allowed || ctx.From === allowed) return true;
continue;
}
// Requires explicit opt-in for mutable fields
if (allowed.startsWith('name:') && ctx.SenderName === allowed.slice(5)) return true;
// ... other checks
}
return false;
}The fix ensures that the allowFrom list is compared strictly against sender attributes, and ambiguous strings are treated as verified IDs by default, preventing spoofing via display names.
Exploitation of this vulnerability requires no specialized tools, only knowledge of the target's configuration state. The attack vector is strictly logic-based.
Prerequisites:
The target OpenClaw instance must have the bot's own identifier (e.g., its WhatsApp phone number +15550199 or Discord Bot ID) present in the tools.elevated.allowFrom array in config.json.
Attack Steps:
/elevated exec "cat /etc/passwd".To field (e.g., +15550199). It checks allowFrom. Finding +15550199 in the allowed list, it successfully validates the request, ignoring the fact that the sender is +1999666000 (the attacker).The impact of this vulnerability is critical as it constitutes a complete authentication bypass for the most privileged functionality within the application. OpenClaw is designed to interface with LLMs and execute tools; granting unauthorized access to the "elevated" toolset typically exposes the underlying host.
Given the ease of exploitation and the high probability of the vulnerable configuration (adding the bot to the allowlist for self-testing is a common pattern), this issue represents a severe risk to deployments.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | < 2026.3.2 | 2026.3.2 |
| Attribute | Detail |
|---|---|
| CWE | CWE-285: Improper Authorization |
| CVSS v3.1 | 9.8 (Critical) |
| Attack Vector | Network (Remote) |
| Privileges Required | None |
| User Interaction | None |
| Patch Status | Released (2026-02-22) |
The software does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.
CVE-2026-16454 is an object-level authorization bypass vulnerability (CWE-284, CWE-862) in Eclipse hawkBit versions 1.0.3 and prior. The flaw exists within the Direct Device Integration (DDI) REST controller (hawkbit-ddi-resource), where endpoints responsible for enumerating software module metadata and serving firmware binaries fail to verify whether the requested software module is assigned to the authenticated device. Consequently, any device with valid credentials (such as a TargetToken or GatewayToken) can enumerate software module identifiers and download arbitrary firmware artifacts across the entire tenant namespace.
CVE-2026-62284 (GHSA-5w5g-j6hw-6p8f) is a code injection and server-side request forgery vulnerability in the console-proxy component of the OSAC Operator. The RemoteConfigResolver parses Kubernetes Secrets containing kubeconfig files via clientcmd.RESTConfigFromKubeConfig without sanitizing execution-related fields. An attacker with RBAC permissions to create or modify labeled Secrets in monitored namespaces can supply a malicious exec credential plugin, resulting in arbitrary command execution within the console-proxy pod.
CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).
CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.
Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.
CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.