GHSA-wpc6-37g7-8q4w: OpenClaw: exec allowlist bypass via shell init-file options
GHSA-wpc6-37g7-8q4w MEDIUMOpenClaw's exec allowlist can be bypassed by crafting shell-wrapper invocations that use init-file flags (`--rcfile`, `--init-file`, `--startup-file`), causing the shell to inherit allowlist trust while loading attacker-chosen initialization scripts instead of the approved one. This is a targeted security control bypass — not generic RCE — but in AI agent deployments where exec allowlists are the primary sandbox boundary, a bypass undermines the entire trust model for that control. There is no public exploit, no CISA KEV entry, and EPSS data is not yet available, but OpenClaw already has 37 prior CVEs and an associated incident (AIID #1368) documenting malicious skill abuse in its ecosystem, suggesting it is an active target. Patch to `openclaw >= 2026.3.31` (or `2026.4.1`) immediately; if patching is not immediately possible, audit all shell-wrapper command shapes in your agent workflows and disable exec allowlist until updated.
Risk Assessment
Medium risk overall, but elevated in AI agent contexts. Exploitation requires the allowlist feature to be active and the attacker to control or influence shell command arguments — a realistic condition in multi-tenant or plugin-enabled agent deployments. The blast radius is scoped to the allowlist bypass rather than full RCE, but in an agent framework where the allowlist IS the execution control plane, bypassing it can enable privilege escalation, unauthorized script execution, and persistence within the agent environment. CWE-184 (Incomplete List of Disallowed Inputs) is a consistently exploitable class when the attacker can probe input shape variations.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| openclaw | npm | < 2026.3.31 | 2026.3.31 |
Do you use openclaw? You're affected.
Severity & Risk
Recommended Action
- Patch: Upgrade `openclaw` (npm) to `>= 2026.3.31` or the current release `2026.4.1`.
- Workaround: If patching is not immediately feasible, disable exec allowlist or allow-always execution behavior until the patch is applied.
- Detection: Audit shell command execution logs for invocations of `bash`, `sh`, `zsh`, or other shells containing `--rcfile`, `--init-file`, or `--startup-file` flags, particularly where the referenced file path does not match the expected allowlisted script.
- Harden: Review all OpenClaw agent configurations to ensure no third-party skills or plugins can inject shell-wrapper command shapes. Given the prior malicious skills incident (AIID #1368), audit the full ClawHub skill inventory in use.
Classification
Compliance Impact
This CVE is relevant to:
Related AI Incidents (1)
Source: AI Incident Database (AIID)
Technical Details
NVD Description
## Summary Before OpenClaw 2026.3.31, exec allowlist matching could treat shell init-file wrapper invocations as if the approved script itself were being executed. Shell options such as `--rcfile`, `--init-file`, and `--startup-file` could therefore inherit allowlist trust from a matched script path even though the shell loaded attacker-chosen initialization first. ## Impact This issue only applied when exec allowlist or allow-always behavior was enabled and the attacker could steer a shell-wrapper command shape that used init-file options. The result was a narrower allowlist bypass, not generic arbitrary command execution from an untrusted boundary. ## Affected Packages / Versions - Package: `openclaw` (npm) - Affected versions: `< 2026.3.31` - Patched versions: `>= 2026.3.31` - Latest published npm version: `2026.4.1` ## Fix Commit(s) - `0c8375424620e12777ef24c162eedc7e9fcfd7e3` — reject shell init-file script matches ## Release Process Note The fix shipped in OpenClaw `2026.3.31` on March 31, 2026. The current published npm release `2026.4.1` from April 1, 2026 also contains the fix. Thanks @cyjhhh for reporting.
Exploitation Scenario
An attacker with the ability to influence shell command arguments within an OpenClaw agent — for example, through a malicious plugin, a poisoned tool definition, or injected input — crafts a command such as `bash --rcfile /tmp/attacker.sh /path/to/allowlisted-script.sh`. Because the allowlist matches on the script path at the end of the command, trust is granted. The shell, however, loads `/tmp/attacker.sh` as its initialization file before executing, running attacker-controlled code with inherited allowlist permissions. In a CISO-relevant scenario, this could be chained with a malicious OpenClaw skill (as seen in AIID #1368) to silently execute a credential harvester or establish persistence within the agent's host environment.
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