Mar 3, 2026·5 min read·3 visits
A validation flaw in OpenClaw allows sandboxed agents to bypass network isolation by using Docker's 'container:' network mode. This grants access to other containers' namespaces. Fixed in version 2026.2.24.
OpenClaw versions prior to 2026.2.24 contain a critical vulnerability in the sandbox network validation logic. While the system correctly blocked the Docker 'host' network mode to prevent host-level access, it failed to validate against the 'container:<id>' syntax. This oversight allows a malicious or misconfigured sandboxed agent to define its network mode as joining another container's network namespace. By doing so, the sandboxed process bypasses network isolation, gaining access to the target container's private network identity, loopback interface, and internal services.
The core of OpenClaw's security model relies on strictly isolating agents within sandboxed Docker containers. To maintain this boundary, the validateNetworkMode function is responsible for vetting container configurations before execution. Its primary goal is to ensure that a sandboxed process cannot escape its virtualized network environment or access the host's network stack directly.
The vulnerability exists because the validation logic employed a strict allowlist/blocklist approach that was insufficiently comprehensive. While it explicitly prohibited the host network driver—a known dangerous configuration—it did not account for Docker's capability to share network namespaces between containers using the --network=container:<target> syntax. This omission created a logic gap where a technically valid but insecure configuration could pass validation checks.
By exploiting this flaw, an attacker can effectively merge the network stack of the sandboxed agent with that of any other container on the same Docker host, provided they know the target's ID or name. This breaks the fundamental assumption of the sandbox: that the agent operates in a private, isolated network environment.
The root cause is an Incomplete Blocklist implementation in the validateNetworkMode function. The security logic relied on checking the provided network mode string against a specific set of banned values, specifically checking only for the exact string "host".
Docker's network configuration is flexible and accepts the format container:<name|id> to instruct the Docker daemon to place the new container in the same network namespace as an existing one. When this mode is used:
127.0.0.1 in the target become accessible to the new container.Because the validator in src/agents/sandbox/validate-sandbox-security.ts only performed an exact match check (BLOCKED_NETWORK_MODES.has(network)), strings starting with container: were treated as valid custom network names rather than dangerous namespace directives.
The vulnerability resided in src/agents/sandbox/validate-sandbox-security.ts. The original code failed to inspect the structure of the network string, looking only for exact matches against a Set.
const BLOCKED_NETWORK_MODES = new Set(["host"]);
export function validateNetworkMode(network: string | undefined): void {
// VULNERABILITY: Only checks for exact match of "host"
// Fails to catch "container:target-id"
if (network && BLOCKED_NETWORK_MODES.has(network.trim().toLowerCase())) {
throw new Error(`Sandbox security: network mode "${network}" is blocked.`);
}
}The fix introduces a prefix check to catch the container: syntax and adds a "break-glass" option for intentional overrides. This ensures that namespace sharing is blocked by default unless explicitly allowed by the administrator.
export function validateNetworkMode(network: string | undefined, options?: SandboxOptions): void {
const normalized = network?.trim().toLowerCase();
// FIX: Check for "host" AND "container:" prefix
if (normalized === "host" || (normalized && normalized.startsWith("container:"))) {
// Check for explicit override flag
if (options?.allowContainerNamespaceJoin !== true) {
throw new Error(
`Sandbox security: network mode "${network}" is blocked by default. ` +
'Network "container:*" joins another container namespace and bypasses sandbox network isolation. ' +
"Use a custom bridge network, or set dangerouslyAllowContainerNamespaceJoin=true only when you fully trust this runtime."
);
}
}
}To exploit this vulnerability, an attacker requires the ability to configure the docker.network setting for the OpenClaw agent. This is typically done via the openclaw.yml configuration file or dynamic agent provisioning scripts.
Attack Scenario:
postgres-internal) or a sensitive application service.agents:
defaults:
sandbox:
docker:
network: "container:postgres-internal"--network=container:postgres-internal to the Docker daemon.localhost:5432, bypassing any firewall rules that normally restrict external access to the database container.The impact of this vulnerability is critical for multi-tenant or compartmentalized environments relying on Docker sandboxes.
localhost, assuming they are unreachable from outside the container. This vulnerability exposes those interfaces directly to the attacker.This flaw allows lateral movement from a low-privilege sandbox into critical infrastructure components without requiring a container escape exploit against the Linux kernel.
| Product | Affected Versions | Fixed Version |
|---|---|---|
openclaw OpenClaw | < 2026.2.24 | 2026.2.24 |
| Attribute | Detail |
|---|---|
| Vulnerability Type | Sandbox Network Isolation Bypass |
| CWE ID | CWE-668: Exposure of Resource to Wrong Sphere |
| Severity | Critical |
| Affected Component | src/agents/sandbox/validate-sandbox-security.ts |
| Attack Vector | Configuration (Local/Remote) |
| Patch Date | 2026-02-24 |
Exposure of Resource to Wrong Sphere