Skip to content
Threat Feed
medium advisory

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
  1. 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

  1. Attacker crafts a malicious OpenClaw workspace.
  2. Within the workspace, the attacker creates a .env file.
  3. The .env file contains the line OPENCLAW_BUNDLED_PLUGINS_DIR=/path/to/attacker/plugins.
  4. 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.
  5. The attacker distributes the malicious workspace to a victim. This could be via email, shared storage, or other means.
  6. The victim opens the malicious workspace with a vulnerable version of OpenClaw (<= 2026.3.28).
  7. OpenClaw reads the .env file and sets the OPENCLAW_BUNDLED_PLUGINS_DIR environment variable accordingly.
  8. 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 Override to detect attempts to override the plugin directory via .env files.
  • Implement file integrity monitoring for OpenClaw workspaces to detect unauthorized modifications to .env files.
  • Educate users about the risks of opening workspaces from untrusted sources.

Detection coverage 2

Detect OpenClaw Plugin Directory Override

medium

Detects attempts to override the OpenClaw plugin directory using a .env file. This may indicate a malicious workspace attempting to load untrusted plugins.

sigma tactics: defense_evasion techniques: T1562.001 sources: file_event, linux

Detect Suspicious File Creation in OpenClaw Plugin Directory

low

Detects creation of executable files (e.g., .js, .py, .sh) within the OpenClaw plugin directory. Requires auditd or similar filesystem monitoring.

sigma tactics: persistence techniques: T1547.001 sources: file_event, linux

Detection queries are available on the platform. Get full rules →