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

> Attackers with tool access can bypass allowlist restrictions in OpenClaw by injecting environment variables to trigger unauthorized helper commands.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Mar 2026

## What is GHSA-j425-whc4-4jgc?

GHSA-j425-whc4-4jgc is a vulnerability in openclaw, published on 9 Mar 2026. 

### Official description

### 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.

## Which versions are affected by GHSA-j425-whc4-4jgc?

2 open source packages ship an affected version, including openclaw.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openclaw` | npm | All versions | 2026.3.7 |
| `openclaw` | npm | All versions | 2026.3.7 |

## How do I fix GHSA-j425-whc4-4jgc?

Upgrade openclaw to 2026.3.7 or later.

## Is GHSA-j425-whc4-4jgc being exploited?

There is no known exploitation of GHSA-j425-whc4-4jgc in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-j425-whc4-4jgc and fix it if it is affected.

What it is: GHSA-j425-whc4-4jgc is a vulnerability in openclaw, published on 9 Mar 2026. 
Exploitation: There is no known exploitation of GHSA-j425-whc4-4jgc in the wild and no public exploit code.

Affected packages and fixed versions:
- openclaw (npm): affected all versions; fixed in 2026.3.7
- openclaw (npm): affected all versions; fixed in 2026.3.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-j425-whc4-4jgc/ (Markdown: https://insights.sbomify.com/GHSA-j425-whc4-4jgc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-j425-whc4-4jgc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-j425-whc4-4jgc/
Summaries are generated and may contain mistakes; the official description above is the record.
