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

GHSA-w9cg-v44m-4qv8: OpenClaw affected by BASH_ENV / ENV startup-file injection into spawned shell commands

highCVSS 4.0 7.3

OpenClaw up to 2026.2.19-2 let attacker-influenced BASH_ENV or ENV values reach shell commands it spawned on the host. Those variables make a shell source a startup file before the real command runs, so the file's code executes first. Upgrade the npm package openclaw to 2026.2.21 or later.

Published Mar 3, 2026 · Analysis Oct 31, 2026

What an attacker can do

BASH_ENV (for bash) and ENV (for POSIX sh) name a file that a non-interactive shell runs before its command. If an attacker can place such a variable in the environment of an OpenClaw host command, the attacker's file runs before the intended command, with the permissions of the OpenClaw process.

The advisory says values could be admitted from several places and then inherited: per-request overrides, the ambient process environment, config-driven env injection, and skill env overrides. The macOS host execution path was covered too.

The attacker needs local or privileged influence over configuration or environment inputs. The advisory states there is no standalone remote unauthenticated trigger and rates the practical impact as medium, while the CVSS 4.0 vector rates confidentiality, integrity and availability high with local access and low privileges. The risk is greatest where a lower-privileged user, a shared skill or an untrusted config can set env values for an agent that runs commands.

Who is affected

npm package openclaw, versions up to and including 2026.2.19-2 (the data lists everything before 2026.2.21 as vulnerable). Exposure needs an attacker-controlled value for BASH_ENV, ENV or a similar startup variable to reach host command execution. Check your version:

npm ls openclaw

openclaw

Ecosystem
npm
Affected
< 2026.2.21
Fixed in
2026.2.21
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.2.21. The fix, commit 2cdbadee1f8fcaa93302d7debbfc529e19868ea4, blocks dangerous startup and runtime env keys and prefixes in the shared host env sanitizer, sanitizes the inherited environment even without per-request overrides, blocks dangerous config-driven env injection, applies the same sanitizer on macOS host execution, and aligns skill env override handling with it.

npm install [email protected]

How to tell if you were hit

Check OpenClaw config files, skill definitions and the launching environment for BASH_ENV or ENV entries. Run env | grep -E '^(BASH_ENV|ENV)=' in the context that starts OpenClaw. Review the files those variables point to for unexpected content. Beam records the shell commands an agent runs, so it can show commands that started right after an unexpected startup file was sourced.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

BASH_ENV / ENV startup-file injection could lead to unintended pre-command shell execution when attacker-controlled environment values were admitted and then inherited by host command execution paths.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Affected: <= 2026.2.19-2
  • Fixed on main: 2cdbadee1f8fcaa93302d7debbfc529e19868ea4
  • Planned patched release version: 2026.2.21

Details

The fix hardens environment handling across all relevant execution paths:

  • Blocks dangerous startup/runtime env keys and prefixes in shared host env sanitization.
  • Sanitizes inherited ambient environment even when no per-request overrides are provided.
  • Blocks dangerous config-driven env injection before values enter process environment.
  • Uses the same sanitizer in macOS host execution paths.
  • Aligns skill env override sanitization with the shared dangerous-env policy.

Impact

Medium. Exploitation requires local/privileged influence over configuration or environment inputs; there is no standalone remote unauthenticated trigger from this issue alone.

Fix Commit(s)

  • 2cdbadee1f8fcaa93302d7debbfc529e19868ea4

Release Process Note

patched_versions is pre-set to the planned next release (2026.2.21). Once npm [email protected] is published, the advisory can be published without further field edits.

OpenClaw thanks @tdjackey for reporting.

Credited to tdjackey.

Questions

Can this be exploited remotely without authentication?

Not on its own. The advisory says exploitation needs local or privileged influence over configuration or environment inputs, and there is no standalone remote unauthenticated trigger.

What do BASH_ENV and ENV do?

They name a startup file that a non-interactive bash or POSIX shell runs before the command. Control of the value gives code execution before the intended command.

Which version of OpenClaw fixes GHSA-w9cg-v44m-4qv8?

2026.2.21. The advisory lists 2026.2.19-2 and earlier as affected.

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