NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · OpenClaw

GHSA-j425-whc4-4jgc: OpenClaw's `system.run` env override filtering allowed dangerous helper-command pivots

mediumCVSS 3.1 6.3

OpenClaw 2026.3.2 and earlier let a caller of system.run pass env overrides such as GIT_SSH_COMMAND, pager and editor hooks, or GIT_CONFIG_* and NPM_CONFIG_* variables to a spawned process. That steers an allowlisted tool like git into running commands the approval never covered. Fixed in OpenClaw 2026.3.7.

Published Mar 9, 2026 · Analysis Oct 31, 2026

What an attacker can do

Approval in system.run is tied to the reviewed binary and argv. The spawned process also inherits request-scoped env overrides, and before the fix src/infra/host-env-security.ts blocked only a narrow set of them. An allowlisted git could be pointed at an attacker command through GIT_SSH_COMMAND, GIT_PROXY_COMMAND, GIT_ASKPASS or GIT_PAGER. Config-loading variables under GIT_CONFIG_ and NPM_CONFIG_ could change how the tool behaves. The reviewed command line still looked harmless.

The caller must already be able to invoke system.run and supply env overrides. This is an approval and allowlist bypass, not an unauthenticated attack. An agent steered by prompt injection, or a low-privilege operator, could gain execution that policy was meant to withhold. The maintainers rate it medium (6.3) because it needs existing execution capability. The flaw is the mismatch between the reviewed command and what actually runs.

Who is affected

The npm package openclaw, versions <= 2026.3.2, where system.run is enabled with an allowlist or approval flow and callers can supply env overrides. This also covers the macOS host policy, which was updated in the same fix. Check the version:

npm ls -g openclaw
openclaw --version

openclaw

Ecosystem
npm
Affected
<= 2026.3.2
Fixed in
2026.3.7
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.3.7, published to npm on March 8, 2026.

npm install -g [email protected]

Commit e27bbe4 adds a blockedOverridePrefixes field to src/infra/host-env-security-policy.json and blocks 23 more exact override keys, including GIT_SSH_COMMAND, GIT_ASKPASS, PAGER, EDITOR, PROMPT_COMMAND, PYTHONSTARTUP and OPENSSL_CONF. It also blocks the GIT_CONFIG_ and NPM_CONFIG_ prefixes. The trusted inherited base environment is unchanged. The sources give no workaround.

How to tell if you were hit

Look in system.run logs for env override maps that contain keys such as GIT_SSH_COMMAND, GIT_PROXY_COMMAND, GIT_ASKPASS, PAGER, EDITOR, PYTHONSTARTUP or anything starting with GIT_CONFIG_ or NPM_CONFIG_. Check process trees for git, npm or less spawning unexpected children, such as a shell started from an ssh command hook. Beam records agent shell commands and rules can flag risky ones, which helps when an agent supplied the overrides.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

system.run env override sanitization allowed dangerous override-only helper-command pivots to reach subprocesses. A caller who could invoke system.run with env overrides could bypass allowlist/approval intent by steering an allowlisted tool through helper-command or config-loading environment variables such as GIT_SSH_COMMAND, editor/pager hooks, and GIT_CONFIG_* / NPM_CONFIG_*.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Latest published vulnerable version: 2026.3.2
  • Affected range: <= 2026.3.2
  • Patched in: 2026.3.7

Details

Before the fix, src/infra/host-env-security.ts blocked only a narrow set of override-only environment variables. Dangerous request-scoped overrides such as GIT_SSH_COMMAND and prefix families such as GIT_CONFIG_* and NPM_CONFIG_* could still survive sanitizeSystemRunEnvOverrides(...) / sanitizeHostExecEnv(...) and reach the spawned process.

That mattered for system.run allowlist and approval flows because approval evaluation was tied to the reviewed binary/argv, while the launched process could still inherit attacker-controlled env overrides that changed helper-command execution or config resolution. For allowlisted tools such as git, this allowed behavior outside the reviewed command semantics.

The fix extends the shared TypeScript and macOS policy to block dangerous override-only exact keys and prefixes while preserving trusted inherited base-environment behavior.

Impact

This is a real protection-bypass issue, but exploitation requires an already tool-enabled caller who can invoke system.run and supply env overrides. In affected deployments, that caller could bypass allowlist/approval intent and trigger helper-command execution or config-loading behavior that is not represented by the approved command line. Maintainer severity is set to medium because the bug still requires that existing execution capability; the vulnerability is the mismatch between reviewed command semantics and the actual spawned-process behavior.

Fix Commit(s)

  • e27bbe4982439da6864160fd1b66445058f74801

Release Process Note

npm 2026.3.7 was published on March 8, 2026. This advisory is fixed in the released package.

Thanks @tdjackey and @SnailSploit for reporting.

Credited to tdjackey, SnailSploit, zpbrent.

Questions

Is OpenClaw 2026.3.2 affected by this env override bypass?

Yes. Versions up to and including 2026.3.2 are affected. Upgrade to 2026.3.7.

Which environment variables are now blocked?

Besides HOME and ZDOTDIR, the fix blocks 23 more keys, including GIT_SSH_COMMAND, GIT_ASKPASS, GIT_PAGER, PAGER, EDITOR, PROMPT_COMMAND, PERL5DB and PYTHONSTARTUP, plus the GIT_CONFIG_ and NPM_CONFIG_ prefixes.

Does an attacker need prior access?

Yes. They need to be a caller who can already invoke system.run and set env overrides. The bug lets them go beyond what the approval covered.

Does this have a CVE id?

Not in our data. It is tracked as GHSA-j425-whc4-4jgc.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More OpenClaw vulnerabilities

All OpenClaw entries