AgentbeamBeta
AI agent vulnerability · OpenClaw

CVE-2026-4039: OpenClaw: Skill env override host env injection via applySkillConfigEnvOverrides (defense-in-depth)

mediumCVSS 4.0 5.1GHSA-82g8-464f-2mv7

OpenClaw up to 2026.2.19-2 copies skill env values from its config into the host process environment without the host env safety policy. A variable such as NODE_OPTIONS can then change runtime and child-process behavior. Upgrade to 2026.2.21.

Published Feb 27, 2026 · Updated Mar 12, 2026 · Analysis Nov 23, 2026

What an attacker can do

The function applySkillConfigEnvOverrides took the values under skills.entries.NAME.env in OpenClaw's config and put them into the host process.env. It skipped the host env safety policy, so dangerous process-level variables went through when unset. NODE_OPTIONS is the example in the advisory. It can load code or change flags in Node processes that OpenClaw starts.

The attacker must already be able to edit OpenClaw's local state or config, for example the openclaw.json file in the user's home folder, or a skill config that reaches it. That is a write primitive on the user's own files, so maintainers filed it as defense-in-depth. The practical use is to turn a config write into code execution in the agent's runtime, for instance through a shared or synced config or a skill that edits settings. Maintainers rate it moderate.

Who is affected

The npm package openclaw 2026.2.19-2 and earlier. Check:

npm ls openclaw

Then look at skills.entries in your openclaw.json for env blocks you did not write.

openclaw

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

How to fix it

Upgrade to 2026.2.21 or later. The fix, commit 8c9f35cdb51692b650ddf05b259ccdd75cc9a83c, sanitizes skill env overrides and blocks dangerous host environment keys, including NODE_OPTIONS, before applying them. Regression tests cover the blocked keys. The advisory names no workaround.

How to tell if you were hit

Read the OpenClaw config file and check each skills.entries env block for NODE_OPTIONS or other process-level variables such as loader and preload settings. Check file change times on the config. Beam records agent file access, which can show writes to it.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

applySkillConfigEnvOverrides previously copied skills.entries.*.env values into the host process.env without applying the host env safety policy.

Impact

In affected versions, dangerous process-level variables such as NODE_OPTIONS could be injected when unset, which can influence runtime/child-process behavior.

Required attacker capability

An attacker must be able to modify OpenClaw local state/config (for example ~/.openclaw/openclaw.json) to set skills.entries.<skill>.env or related skill config values.

Remediation

Fixed in 2026.2.21 by sanitizing skill env overrides and blocking dangerous host env keys (including NODE_OPTIONS) before applying overrides, with regression tests covering blocked dangerous keys.

Fix Commit(s)

  • 8c9f35cdb51692b650ddf05b259ccdd75cc9a83c

Found using MCPwner

Credited to nedlir.

Questions

Can a remote attacker use this alone?

No. The attacker must be able to modify OpenClaw's local state or config, such as the openclaw.json file, to set the skill env values.

Which version fixes CVE-2026-4039?

OpenClaw 2026.2.21. Versions up to 2026.2.19-2 are affected.

Which variables does the fix block?

It blocks dangerous host environment keys before applying overrides, including NODE_OPTIONS. The advisory does not list every key.

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