Mar 3, 2026·5 min read·8 visits
OpenClaw versions before 2026.3.2 suffer from an identity confusion vulnerability where group/channel IDs are treated as valid user identities. If a group ID is allowlisted, all members of that group can execute administrative commands.
A critical authorization bypass vulnerability exists in OpenClaw, an open-source personal AI assistant. The flaw resides in the command authorization logic within `src/auto-reply/command-auth.ts`, specifically in how the application resolves sender identities. Due to insufficient validation of the `ctx.From` field, the system may treat a conversation container identifier (such as a Group JID or Channel ID) as a valid user identity. If an administrator inadvertently adds a group identifier to the `allowFrom` configuration, every member of that conversation gains administrative privileges, allowing them to execute privileged commands. This vulnerability affects all versions prior to 2026.3.2.
OpenClaw is a personal AI assistant designed to integrate with various messaging platforms such as WhatsApp, Telegram, Discord, and Matrix. A core security feature of the application is its command authorization system, which restricts administrative actions (e.g., system resets, status checks, or shell execution) to specific authorized principals defined in the commands.allowFrom configuration array.
The vulnerability, identified as GHSA-2CH6-X3G4-7759, is an implementation of CWE-287 (Improper Authentication) specifically manifesting as Identity Confusion. The flaw occurs because the authorization engine fails to distinguish between an individual user's identifier (a User ID) and a conversation's identifier (a Group, Channel, or Thread ID). When processing incoming messages, the system erroneously conflates the source of the message (the conversation context) with the author of the message (the user).
This ambiguity allows for a scenario where a collective identifier is authorized, unintentionally granting individual-level privileges to every participant within that collective. Consequently, an unprivileged user within an authorized group can invoke commands that should be restricted to the bot owner or system administrators.
The root cause lies in the resolveSenderCandidates function within src/auto-reply/command-auth.ts. This function is responsible for generating a list of candidate strings that represent the message sender. These candidates are then cross-referenced against the commands.allowFrom allowlist to determine if the operation should be permitted.
In the vulnerable implementation, the function unconditionally included the ctx.From property in the candidate list. In many messaging platform adapters used by OpenClaw (specifically the WhatsApp and Telegram bridges), the ctx.From field often represents the conversation container rather than the specific user authoring the message. For example, in a WhatsApp group, ctx.From might correspond to 120363411111111111@g.us (the Group JID), while ctx.SenderId corresponds to the actual user.
Because the system treated the container ID as a valid "sender," the authorization logic became: "Is the user's ID allowlisted OR is the group's ID allowlisted?" This logic is flawed for command execution contexts, as it effectively delegates the bot's highest privilege level to an open set of users (the group members) rather than a closed set of trusted administrators.
The fix involved modifying src/auto-reply/command-auth.ts to strictly validate the nature of the identifier before treating it as a sender candidate. The patch introduces heuristics to detect conversation-like identifiers.
Vulnerable Logic (Conceptual):
The original logic blindly trusted the from parameter.
// Previous implementation of resolveSenderCandidates
export function resolveSenderCandidates(params: { senderId: string, from: string, ... }) {
const candidates = [params.senderId];
// CRITICAL FLAW: Unconditionally adds 'from', which could be a group ID
if (params.from) candidates.push(params.from);
return candidates;
}Patched Logic (Commit 08e2aa44):
The patch introduces isConversationLikeIdentity to filter out known group patterns (e.g., @g.us for WhatsApp, chat_id: prefixes) and ensures from is only used if the chat type is explicitly direct.
// New utility to detect group/channel identifiers
function isConversationLikeIdentity(value: string): boolean {
const normalized = value.trim().toLowerCase();
// Blocks WhatsApp groups
if (normalized.includes("@g.us")) return true;
// Blocks generic chat IDs
if (normalized.startsWith("chat_id:")) return true;
// Blocks Matrix/Discord style channel identifiers
return /(^|:)(channel|group|thread|topic|room|space|spaces):/.test(normalized);
}
function shouldUseFromAsSenderFallback(params: { from?: string; chatType?: string }): boolean {
const from = (params.from ?? "").trim();
const chatType = (params.chatType ?? "").trim().toLowerCase();
// FIX 1: Only allow fallback if it is a Direct Message (DM)
if (chatType && chatType !== "direct") return false;
// FIX 2: Explicitly reject conversation-like strings
return !isConversationLikeIdentity(from);
}This change ensures that even if a group ID is present in the configuration, the code will refuse to resolve it as a valid sender candidate for a user command.
Exploitation relies on a misconfiguration by the administrator, which is made likely by the ambiguity of the allowFrom setting. An attacker does not need to inject code but simply needs to operate within a context that the administrator has authorized.
Scenario 1: The "Trusted Group" Fallacy
openclaw.json, the admin adds the Group ID (e.g., -100123456789) to commands.allowFrom, believing this restricts the bot to listening in that group./exec rm -rf /.Scenario 2: WhatsApp Group Hijacking
/reset or /config commands to take over the bot infrastructure.The impact of this vulnerability is rated High due to the potential for complete system compromise. OpenClaw is often deployed in environments with access to personal data, calendars, emails, and potentially the host server's shell (via the /exec or /shell tools, if enabled).
Confidentiality: Attackers can use commands to retrieve chat logs, personal notes, or API keys stored in the bot's memory.
Integrity: Unauthorized users can modify the bot's configuration, change its behavior, or poison its knowledge base.
Availability: Malicious users can issue a /reset command, wiping the bot's state, or cause a denial of service by spamming resource-intensive commands.
If the bot is running in a Docker container with mounted volumes or on a host with elevated privileges, the impact extends to the underlying infrastructure. The vulnerability essentially collapses the security model from "Authorized Users Only" to "Anyone in an Authorized Context".
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | < 2026.3.2 | 2026.3.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-287 |
| Vulnerability Type | Identity Confusion |
| CVSS Score | 8.1 |
| Attack Vector | Network |
| Affected Component | src/auto-reply/command-auth.ts |
| Fix Commit | 08e2aa44e78a9c946d97bea62304e6f533b8fa8e |
Improper Authentication - Identity Confusion