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

CVE-2026-22177: OpenClaw's config env vars allowed startup env injection into service runtime

mediumCVSS 4.0 6.9 · 3.1 8.8GHSA-8fmp-37rc-p5g7

OpenClaw up to 2026.2.19-2 copied process-control variables such as NODE_OPTIONS, LD_* and DYLD_* from the config env.vars section into the gateway service's runtime environment. Anyone who can write that config gets code execution at service startup. Upgrade the npm package openclaw to 2026.2.21.

Published Mar 3, 2026 · Updated Apr 8, 2026 · Analysis Oct 31, 2026

What an attacker can do

collectConfigEnvVars() accepted any key from the config's env.vars. buildGatewayInstallPlan() merged those values into the environment used to install the gateway daemon. Nothing blocked startup-control variables on that path.

NODE_OPTIONS can make Node preload a module with --require. LD_PRELOAD on Linux and DYLD_INSERT_LIBRARIES on macOS load a shared library into the process. Any of them runs the attacker's code when the gateway starts, in the OpenClaw process context and with its permissions.

The attacker needs a way to change the OpenClaw config, such as a low-privileged account on the host, a writable shared config, or a tool that edits config. Two CVSS scores are published: 4.0 gives 6.9 with local access and low privileges, and 3.1 gives 8.8 with network access. The integrity impact is high in both. Gateway services usually hold model API keys and channel tokens, so code execution there exposes them.

Who is affected

npm package openclaw, versions up to and including 2026.2.19-2, including 2026.2.19. The data lists everything before 2026.2.21 as vulnerable. Your config matters: look for dangerous keys under env.vars. Check the 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 (fix commit 2cdbadee1f8fcaa93302d7debbfc529e19868ea4). That commit also hardens other env handling paths.

npm install [email protected]

After upgrading, remove any NODE_OPTIONS, LD_* or DYLD_* entries from env.vars that you did not add yourself, and reinstall the gateway service so its environment is rebuilt.

How to tell if you were hit

Inspect the OpenClaw config and the installed service definition (launchd plist or systemd unit) for NODE_OPTIONS, LD_PRELOAD, LD_LIBRARY_PATH or DYLD_* entries you did not set. Look for modules or libraries in unusual locations that those variables point to, and at config file modification times. Beam can show config file changes made by an agent on the same machine.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

OpenClaw allowed dangerous process-control environment variables from env.vars (for example NODE_OPTIONS, LD_*, DYLD_*) to flow into gateway service runtime environments, enabling startup-time code execution in the OpenClaw process context.

Details

collectConfigEnvVars() accepted unfiltered keys from config and those values were merged into the daemon install environment in buildGatewayInstallPlan(). Before the fix, startup-control variables were not blocked in this path.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Latest published affected version: 2026.2.19-2 (published February 19, 2026)
  • Affected range (structured): <=2026.2.19-2 || =2026.2.19
  • Patched version (pre-set for next release): >= 2026.2.21

Fix Commit(s)

  • 2cdbadee1f8fcaa93302d7debbfc529e19868ea4

Release Process Note

patched_versions is pre-set to the planned next release (2026.2.21). Once that npm release is published, this advisory is ready to publish without further content edits.

OpenClaw thanks @tdjackey for reporting.

Credited to tdjackey.

Questions

Which variables are the problem in CVE-2026-22177?

Startup-control variables such as NODE_OPTIONS, LD_* and DYLD_*, set under env.vars in the OpenClaw config. They were passed to the gateway service environment without filtering.

Is this the same fix as the BASH_ENV advisory?

Both use commit 2cdbadee1f8fcaa93302d7debbfc529e19868ea4 and are fixed in 2026.2.21, but they cover different paths: this one is config-to-service env, the other is host command execution.

Does the attacker need config access?

Yes. The injected variables come from the config env.vars section, so the attacker must be able to write it.

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