OpenClaw Workspace .env Overrides Bundled Plugin Trust Root
OpenClaw versions up to 2026.3.28 are vulnerable to a workspace-level .env file overriding the bundled plugin trust root, potentially allowing for the execution of malicious plugins when an attacker-controlled workspace is loaded.
Triage facts
Revision 2- Evidence
- Unknown
- Severity
- Medium
- Sources
- 1 public source
- Freshness
- Revision 2Apr 3, 02:48 UTC
- Detection
- 2 rules
Revision history 1 entry · Revision 2
- Revision 2
Repaired a legacy canonical identity collision
Changed: slug
OpenClaw, a workspace application, is susceptible to a vulnerability where the OPENCLAW_BUNDLED_PLUGINS_DIR environment variable can be overridden by a .env file within a workspace. This allows a malicious actor to craft a workspace containing a .env file that points to a directory containing malicious plugins. If a user opens this attacker-controlled workspace in a vulnerable version of OpenClaw (<= 2026.3.28), the application will load and execute these malicious plugins. This vulnerability was reported by @nexrin and patched in version 2026.3.31. The risk is elevated when OpenClaw is used to process workspaces from untrusted sources.
Attack Chain
- Attacker crafts a malicious OpenClaw workspace.
- Within the workspace, the attacker creates a
.envfile. - The
.envfile contains the lineOPENCLAW_BUNDLED_PLUGINS_DIR=/path/to/attacker/plugins. - The attacker places malicious plugins in the directory specified by
/path/to/attacker/plugins. These could be JavaScript or other executable formats depending on OpenClaw's plugin architecture. - The attacker distributes the malicious workspace to a victim. This could be via email, shared storage, or other means.
- The victim opens the malicious workspace with a vulnerable version of OpenClaw (<= 2026.3.28).
- OpenClaw reads the
.envfile and sets theOPENCLAW_BUNDLED_PLUGINS_DIRenvironment variable accordingly. - OpenClaw loads and executes the attacker-controlled plugins from the specified directory, leading to arbitrary code execution within the context of the OpenClaw process.
Impact
Successful exploitation allows an attacker to execute arbitrary code within the OpenClaw environment. The impact could include data theft, modification of workspace files, or further compromise of the victim's system. The severity is tied to user interaction as the victim must open the attacker-crafted workspace. While the number of affected users is not specified in the advisory, organizations using OpenClaw for sensitive projects are most at risk.
Recommendation
- Upgrade OpenClaw to version 2026.3.31 or later to remediate the vulnerability.
- Deploy the Sigma rule
Detect OpenClaw Plugin Directory Overrideto detect attempts to override the plugin directory via.envfiles. - Implement file integrity monitoring for OpenClaw workspaces to detect unauthorized modifications to
.envfiles. - Educate users about the risks of opening workspaces from untrusted sources.
Detection coverage 2
Detect OpenClaw Plugin Directory Override
mediumDetects attempts to override the OpenClaw plugin directory using a .env file. This may indicate a malicious workspace attempting to load untrusted plugins.
Detect Suspicious File Creation in OpenClaw Plugin Directory
lowDetects creation of executable files (e.g., .js, .py, .sh) within the OpenClaw plugin directory. Requires auditd or similar filesystem monitoring.
Detection queries are available on the platform. Get full rules →