News

OpenClaw: Three Flaws Chain a WhatsApp Message to Full Host Escape With No Prior Foothold

Three OpenClaw flaws let an external WhatsApp message chain into full host escape via command injection and path traversal. Fixed in OpenClaw 2026.6.6.
Sami Malik
Copywriter

Three security flaws in OpenClaw, an AI coding agent framework, can be chained to escape from a sandboxed environment to the host machine starting with nothing more than an external WhatsApp message. The full chain requires no prior foothold in the target environment. It starts from a message received through a channel that AI agents commonly monitor for user instructions, combines two operating system command injection flaws with a path traversal vulnerability, and ends with Docker socket access and full host escape. Researcher Chinmohan Nayak published the details, which affect OpenClaw versions before 2026.6.6.

The three vulnerabilities are tracked as GHSA-hjr6-g723-hmfm (CVSS 8.8), GHSA-9969-8g9h-rxwm (CVSS 8.8), and GHSA-575v-8hfq-m3mc (CVSS 8.4). The two 8.8 vulnerabilities are OS command injection flaws in OpenClaw's host execution environment filtering. The 8.4 vulnerability is the path traversal and symlink following issue that enables the blocked-directory bypass at the core of the chain. The fix is in OpenClaw version 2026.6.6.

The Command Injection Flaws

OpenClaw's sandbox model is designed to allow AI agents to execute commands within a controlled environment. The sandbox maintains an allowlist of operations and a blocklist of restricted actions, attempting to limit what the agent can do to what the user has authorised. The two OS command injection vulnerabilities (GHSA-hjr6-g723-hmfm and GHSA-9969-8g9h-rxwm) exploit "an incomplete list of disallowed inputs" in the filtering layer that checks commands before they reach the host execution environment.

OS command injection at this layer means the attacker's input, arriving through the WhatsApp channel that OpenClaw is configured to monitor, contains payload content that the filter does not recognise as restricted. Because the filter's blocklist is incomplete, the payload passes through and executes on the host with the permissions of the OpenClaw process. The two separate advisories for what appear to be similar injection conditions suggest two distinct code paths where the incomplete filtering applies, each reachable through different message types or command structures that an agent might process.

The consequence of OS command injection in an AI agent framework is more significant than in a typical web application context because of the position AI agents occupy. They are often granted broad permissions to accomplish the tasks users assign them, including file system access, code execution, and connectivity to internal services. An injection vulnerability that gives an attacker execution control within the agent process therefore starts from an already-privileged position, not from a generic low-privilege web application context.

The Path Traversal Flaw and How Blocked Directories Fail

The third vulnerability, GHSA-575v-8hfq-m3mc, is the mechanism that enables the full host escape. OpenClaw maintains a list of blocked directories that the agent should not be allowed to access: the advisory specifically mentions ~/.ssh, ~/.aws, and ~/.gnupg as examples of directories that OpenClaw blocks to prevent access to SSH keys, AWS credentials, and GPG keyrings.

The specific function that enforces this blocking is getBlockedReasonForSourcePath(). The flaw is in the direction of the check: the function tests whether the source path being accessed is under a blocked directory. What it fails to test is whether a blocked directory is under the source path. This means an attacker can specify a parent directory of a blocked directory as the path to mount or access. If ~/.ssh is blocked but the check only verifies whether the requested path starts with ~/.ssh, then requesting /home passes the check because /home is not under ~/.ssh. But /home contains ~/.ssh, so mounting or accessing /home gives the attacker access to the blocked directory through the parent.

Nayak's demonstration of the chain uses this flaw to mount the parent directory containing the blocked credential directories. Once mounted, all the files that OpenClaw is specifically configured to protect become accessible: SSH private keys, AWS access keys and secret keys, GPG private keys. From those credentials, the attacker can authenticate to external services, push code to version-controlled repositories, or access cloud resources, all from within what appeared to be a sandboxed environment.

Docker Socket and Full Host Escape

The chain's final step is Docker socket access enabling "full host escape from inside the sandbox." The Docker socket at /var/run/docker.sock is the API endpoint that controls the Docker daemon. An agent that gains read-write access to the Docker socket can spawn new containers with arbitrary configurations, including containers that mount the host's file system root, containers with host network access, and containers with the --privileged flag that removes all capability restrictions. Any of these configurations gives the attacker effective root access on the host machine.

Docker socket access is often present in agent deployment environments because running containers is a common capability that AI agents need for tasks like setting up development environments, running tests in isolation, or building container images. When the Docker socket is in the agent's environment to enable legitimate container operations, the path traversal vulnerability that bypasses blocked-directory checks becomes a route to Docker socket access, which becomes a route to full host control.

Nayak's characterisation of this chain as requiring no prior foothold, distinguishing it from "previous Claw Chain vulnerabilities disclosed in May 2026" that had additional prerequisites, is the point that makes the WhatsApp-to-host chain particularly concerning. The attack path originates from an external, unauthenticated message sent through a public-facing communication channel to an AI agent. The agent's input processing, not any direct network exposure of the host, is the attack surface.

What OpenClaw Is and Who Is Affected

OpenClaw is a framework for building AI coding agents that can receive instructions through various channels including chat interfaces, WhatsApp, and other messaging platforms, and execute coding tasks autonomously. It is one of several open-source frameworks competing in the AI agent coding assistant space, designed for developers and teams who want to automate development workflows or provide AI coding assistance through communication channels their teams already use.

The WhatsApp integration that the exploit chain starts from is representative of a design choice common to many AI agent frameworks: making the agent accessible through communication channels that end users prefer, including consumer messaging apps. This design choice means that the agent's input can originate from anywhere that can send a WhatsApp message, which in a typical deployment includes anyone with the agent's WhatsApp number or group membership. The sandbox that is supposed to contain the agent's operations and protect the host from its inputs is the component that the OpenClaw chain defeats.

Developers and teams running OpenClaw versions prior to 2026.6.6 should update immediately. For environments where updating is not immediately possible, the recommended mitigations are to enable sandbox mode for non-main sessions, remove "exec" from the tool allowlist for channel-facing agents, and monitor git clone commands with "ext::" external protocol helpers. None of these mitigations completely close the attack surface described in the advisory; they reduce it by limiting the commands available to the agent and adding visibility into suspicious operations.

The Broader Problem: AI Agent Sandboxes and Trusted Input

The OpenClaw chain illustrates a structural tension in AI agent security that is not specific to OpenClaw. Any agent that receives instructions from external channels and executes operations on the host or in connected systems must trust that either the input is safe or the sandbox containing execution is sufficient to prevent harm even from unsafe input. The OpenClaw vulnerabilities demonstrate that the latter assumption, that a sandbox with a blocklist is sufficient containment, fails when the blocklist is incomplete and when the blocking logic checks the wrong direction.

The architectural implication is that AI agents receiving input from channels where the sender is not fully authenticated and authorised, which includes any public or semi-public messaging interface, should be deployed with the assumption that they will receive adversarial input at some point. The sandbox must be designed to contain that adversarial input even when the specific form of the attack was not anticipated at design time. A blocklist-only approach to sandbox security is known to be incomplete; OpenClaw's path traversal vulnerability demonstrates why in concrete terms.

The recommendation to remove "exec" from the tool allowlist for channel-facing agents reflects this principle: the safest configuration for an agent that receives input from external parties is one where the most powerful operations are not available by default. Agent capabilities should be provisioned based on what is necessary for the specific task the agent performs, not based on the full capability set the framework supports. Organisations that deploy AI agents on internal infrastructure and connect them to external communication channels should review their agent configurations in light of the OpenClaw advisory, even if they do not use OpenClaw directly.

Privilege and Trust in AI Agent Deployments: The OpenClaw Lesson Applied Broadly

The three OpenClaw vulnerabilities are each fixable as individual code defects. The incomplete input filter can be extended to cover the payloads it missed. The blocked-directory check can be inverted to also check whether a blocked directory is a subdirectory of the requested path. These are engineering fixes that OpenClaw 2026.6.6 delivers. But the architectural lesson from the chain, where three individually addressable code issues combine to produce a WhatsApp-to-root-of-host attack with no prior foothold required, is more widely applicable.

The principle that emerges is about the relationship between input channels, trust levels, and execution permissions in AI agent deployments. OpenClaw accepts instructions from WhatsApp, a channel where the sender is not necessarily authenticated or authorised. It processes those instructions in an agent that has significant execution capabilities on the host. The sandbox that is supposed to limit those capabilities to a safe subset relies on a blocklist that is incomplete. The combination of these three design decisions, each individually defensible, creates an attack surface that is larger than any one of them suggests in isolation.

For security architects reviewing AI agent deployments in their organisations, the OpenClaw chain suggests specific questions: What is the trust level of the input channels this agent accepts instructions from? What is the minimum privilege set this agent needs to accomplish its purpose? Does the sandbox rely on a blocklist (incomplete by nature) or a least-privilege allowlist? Is the blocking logic tested for both directions of containment? Can an operator mount or access a parent directory of a blocked path? These questions are not OpenClaw-specific; they are the right questions to ask about any agent that combines external input channels with host execution capabilities.

Monitoring and Detection in the Interim

For teams running OpenClaw versions prior to 2026.6.6 who cannot immediately update, the detection signals that indicate a GhostLock-style chain attempt are specific to the command patterns the exploit requires.

The OS command injection payloads (CVE GHSA-hjr6-g723-hmfm and GHSA-9969-8g9h-rxwm) will produce shell command execution events in the agent's execution logs. Monitoring for commands that include shell metacharacters (semicolons, pipe characters, backticks, dollar signs followed by parentheses) in inputs received from external channels is a detection signal for injection attempts. These characters are not typically present in legitimate coding instructions passed through a messaging interface.

The path traversal chain (GHSA-575v-8hfq-m3mc) will produce mount operations or file access events targeting parent directories of the standard blocked paths. Monitoring for access requests to /home, /root, or /var as top-level paths, rather than specific subdirectories within those paths, is a behavioural indicator of the bypass technique. Similarly, access to the Docker socket from processes associated with the OpenClaw agent is a signal that the container escape phase of the chain may be in progress.

These detection signals are not substitutes for patching, but they provide a window of detection during which a compromise attempt can be identified and interrupted before the chain reaches its final host-escape stage. Organisations with endpoint detection tools that can monitor process execution and file system operations from the OpenClaw agent process should configure alerts for these patterns as an interim measure until the update to 2026.6.6 can be completed.

Why No Prior Foothold Matters: The Full Attack Surface Calculation

Nayak's distinction that the OpenClaw chain requires no prior foothold, unlike "previous Claw Chain vulnerabilities disclosed in May 2026," changes the risk calculation in a specific way. Vulnerabilities that require a prior foothold assume that the attacker has already compromised something, whether a user account, a connected service, or a process on the target machine. The security controls designed to prevent that prior compromise are part of the defence against the subsequent vulnerability. Remove the prior foothold requirement, and those upstream controls no longer apply.

In OpenClaw's architecture, the WhatsApp channel the agent monitors is the prior foothold requirement's replacement. An attacker who can send a WhatsApp message to the agent, whether because they know the agent's WhatsApp number, because they are in a group the agent monitors, or because they send from a number the agent accepts, has the entry point. For deployments where the WhatsApp integration is intended to serve external users, the pool of potential attackers is, by definition, external and unauthenticated.

This full-external, no-foothold characterisation means that the threat model for OpenClaw deployments must treat the WhatsApp-to-host chain as a reachable path from the internet, not a path that is mitigated by network perimeter controls. Network perimeter controls prevent direct access to internal services; they do not prevent messages from being delivered to a WhatsApp-monitored agent. The chain enters through the agent's communication channel, not through the network perimeter. This is the category of vulnerability that makes the OpenClaw chain particularly significant from an architectural perspective: the attack surface is a communication channel, not a network service.

Responsible Use of AI Agent Frameworks in Production Environments

The OpenClaw vulnerabilities are a concrete example of why deploying AI agent frameworks in production environments, particularly with connections to external communication channels, requires security assessment beyond what the framework's documentation covers. Framework documentation typically describes capabilities, not threat models. The capability to receive instructions via WhatsApp is presented as a feature. The security consequences of that feature when the agent has significant host execution capabilities are not documented in the same place and are not obvious from the feature description.

Security assessment for AI agent deployments should include: a threat model of the input channels (who can send instructions, with what authentication, from what network positions), a review of the agent's execution capabilities and their interaction with the sandbox model, a red-team exercise that attempts to craft adversarial inputs through each input channel, and a review of the sandbox implementation against known bypass techniques. The OpenClaw path traversal bypass, testing only one direction of containment rather than both, is the kind of implementation flaw that a targeted red-team exercise would likely identify.

The update to OpenClaw 2026.6.6 resolves the specific vulnerabilities documented by Nayak. Organisations running older versions should update as the primary mitigation. For organisations where immediate updating is not possible, removing the exec tool from the agent's allowlist for external-channel-facing agents, as OpenClaw's maintainers recommend, is the highest-priority interim mitigation. Exec removal eliminates the OS command injection vectors (GHSA-hjr6-g723-hmfm and GHSA-9969-8g9h-rxwm) while the update is prepared, reducing the exploitable surface significantly even though the path traversal flaw remains.

The broader lesson is that the security review of AI agent deployments should be treated with the same rigour as the security review of any software that combines internet-accessible input channels with significant host or infrastructure execution capabilities. The speed of AI agent development and deployment has outpaced the development of standard security assessment practices for this category of software. The OpenClaw chain is an early example of what that gap looks like when exploited.

Updating and Verifying the Patch

The update to OpenClaw 2026.6.6 is the definitive fix for all three vulnerabilities in the chain. After updating, organisations should verify the installed version with the version command specific to their OpenClaw deployment method, confirm that the exec tool has been removed from the allowlist for agents that face external communication channels if that configuration was previously in place as a mitigation, and run a brief test of the WhatsApp integration to verify that the update has not introduced any regression in legitimate functionality. A post-patch test of the path traversal mitigation, by attempting to request a parent directory of a blocked path and confirming it is rejected, validates that the fix for GHSA-575v-8hfq-m3mc is active and effective in the specific deployment configuration.

Organisations that have deployed OpenClaw in architectures other than the direct WhatsApp integration described in Nayak's research should review their specific input channel configurations to determine whether those channels also accept input from unauthenticated or partially-authenticated external sources. Any channel that does carries a version of the risk described in the WhatsApp chain, with the specific attack surface shaped by the authentication model of that channel rather than WhatsApp's. The fix resolves the code-level vulnerabilities; the architectural review ensures that the deployment configuration does not re-expose the same surface through a different input channel.

How Defendis Can Help

Long-undetected kernel flaws, forced infrastructure shutdowns, AI agent attack chains, and destructive backdoors masquerading as ransomware represent distinct threat categories with a shared characteristic: your team needs signal before the attack reaches its final stage. Defendis monitors the external exposure your organisation presents, credential leaks tied to your domain, and threat actor activity targeting your sector and infrastructure. When a vulnerability in the software your organisation runs starts drawing exploitation interest, or when indicators tied to a threat group like CyberAv3ngers appear in your environment, you get the alert before it becomes a crisis. See how continuous exposure monitoring changes response outcomes, or request a tailored briefing for your organisation.

About the author
Sami Malik is a copywriter passionate about crafting clear, engaging, and impactful content that helps brands connect with their audience through storytelling and strategy.

Related Articles

Discover simplified
Cyber Risk Management
Learn how to prevent cyberattacks proactively with a free trial of Defendis.