GHSA-w9j9-w4cp-6wgr: openclaw: env var injection enables host exec hijacking
GHSA-w9j9-w4cp-6wgr MEDIUMOpenClaw, a local AI agent (npm), allows host-executed subprocesses to inherit the full parent environment, exposing shell-stored credentials, API keys, and build tool tokens to manipulation by interpreters and scripts — a CWE-78 OS command injection flaw embedded in the agent's execution model. While no public exploit, CISA KEV listing, or EPSS score is currently available, this package carries 60 prior CVEs — a persistent security deficit that signals systemic code quality issues beyond this single advisory. The risk is amplified by the OpenClaw skills ecosystem: AIID #1368 documents malicious ClawHub skills already weaponized to exfiltrate credentials, and env var injection provides exactly the mechanism such skills need to escalate access silently. Patch to 2026.4.8 immediately and audit all environment variables exposed in shells where OpenClaw executes.
Risk Assessment
Medium CVSS in isolation, but contextually elevated for AI agent deployments. The local execution scope limits direct remote exploitability, but the skills marketplace supply chain vector removes the requirement for physical access — a malicious skill installed from ClawHub can trigger the env var injection without additional user interaction beyond skill invocation. The 60 prior CVEs in this package are a strong signal that the security boundary around host-exec has not been rigorously maintained. Developer workstations and CI/CD pipelines running OpenClaw are the highest-risk environments due to the density of cloud credentials, tokens, and secrets typically present in those shell environments.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| openclaw | npm | < 2026.4.8 | 2026.4.8 |
Do you use openclaw? You're affected.
Severity & Risk
Recommended Action
- Patch immediately: upgrade openclaw to 2026.4.8 (verified fixed commit: d7c3210cd6f5fdfdc1beff4c9541673e814354d5).
- Before patching, audit all environment variables present in shells where OpenClaw runs — rotate any cloud credentials, API keys, or tokens stored in shell profiles or dotfiles.
- Apply env sanitization as a defense-in-depth measure: wrap OpenClaw invocations with 'env -i' or an explicit allowlist of required variables to prevent secret leakage even if a future regression occurs.
- Audit installed OpenClaw skills against the ~17% malicious skill rate documented in AIID #1368 — uninstall unverified third-party skills.
- Enable process-level monitoring on hosts running OpenClaw to detect anomalous child process spawning or unexpected outbound network connections.
Classification
Compliance Impact
This CVE is relevant to:
Related AI Incidents (1)
Source: AI Incident Database (AIID)
Frequently Asked Questions
What is GHSA-w9j9-w4cp-6wgr?
OpenClaw, a local AI agent (npm), allows host-executed subprocesses to inherit the full parent environment, exposing shell-stored credentials, API keys, and build tool tokens to manipulation by interpreters and scripts — a CWE-78 OS command injection flaw embedded in the agent's execution model. While no public exploit, CISA KEV listing, or EPSS score is currently available, this package carries 60 prior CVEs — a persistent security deficit that signals systemic code quality issues beyond this single advisory. The risk is amplified by the OpenClaw skills ecosystem: AIID #1368 documents malicious ClawHub skills already weaponized to exfiltrate credentials, and env var injection provides exactly the mechanism such skills need to escalate access silently. Patch to 2026.4.8 immediately and audit all environment variables exposed in shells where OpenClaw executes.
Is GHSA-w9j9-w4cp-6wgr actively exploited?
No confirmed active exploitation of GHSA-w9j9-w4cp-6wgr has been reported, but organizations should still patch proactively.
How to fix GHSA-w9j9-w4cp-6wgr?
1. Patch immediately: upgrade openclaw to 2026.4.8 (verified fixed commit: d7c3210cd6f5fdfdc1beff4c9541673e814354d5). 2. Before patching, audit all environment variables present in shells where OpenClaw runs — rotate any cloud credentials, API keys, or tokens stored in shell profiles or dotfiles. 3. Apply env sanitization as a defense-in-depth measure: wrap OpenClaw invocations with 'env -i' or an explicit allowlist of required variables to prevent secret leakage even if a future regression occurs. 4. Audit installed OpenClaw skills against the ~17% malicious skill rate documented in AIID #1368 — uninstall unverified third-party skills. 5. Enable process-level monitoring on hosts running OpenClaw to detect anomalous child process spawning or unexpected outbound network connections.
What systems are affected by GHSA-w9j9-w4cp-6wgr?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, local developer tooling, CI/CD pipelines.
What is the CVSS score for GHSA-w9j9-w4cp-6wgr?
No CVSS score has been assigned yet.
Technical Details
NVD Description
## Impact OpenClaw Host-Exec Environment Variable Injection. Host exec could inherit environment variables that influence interpreters, shells, or build tools. OpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary. ## Affected Packages / Versions - Package: `openclaw` (npm) - Affected versions: `<= 2026.3.28` - Patched versions: `2026.4.8` ## Fix The issue was fixed on `main` and is available in the patched npm version listed above. The verified fixed tree is commit `d7c3210cd6f5fdfdc1beff4c9541673e814354d5`. ## Verification The fix was re-checked against `main` before publication, including targeted regression tests for the affected security boundary. ## Credits Thanks @wsparks-vc for reporting.
Exploitation Scenario
An adversary publishes a seemingly useful OpenClaw skill to the ClawHub marketplace — a code formatter or productivity tool. A developer installs it and invokes it during a normal workflow. The skill internally triggers a host-exec call with a crafted argument designed to read specific environment variables (AWS_ACCESS_KEY_ID, ANTHROPIC_API_KEY, GITHUB_TOKEN) that OpenClaw inherited from the developer's shell. The subprocess exfiltrates these values via an outbound HTTPS request to an adversary-controlled endpoint, disguised as telemetry. The developer sees no error — the skill completes normally. The adversary now has live cloud credentials with the developer's full access scope.
Weaknesses (CWE)
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-m3mh-3mpg-37hw 8.6 OpenClaw: .npmrc hijack enables RCE on plugin install
Same package: openclaw CVE-2026-27001 7.8 OpenClaw: prompt injection via unsanitized workspace path
Same package: openclaw GHSA-hr5v-j9h9-xjhg 7.7 OpenClaw: sandbox escape via mediaUrl path traversal
Same package: openclaw
AI Threat Alert