CVE-2026-53831: OpenClaw: safe-bin allowlist bypass via shell expansion
HIGHOpenClaw's system.run tool validates commands against a safe-bin allowlist but suffers a TOCTOU gap: the allowlist check passes on the surface command string, then POSIX shell expansion rewrites it at execution time, running attacker-controlled instructions entirely outside the approved set. Any authenticated operator — a low-privilege role — can exploit this to read arbitrary node-local files, exposing LLM API keys, database credentials, and agent configuration secrets. With a CVSS of 8.3 (network-reachable, low complexity, no user interaction required), the practical barrier is minimal for anyone holding an operator account, and the 174 prior CVEs in the same package further erode confidence in the codebase's security baseline. Patch to OpenClaw 2026.5.18 or later immediately; if patching is delayed, strip operator role assignment to the minimum necessary set, restrict the OpenClaw process user's filesystem permissions, and rotate all secrets stored on affected nodes.
What is the risk?
High. CVSS 8.3 with a network attack vector, low privilege requirement, and no user interaction means any authenticated operator in a shared or multi-tenant OpenClaw deployment can exploit this without specialized AI or security knowledge — shell metacharacter injection is well-understood and scripts are freely available. No public exploit or CISA KEV listing exists today, keeping near-term opportunistic exploitation lower, but the technique transfers trivially from general shell injection tradecraft. Confidentiality and integrity are both rated HIGH by NVD, reflecting the ability to read sensitive files and potentially chain into downstream service compromise. The 4 downstream dependents constrain blast radius at the package level, but AI agent deployments handle high-value credentials that make even narrow exploitation disproportionately impactful.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| OpenClaw | pip | — | No patch |
Do you use OpenClaw? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Patch: Upgrade OpenClaw to 2026.5.18 or later immediately — this is the only complete fix.
-
Restrict operator role: Audit all accounts with operator access; remove it from any account that does not strictly require system.run capability.
-
Workaround (if patching is delayed): Run the OpenClaw process under a restricted OS user with minimal filesystem permissions (no access to .env files, secret stores, or credential directories). Consider disabling system.run entirely if not operationally required.
-
Detection: Scan system.run call logs for shell metacharacters ($, ;, |, &&, backtick, >, <, {, }); alert on any allowlisted command string containing these characters.
-
Credential rotation: Assume any node-local file accessible to the OpenClaw process user may have been read; rotate all API keys, database passwords, and service tokens on affected nodes.
-
Monitor: Alert on unexpected outbound connections or anomalous file access patterns from the OpenClaw process.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-53831?
OpenClaw's system.run tool validates commands against a safe-bin allowlist but suffers a TOCTOU gap: the allowlist check passes on the surface command string, then POSIX shell expansion rewrites it at execution time, running attacker-controlled instructions entirely outside the approved set. Any authenticated operator — a low-privilege role — can exploit this to read arbitrary node-local files, exposing LLM API keys, database credentials, and agent configuration secrets. With a CVSS of 8.3 (network-reachable, low complexity, no user interaction required), the practical barrier is minimal for anyone holding an operator account, and the 174 prior CVEs in the same package further erode confidence in the codebase's security baseline. Patch to OpenClaw 2026.5.18 or later immediately; if patching is delayed, strip operator role assignment to the minimum necessary set, restrict the OpenClaw process user's filesystem permissions, and rotate all secrets stored on affected nodes.
Is CVE-2026-53831 actively exploited?
No confirmed active exploitation of CVE-2026-53831 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-53831?
1. Patch: Upgrade OpenClaw to 2026.5.18 or later immediately — this is the only complete fix. 2. Restrict operator role: Audit all accounts with operator access; remove it from any account that does not strictly require system.run capability. 3. Workaround (if patching is delayed): Run the OpenClaw process under a restricted OS user with minimal filesystem permissions (no access to .env files, secret stores, or credential directories). Consider disabling system.run entirely if not operationally required. 4. Detection: Scan system.run call logs for shell metacharacters ($, ;, |, &&, backtick, >, <, {, }); alert on any allowlisted command string containing these characters. 5. Credential rotation: Assume any node-local file accessible to the OpenClaw process user may have been read; rotate all API keys, database passwords, and service tokens on affected nodes. 6. Monitor: Alert on unexpected outbound connections or anomalous file access patterns from the OpenClaw process.
What systems are affected by CVE-2026-53831?
This vulnerability affects the following AI/ML architecture patterns: AI agent frameworks, Agentic task orchestration pipelines, Multi-tenant AI platforms, AI development and CI/CD environments.
What is the CVSS score for CVE-2026-53831?
CVE-2026-53831 has a CVSS v3.1 base score of 8.3 (HIGH).
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application AML.T0050 Command and Scripting Interpreter AML.T0053 AI Agent Tool Invocation AML.T0083 Credentials from AI Agent Configuration Compliance Controls Affected
What are the technical details?
Original Advisory
OpenClaw before 2026.5.18 contains a policy enforcement vulnerability in system.run safe-bin allowlist validation that allows shell expansion to modify command interpretation on POSIX nodes. Authenticated operators can exploit shell metacharacters in approved commands to read unintended node-local files and expose sensitive configuration data.
Exploitation Scenario
An authenticated operator — a developer, automated CI pipeline service account, or a compromised internal user — submits a system.run call using an approved binary such as 'cat' or 'echo', appending a shell metacharacter payload: for example, 'cat /tmp/approved-file; cat /opt/openclaw/.env'. The safe-bin allowlist validates 'cat' as permitted and passes the full string to the POSIX shell. The shell interprets the semicolon as a command separator, executing both the approved read and the attacker-controlled read. The contents of /opt/openclaw/.env — likely containing OPENAI_API_KEY, DATABASE_URL, CLERK_SECRET_KEY, or equivalent — are returned to the operator. The adversary then uses these credentials to call the LLM provider directly, query the vector database with no audit trail, or escalate privileges across connected services, potentially reaching the broader AI infrastructure. This attack path closely mirrors the credential exfiltration pattern documented in AIID #1368 for the OpenClaw ecosystem.
Weaknesses (CWE)
CWE-367 — Time-of-check Time-of-use (TOCTOU) Race Condition: The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
- [Implementation] The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
- [Implementation] When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L References
Timeline
Related Vulnerabilities
CVE-2026-30741 9.8 OpenClaw: RCE via request-side prompt injection
Same package: openclaw CVE-2026-28451 9.3 OpenClaw: SSRF via Feishu extension exposes internal services
Same package: openclaw GHSA-cwj3-vqpp-pmxr 8.8 openclaw: Model bypasses authz to persist unsafe config
Same package: openclaw CVE-2026-35674 8.8 OpenClaw: scope bypass enables full agent admin takeover
Same package: openclaw CVE-2026-53811 8.8 OpenClaw: privilege escalation via identity spoofing
Same package: openclaw