CVE-2026-41396: OpenClaw: Workspace `.env` can override the bundled plugin trust root
OpenClaw up to 2026.3.28 let a `.env` file in the workspace set OPENCLAW_BUNDLED_PLUGINS_DIR, the trust root for bundled plugins. A malicious repository can point it at its own directory so that OpenClaw loads attacker code. Fixed in 2026.3.31.
Published Apr 3, 2026 · Updated May 6, 2026 · Analysis Oct 30, 2026
What an attacker can do
OpenClaw loads a .env file from the workspace. The variable OPENCLAW_BUNDLED_PLUGINS_DIR tells it where the trusted, bundled plugins live. In v2026.3.28 a workspace .env could still set it, so a cloned repository could redirect that trust root to a folder inside the repo. OpenClaw would then load the repo's plugins as if they shipped with the product.
The attacker needs the victim to open an attacker-controlled workspace, such as a repository from an untrusted source. The CVSS vector reflects that: local, no privileges, user interaction required. The maintainers say critical would overstate it, because it depends on the workspace being loaded and is not a universal remote break.
The outcome is code execution as the user running OpenClaw, with access to that user's files, tokens and agent sessions. This is the same class of risk as a repository-supplied configuration that changes what a coding agent trusts.
Who is affected
The npm package openclaw, versions 2026.3.28 and earlier. Anyone who runs OpenClaw inside a repository or folder they did not create is exposed. Check the version:
npm ls openclaw
openclaw --versionCheck workspaces for a .env file that sets OPENCLAW_BUNDLED_PLUGINS_DIR.
openclaw
- Ecosystem
- npm
- Affected
- <= 2026.3.28
- Fixed in
- 2026.3.31
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.3.31, the first stable tag with the fix.
npm install -g [email protected]The fix commit adds OPENCLAW_BUNDLED_HOOKS_DIR and OPENCLAW_BUNDLED_SKILLS_DIR to the blocked workspace dotenv keys. Tests confirm that a workspace .env setting the three bundled-directory variables (plugins, hooks, skills) no longer changes the process environment, on both the workspace load path and the CLI startup path. The sources list no workaround. Until you upgrade, inspect .env files in unfamiliar repositories before running OpenClaw there.
How to tell if you were hit
Search repositories and workspaces for .env files containing OPENCLAW_BUNDLED_PLUGINS_DIR, OPENCLAW_BUNDLED_HOOKS_DIR or OPENCLAW_BUNDLED_SKILLS_DIR.
grep -rn "OPENCLAW_BUNDLED" --include=.env .Check which plugin directory OpenClaw loaded, and look for plugin code you did not install. Beam can record the shell commands and file access of an agent working in a cloned repository, and its rules can flag risky ones.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Workspace .env can override the bundled plugin trust root
Current Maintainer Triage
- Status: open
- Normalized severity: high
- Assessment: v2026.3.28 still lets workspace .env override OPENCLAW_BUNDLED_PLUGINS_DIR, but critical is too high because exploitation still depends on attacker-controlled workspace loading, not a universal remote break.
Affected Packages / Versions
- Package:
openclaw(npm) - Latest published npm version:
2026.3.31 - Vulnerable version range:
<=2026.3.28 - Patched versions:
>= 2026.3.31 - First stable tag containing the fix:
v2026.3.31
Fix Commit(s)
330a9f98cb29c79b1c16a2117e03d6276a0d6289— 2026-03-31T19:25:12+09:00
OpenClaw thanks @nexrin for reporting.
Credited to nexrin, KeenSecurityLab, qclawer.
Questions
- Which OpenClaw version fixes the plugin trust root override?
2026.3.31. Versions up to and including 2026.3.28 are affected. The fix commit is 330a9f9.
- Does the attacker need to be on my machine?
No, but the victim must load an attacker-controlled workspace, for example a cloned repository with a malicious
.env. The CVSS vector marks user interaction as required.- Which variables does the fix cover?
It blocks workspace
.envfrom setting the bundled plugins, hooks and skills directory variables: OPENCLAW_BUNDLED_PLUGINS_DIR, OPENCLAW_BUNDLED_HOOKS_DIR and OPENCLAW_BUNDLED_SKILLS_DIR.
References
Read for this analysis:
- https://github.com/openclaw/openclaw/security/advisories/GHSA-qcj9-wwgw-6gm8
- https://github.com/openclaw/openclaw/releases/tag/v2026.3.31
- https://nvd.nist.gov/vuln/detail/CVE-2026-41396
- https://www.vulncheck.com/advisories/openclaw-environment-variable-override-of-plugin-trust-root
- https://github.com/advisories/GHSA-qcj9-wwgw-6gm8
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 entriesCVE-2026-62197
OpenClaw: Browser CDP discovery could accept blocked WebSocket URLs
medium8.5Oct 21, 2026CVE-2026-35630
OpenClaw: QQBot native approval buttons did not enforce configured approver identity
high8.0Jul 2, 2026CVE-2026-53806
OpenClaw: Combined POSIX shell options could confuse exec revalidation
high8.8Jul 2, 2026CVE-2026-53809
OpenClaw: Embedded runner policy could be confused by provider aliases
medium3.8Jul 2, 2026CVE-2026-53810
OpenClaw's marketplace runtime extension metadata could point at unscanned payloads
high8.8Jul 2, 2026CVE-2026-53811
OpenClaw: Matrix allowFrom could bind to mutable display names
high8.8Jul 2, 2026
