Mar 4, 2026·6 min read·27 visits
OpenClaw's command validator only checked the primary executable name, ignoring arguments. Attackers could bypass the allowlist by passing malicious payloads as arguments to permitted wrappers like `/usr/bin/env` or `/bin/bash`.
A critical protection mechanism failure in OpenClaw's execution allowlist logic allowed attackers to bypass security restrictions by nesting malicious commands inside permitted wrapper binaries. By failing to recursively analyze command arguments, the system permitted arbitrary code execution if a wrapper like 'env' or 'bash' was present in the allowed list.
OpenClaw, an open-source multi-channel AI gateway, implements an "exec approvals" and "allowlist" system designed to restrict which binaries the platform can execute on the host machine. This mechanism is critical for preventing the AI agent from performing unauthorized system operations or executing arbitrary code.
The vulnerability, identified as GHSA-JJ82-76V6-933R, resides in the logic used to validate these execution requests. The system performed a "shallow" analysis, validating only the primary executable (the first element of the command array) against the defined policy. It failed to inspect subsequent arguments, which is a critical oversight when dealing with wrapper binaries or shell dispatchers.
This flaw allows an attacker to "smuggle" unauthorized commands through the allowlist. If the policy permits a generic wrapper—such as /usr/bin/env, bash, or powershell—an attacker can invoke that permitted binary and pass a malicious payload as an argument. The system correctly identifies the wrapper as allowed but unknowingly executes the hidden payload, resulting in a complete bypass of the execution sandbox.
The root cause of this vulnerability is CWE-693: Protection Mechanism Failure, specifically stemming from CWE-20: Improper Input Validation within the resolveCommandResolutionFromArgv function.
Prior to version 2026.2.23, OpenClaw's validation logic operated on a simple premise: if argv[0] is in the safeBins list, the execution is safe. This logic ignores the operational semantics of command-line utilities. Many binaries, particularly shells and environment setters, are designed specifically to execute other programs defined in their arguments.
env VectorThe /usr/bin/env utility is a prime example of this vector. Its primary purpose is to run a command in a modified environment. When OpenClaw receives a command array like ['/usr/bin/env', 'sh', '-c', 'malicious_script'], the validator only inspects index 0 (/usr/bin/env). If env is whitelisted (a common configuration for setting up runtime environments), the check passes. The operating system then executes env, which immediately hands control over to sh, executing the malicious script. The allowlist is effectively rendered moot because the security boundary does not extend to the semantic payload of the command.
The remediation involved a significant architectural change to how commands are resolved before validation. The fix was implemented in commit 2b63592be57782c8946e521bc81286933f0f99c7.
The vulnerable logic roughly resembled this simplified flow:
// Vulnerable Logic
function validate(argv: string[]) {
const executable = argv[0];
if (allowlist.includes(executable)) {
return true; // Vulnerable: Returns true without checking argv[1..n]
}
return false;
}The patch introduces a recursive unwrapper, unwrapDispatchWrappersForResolution, which "peels" back layers of known dispatchers to find the effective executable. This logic is implemented in both TypeScript and Swift.
// Patched Logic (Conceptual)
function unwrapDispatchWrappersForResolution(argv: string[], depth = 0): string[] {
// 1. Recursion limit to prevent DOS
if (depth > 4) return argv;
const cmd = argv[0];
// 2. Check if the command is a known wrapper (env, bash, sh, etc.)
if (isWrapper(cmd)) {
// 3. Parse arguments to find the next command in the chain
// e.g., for "env VAR=VAL cmd", skip VAR=VAL to find "cmd"
const nextCommand = parseWrapperArgs(argv);
// 4. Recursively resolve the next command
return unwrapDispatchWrappersForResolution(nextCommand, depth + 1);
}
return argv;
}The fix explicitly handles a wide range of shells (bash, zsh, fish, powershell, cmd.exe) and the env utility. It parses flags like -c (execute string) and handles environment variable assignments in env calls to locate the true target binary.
To exploit this vulnerability, an attacker requires the ability to trigger a command execution flow, such as through a system.run tool call or an authenticated API request to the Gateway. The attack relies on the presence of a "living off the land" binary in the allowlist.
/usr/bin/env or a shell like /bin/bash is present in the safeBins allowlist.Example Payload:
{
"tool": "system.run",
"args": [
"/usr/bin/env", // Allowed binary
"python3", // Forbidden binary (smuggled)
"-c",
"import os; os.system('cat /etc/passwd')"
]
}/usr/bin/env, approves the request, and spawns the process. env then executes python3, which executes the Python code, effectively bypassing the restriction on python3.> [!NOTE]
> This technique is effective even against strict allowlists if any dispatcher is permitted. A common misconfiguration is allowing bash to run legitimate maintenance scripts, which inadvertently opens the door to arbitrary script execution via bash -c.
The impact of this vulnerability is Remote Code Execution (RCE), dependent on the contents of the allowlist. While the CVSS score is 6.6 (Medium/High) due to the requirement of an allowed wrapper, the practical impact in default or common configurations is critical.
Confidentiality: An attacker can read sensitive files (SSH keys, configuration secrets) accessible to the OpenClaw process user. Integrity: An attacker can modify system files, install persistence mechanisms, or alter the behavior of the AI agent. Availability: An attacker can crash the service or consume system resources (e.g., fork bombs).
Since OpenClaw often runs with access to internal networks or sensitive data APIs, a breach here can serve as a pivot point for lateral movement within the infrastructure.
Users must upgrade to OpenClaw version 2026.2.23 or later immediately. The patch implements the recursive logic necessary to inspect nested commands.
Even with the patch, relying on software logic to parse complex shell arguments can be fragile. Administrators should adopt a "Defense in Depth" approach:
env, bash, sh, cmd.exe) from safeBins. Only allowlist specific, single-purpose binaries.openclaw security audit command available in the patched version.> [!WARNING]
> The patch has a known limitation: it only recurses 4 levels deep. Extremely complex nested chains (e.g., env env env env env cmd) might still theoretically bypass the check, although this is an edge case. Strict allowlisting remains the most robust defense.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | <= 2026.2.22 | 2026.2.23 |
| Attribute | Detail |
|---|---|
| Vulnerability Type | Protection Mechanism Failure |
| CWE IDs | CWE-693, CWE-20 |
| CVSS v3.1 | 6.6 (Medium/High) |
| Attack Vector | Local / Remote (via API) |
| Exploit Maturity | Proof of Concept Available |
| Fixed Version | 2026.2.23 |
Protection Mechanism Failure
CVE-2026-115895 is a high-severity code injection vulnerability (CWE-94) in the happy-dom npm package prior to version 21.0.4. The vulnerability exists within the ECMAScriptModuleCompiler component, which transforms ECMAScript module syntax into executable Node.js functions when JavaScript evaluation is enabled. Due to an incomplete fix for CVE-2026-33943, the compiler failed to validate local named import aliases against legal JavaScript identifier rules. Attackers supplying crafted module imports—specifically utilizing destructuring default initializers alongside JSON module attributes—can inject arbitrary JavaScript expressions directly into the host Node.js runtime context.
An improper input validation and authorization bypass vulnerability exists in the LangGraph storage layer affecting langgraph, langgraph-checkpoint-postgres, and langgraph-checkpoint-sqlite. Because relational store implementations serialize namespace tuples into dot-delimited strings without validating labels on read, search, delete, and batch operations, an attacker who controls a namespace label can inject periods (.) to traverse namespace boundaries and access, modify, or delete data belonging to other namespaces.
CVE-2026-115886 (GHSA-2wqp-q3c6-ccj5) is a Server-Side Request Forgery (SSRF) and Unsafe Reflection vulnerability in MLflow versions 3.12.0rc0 prior to 3.17.0. Unauthenticated REST API endpoints accept serialized third-party scorer JSON payloads that are dynamically deserialized and reflectively instantiated without sanitizing constructor keyword arguments. When optional dependencies such as trulens and trulens-providers-litellm are installed, attackers can inject egress-steering arguments into the scorer payload, forcing the MLflow server to dispatch outbound HTTP requests to arbitrary internal destinations or cloud metadata services.
CVE-2026-113872 (GHSA-q7qp-rjg7-q26m) is a high-severity denial-of-service vulnerability affecting the multer multipart/form-data upload middleware for Node.js and Express in versions 2.0.0 through 2.4.0. When an endpoint is configured to accept multiple files using an asynchronous fileFilter callback, a crafted, truncated multipart HTTP request can trigger an unhandled error event on the underlying busboy stream parser after request teardown has already completed. Because all error listeners are stripped during teardown, Node.js treats the resulting error event as an uncaught exception and immediately terminates the server process.
CVE-2026-115897 (also tracked as GHSA-m5mm-p8h7-m29v and aliased as CVE-2026-115754) is a Cross-Site Scripting (XSS) vulnerability in the Yahoo serialize-javascript npm package prior to version 7.1.3. The flaw exists in the regular expression used by escapeFunctionBody() to neutralize HTML script closing tags within serialized JavaScript functions. Because function bodies are sanitized in isolation before structural formatting is applied, a function whose string representation terminates directly with the sequence '</script' bypasses the positive lookahead check. When combined with serialization formatting options that introduce whitespace delimiters and a subsequent property that supplies a closing bracket, an attacker can prematurely terminate an enclosing HTML <script> block and inject arbitrary HTML or JavaScript into the rendered document.
CVE-2026-109841 is a Subresource Integrity (SRI) verification bypass vulnerability in undici, the official HTTP/1.1 and HTTP/2 client library for Node.js that powers the global fetch() implementation. The flaw stems from improper handling of case sensitivity (CWE-178) when validating cryptographic hash algorithm tokens within SRI metadata. Because undici compared incoming algorithm identifiers against a strictly lowercase set without prior ASCII-lowercase normalization, valid uppercase or mixed-case tokens such as SHA256- or Sha384- were treated as unrecognized algorithms and discarded. Under SRI forward-compatibility rules, discarding all provided tokens results in an empty integrity list, causing undici to fail open and accept tampered HTTP response bodies without cryptographic verification.