CVE-2026-22177: OpenClaw: env var injection via config enables code execution
MEDIUMOpenClaw versions before 2026.2.21 do not filter dangerous process-control environment variables such as NODE_OPTIONS or LD_* when loading config env.vars. An attacker who can write to the configuration can therefore get arbitrary code to run when the gateway service starts. Exploitation needs local access and low privileges, and the CVSS score is 6.1 (medium). There is no CISA KEV listing, no public exploit and no Nuclei template, and EPSS data is unavailable, so near-term mass exploitation looks unlikely. The package has only 3 downstream dependents, but the gateway often holds agent credentials and tool access, so any config-write foothold can become code execution in that context. Upgrade to 2026.2.21 or later, and restrict who and what can write OpenClaw configuration files in the meantime.
What is the risk?
Medium overall. The attack is local with low complexity, low privileges and no user interaction (AV:L/AC:L/PR:L/UI:N). The main impact is high integrity loss plus some availability impact, and confidentiality impact is not scored. Exposure depends on who can modify the gateway config: shared hosts, CI/CD-managed configs, mounted volumes and config-sync mechanisms raise the risk. Exploitation signals are weak: not in CISA KEV, no public exploit, no Nuclei template, and no EPSS or SSVC data. Real-world risk rises if the gateway runs with broad credentials or tool permissions, because injected code inherits that runtime context.
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?
1 step1) Upgrade OpenClaw to 2026.2.21 or later; the fix is in the vendor commit 2cdbadee1f8fcaa93302d7debbfc529e19868ea4 referenced in the GHSA advisories. 2) Restrict write access to OpenClaw config files and directories to the service owner and administrators, and keep them out of shared or world-writable mounts. 3) Audit existing config env.vars for NODE_OPTIONS, NODE_PATH, LD_PRELOAD, LD_LIBRARY_PATH and similar process-control variables, and treat unexpected entries as a possible compromise. 4) Run the gateway as a least-privilege user with scoped credentials and, where possible, in a container or sandbox with a read-only config. 5) Monitor config file integrity and alert on changes or on unusual child processes spawned at gateway start. 6) Rotate secrets available to the gateway if tampering is found.
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-22177?
OpenClaw versions before 2026.2.21 do not filter dangerous process-control environment variables such as NODE_OPTIONS or LD_* when loading config env.vars. An attacker who can write to the configuration can therefore get arbitrary code to run when the gateway service starts. Exploitation needs local access and low privileges, and the CVSS score is 6.1 (medium). There is no CISA KEV listing, no public exploit and no Nuclei template, and EPSS data is unavailable, so near-term mass exploitation looks unlikely. The package has only 3 downstream dependents, but the gateway often holds agent credentials and tool access, so any config-write foothold can become code execution in that context. Upgrade to 2026.2.21 or later, and restrict who and what can write OpenClaw configuration files in the meantime.
Is CVE-2026-22177 actively exploited?
No confirmed active exploitation of CVE-2026-22177 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-22177?
1) Upgrade OpenClaw to 2026.2.21 or later; the fix is in the vendor commit 2cdbadee1f8fcaa93302d7debbfc529e19868ea4 referenced in the GHSA advisories. 2) Restrict write access to OpenClaw config files and directories to the service owner and administrators, and keep them out of shared or world-writable mounts. 3) Audit existing config env.vars for NODE_OPTIONS, NODE_PATH, LD_PRELOAD, LD_LIBRARY_PATH and similar process-control variables, and treat unexpected entries as a possible compromise. 4) Run the gateway as a least-privilege user with scoped credentials and, where possible, in a container or sandbox with a read-only config. 5) Monitor config file integrity and alert on changes or on unusual child processes spawned at gateway start. 6) Rotate secrets available to the gateway if tampering is found.
What systems are affected by CVE-2026-22177?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, AI agent gateway services, local/self-hosted AI assistants.
What is the CVSS score for CVE-2026-22177?
CVE-2026-22177 has a CVSS v3.1 base score of 6.1 (MEDIUM). The EPSS exploitation probability is 0.39%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0050Command and Scripting InterpreterAML.T0081Modify AI Agent ConfigurationCompliance Controls Affected
What are the technical details?
Original Advisory
OpenClaw versions prior to 2026.2.21 fail to filter dangerous process-control environment variables from config env.vars, allowing startup-time code execution. Attackers can inject variables like NODE_OPTIONS or LD_* through configuration to execute arbitrary code in the OpenClaw gateway service runtime context.
Exploitation Scenario
An attacker with low-privileged local access, for example a compromised build job, a shared developer host or a malicious plugin that can write files, edits the OpenClaw configuration to add env.vars entries such as NODE_OPTIONS=--require /tmp/payload.js. When the gateway restarts, whether on a routine redeploy or after a forced crash, the payload runs inside the gateway process before any agent controls apply. The attacker then reads provider API keys and connected-service tokens, and installs persistence that survives restarts through the same config.
Weaknesses (CWE)
CWE-15 — External Control of System or Configuration Setting: One or more system settings or configuration elements can be externally controlled by a user.
- [Architecture and Design] Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
- [Implementation, Architecture and Design] Because setting manipulation covers a diverse set of functions, any attempt at illustrating it will inevitably be incomplete. Rather than searching for a tight-knit relationship between the functions addressed in the setting manipulation category, take a step back and consider the sorts of system values that an attacker should not be allowed to control.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:LReferences
- github.com/openclaw/openclaw/commit/2cdbadee1f8fcaa93302d7debbfc529e19868ea4patch
- github.com/openclaw/openclaw/security/advisories/GHSA-8fmp-37rc-p5g7vendor-advisory
- github.com/openclaw/openclaw/security/advisories/GHSA-w9j9-w4cp-6wgrvendor-advisory
- vulncheck.com/advisories/openclaw-environment-variable-injection-via-config-env-varsthird-party-advisory
Timeline
Related Vulnerabilities
CVE-2026-221729.9OpenClaw: WebSocket scope self-elevation grants admin
Same package: openclawCVE-2026-335799.9OpenClaw: scope bypass escalates low-priv to admin
Same package: openclawCVE-2026-329229.9OpenClaw: privilege escalation to RCE via token scope bypass
Same package: openclawCVE-2026-307419.8OpenClaw: RCE via request-side prompt injection
Same package: openclawCVE-2026-320389.8OpenClaw: sandbox bypass enables container lateral movement
Same package: openclaw