/

CVE-2026-24763

Severity:

HIGH RISK

(8.8)

Command Injection in OpenClaw Docker Sandbox

CVE-2026-24763

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution within Container Context

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenClaw contained a command injection vulnerability in its Docker sandbox execution mechanism caused by unsafe handling of the PATH environment variable when building shell commands.

An authenticated user who could control environment variables was able to influence which binaries were executed inside the container, potentially leading to arbitrary command execution in the sandboxed environment.

Affected context

This vulnerability affects OpenClaw deployments that:

  • Use the Docker-based sandbox execution mechanism for running commands or tools
  • Allow authenticated users or integrated components to influence environment variables, particularly PATH
  • Build shell commands that are executed inside a container, relying on PATH-based resolution of executables

The issue manifests when untrusted or semi-trusted input can modify PATH or related environment variables used by shell command construction in the sandbox.

Exploit preconditions

  • Attack surface: OpenClaw Docker sandbox execution mechanism (within container runtime)
  • Required access: Authenticated access with the ability to control or influence environment variables, especially PATH
  • Trigger point: Execution of shell commands constructed by OpenClaw that rely on PATH for binary resolution
  • Why exploitation is possible: The PATH environment variable is used directly when constructing or executing shell commands, allowing an attacker-controlled PATH to redirect execution to attacker-supplied binaries or scripts instead of intended system utilities.

Why this happens

The core issue is an instance of CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

OpenClaw's Docker sandbox accepted environment values such as PATH from an authenticated context and incorporated them into shell-based command execution logic without enforcing strict validation, canonicalization, or safe command construction patterns.

By allowing untrusted input to influence PATH and relying on shell resolution, the application effectively delegated trust in which executable is run to user-controlled data.

This pattern breaks the security boundary between configuration and execution, enabling an attacker to alter command behavior or inject alternative binaries inside the container.

Potential impact

  • Execution of attacker-controlled binaries or scripts inside the Docker container
  • Bypass of intended command restrictions by shadowing legitimate utilities with malicious ones
  • Unauthorized access to data or secrets accessible within the containerized environment
  • Escalation of privileges within the container if higher-privileged helper tools are invoked
  • Use of the compromised container as a pivot point for further attacks in the surrounding infrastructure, depending on network and permission configuration

General mitigation guidance

Effective mitigation typically focuses on removing the dependency on user-influenced environment variables for security decisions and shell command resolution:

  • Construct commands using fixed, absolute paths to trusted binaries rather than relying on PATH lookup.
  • Sanitize and constrain environment variables passed into the sandbox; do not propagate user-controlled PATH values into security-sensitive execution contexts.
  • Prefer high-level APIs (e.g., direct system calls or language-native libraries) over spawning shell commands wherever possible.
  • When shell invocation is unavoidable, disable shell interpretation features (e.g., use execve-style calls or subprocess APIs with argument arrays and shell=False semantics).
  • Apply least-privilege principles inside the container by limiting available tools, file system access, and outbound connectivity to reduce blast radius if command injection occurs.
  • Separate trust domains: treat any environment configuration that can be influenced by end users as untrusted input, enforcing strict allowlists for environment variables in execution sandboxes.

How teams detect issues like this

Detection commonly involves a mix of code-level and behavioral approaches:

  • Static analysis: Create rules or queries to flag:
  • Shell command construction that depends on PATH or other dynamic environment variables
  • Use of generic shell wrappers (e.g., /bin/sh -c, bash -c) combined with concatenated strings or user-influenced data
  • Code paths where user-controlled settings or profile data flows into environment preparation for subprocesses
  • Code review signals:
  • Any use of PATH or other environment variables in security-sensitive operations
  • Reliance on environment propagation from user sessions into sandboxed containers
  • Lack of explicit whitelisting or fixed binary paths in command execution logic
  • Runtime and policy enforcement:
  • Container security policies that restrict writable locations in PATH and disallow execution from non-standard directories
  • Monitoring of container processes for unexpected binaries being executed or binaries sourced from user-writable paths
  • Automated SAST/IAST tools and CI hooks can surface these patterns early, especially when configured with organization-specific rules for command execution and environment handling.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/771f23d36b95ec2204cc9a0054045f5d8439ea75
github.comgithub.com/openclaw/openclaw/releases/tag/v2026.1.29
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-mc68-q9jw-2h3v

Frequently asked

questions

It can be, but only indirectly. Exploitation requires authenticated access to OpenClaw and the ability to influence environment variables such as PATH that are later used by the Docker sandbox. Remote exploitation depends on how authentication and environment configuration are exposed (e.g., through a web UI or API).

Yes. The description specifies that an authenticated user is required, with the capability to control or influence the environment variables used in the Docker sandbox. Anonymous or unauthenticated users would not typically have the necessary control surface.

The most robust fix is to avoid relying on user-influenced environment variables for command resolution and to eliminate shell-based command construction wherever possible. Commands should use absolute paths to trusted binaries, with carefully curated environment variables, and employ APIs that bypass the shell so that user input cannot change which binary runs or how arguments are parsed.

Prevention starts with design: treat all user-controlled or user-configurable data, including environment variables, as untrusted. Use parameterized execution APIs that do not invoke a shell, avoid interpolating user data into command strings, lock down environment configuration for sandboxed processes, and incorporate targeted security reviews and automated analysis focused on subprocess and shell usage. Establish coding standards that forbid dynamic PATH manipulation in security-sensitive code paths.

Find out what's already
exploitable in your codebase.