CVE-2026-31999: OpenClaw: CWD injection enables integrity loss on Windows
MEDIUMOpenClaw, a Windows AI agent framework, contains a current working directory injection flaw in its .cmd/.bat wrapper resolution logic that allows a local attacker with low privileges to execute arbitrary commands by placing a malicious script in an attacker-controlled directory. Although the CVSS score is 6.3 (Medium) and the attack requires high complexity, EPSS places this in the top 85th percentile for exploitation likelihood, and OpenClaw's skills ecosystem was already actively abused to deliver credential-stealing malware (AIID #1368), demonstrating motivated threat actors targeting this exact platform. Successful exploitation corrupts AI agent command execution integrity with High integrity and High availability impact — an attacker can silently redirect tool invocations to arbitrary scripts without any network-level access. Organizations running OpenClaw on Windows should upgrade immediately to version 2026.3.1 and restrict agent process working directories to trusted, non-user-writable paths as a compensating control.
What is the risk?
Medium risk overall, elevated for organizations where OpenClaw agents run in shared or user-influenced directories such as CI/CD runners, developer workstations, or multi-tenant agent platforms. The local attack vector (AV:L) prevents direct remote exploitation, but the high complexity requirement (AC:H) is achievable through workspace poisoning, CI/CD pipeline manipulation, or post-compromise staging — techniques well within the reach of threat actors who are already known to target OpenClaw's ecosystem. The absence of a public exploit and CISA KEV listing tempers urgency; however, the top-85th-percentile EPSS score signals meaningful attacker interest relative to the broader CVE population. Integrity and availability are both rated High, meaning exploitation can tamper with agent outputs or fully disrupt agent operations — a disproportionate operational impact for a Medium-severity CVSS score.
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?
5 steps-
Upgrade OpenClaw to version 2026.3.1 immediately — this release eliminates the unsafe CWD fallback during wrapper resolution.
-
If patching is blocked, restrict the process working directory of all OpenClaw invocations to a trusted, non-user-writable system path via process launch configuration or CI/CD job definitions.
-
Apply least-privilege to OpenClaw processes — ensure agents do not run with administrative or elevated privileges to limit blast radius of exploitation.
-
Enable file integrity monitoring on directories where OpenClaw executes to detect unexpected .cmd/.bat files appearing at runtime.
-
Monitor Windows process creation (Event ID 4688 or Sysmon Event ID 1) for .cmd/.bat executions spawned from OpenClaw parent processes as an anomaly detection signal indicative of exploitation.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-31999?
OpenClaw, a Windows AI agent framework, contains a current working directory injection flaw in its .cmd/.bat wrapper resolution logic that allows a local attacker with low privileges to execute arbitrary commands by placing a malicious script in an attacker-controlled directory. Although the CVSS score is 6.3 (Medium) and the attack requires high complexity, EPSS places this in the top 85th percentile for exploitation likelihood, and OpenClaw's skills ecosystem was already actively abused to deliver credential-stealing malware (AIID #1368), demonstrating motivated threat actors targeting this exact platform. Successful exploitation corrupts AI agent command execution integrity with High integrity and High availability impact — an attacker can silently redirect tool invocations to arbitrary scripts without any network-level access. Organizations running OpenClaw on Windows should upgrade immediately to version 2026.3.1 and restrict agent process working directories to trusted, non-user-writable paths as a compensating control.
Is CVE-2026-31999 actively exploited?
No confirmed active exploitation of CVE-2026-31999 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-31999?
1. Upgrade OpenClaw to version 2026.3.1 immediately — this release eliminates the unsafe CWD fallback during wrapper resolution. 2. If patching is blocked, restrict the process working directory of all OpenClaw invocations to a trusted, non-user-writable system path via process launch configuration or CI/CD job definitions. 3. Apply least-privilege to OpenClaw processes — ensure agents do not run with administrative or elevated privileges to limit blast radius of exploitation. 4. Enable file integrity monitoring on directories where OpenClaw executes to detect unexpected .cmd/.bat files appearing at runtime. 5. Monitor Windows process creation (Event ID 4688 or Sysmon Event ID 1) for .cmd/.bat executions spawned from OpenClaw parent processes as an anomaly detection signal indicative of exploitation.
What systems are affected by CVE-2026-31999?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, CI/CD pipelines, developer workstations, multi-tenant agent platforms.
What is the CVSS score for CVE-2026-31999?
CVE-2026-31999 has a CVSS v3.1 base score of 6.3 (MEDIUM). The EPSS exploitation probability is 0.24%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0011 User Execution AML.T0050 Command and Scripting Interpreter AML.T0053 AI Agent Tool Invocation AML.T0110 AI Agent Tool Poisoning Compliance Controls Affected
What are the technical details?
Original Advisory
OpenClaw versions 2026.2.26 prior to 2026.3.1 on Windows contain a current working directory injection vulnerability in wrapper resolution for .cmd/.bat files that allows attackers to influence execution behavior through cwd manipulation. Remote attackers can exploit improper shell execution fallback mechanisms to achieve command execution integrity loss by controlling the current working directory during wrapper resolution.
Exploitation Scenario
An adversary with local access — or the ability to influence the working directory of an OpenClaw agent session through a poisoned project workspace, a malicious skill package distributed via ClawHub, or a compromised CI/CD job — places a crafted wrapper.cmd file in the expected resolution path. When OpenClaw invokes a tool that triggers the Windows shell fallback mechanism during .cmd/.bat wrapper resolution, the malicious script executes under the agent's process identity instead of the legitimate binary. The attacker gains arbitrary command execution under the agent's context, can modify outputs fed to downstream consumers, and can disrupt availability by terminating the agent process — all without any network-level footprint, consistent with the Local attack vector.
Weaknesses (CWE)
CWE-78 — Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'): The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
- [Architecture and Design] If at all possible, use library calls rather than external processes to recreate the desired functionality.
- [Architecture and Design, Operation] Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2026-33579 9.9 OpenClaw: scope bypass escalates low-priv to admin
Same package: openclaw CVE-2026-32922 9.9 OpenClaw: privilege escalation to RCE via token scope bypass
Same package: openclaw CVE-2026-30741 9.8 OpenClaw: RCE via request-side prompt injection
Same package: openclaw CVE-2026-32038 9.8 OpenClaw: sandbox bypass enables container lateral movement
Same package: openclaw CVE-2026-53838 9.8 OpenClaw: approval scope bypass via reconnection state
Same package: openclaw