Skip to content
Threat Feed
high advisory

OpenClaw Improper Environment Variable Handling Vulnerability

OpenClaw before 2026.4.20 is vulnerable to improper environment variable namespace reservation, allowing attackers to override critical runtime variables via workspace dotenv files.

OpenClaw versions prior to 2026.4.20 are susceptible to an environment variable namespace collision vulnerability. This flaw stems from the application’s failure to properly reserve the OPENCLAW_ runtime-control environment namespace within workspace dotenv files. By crafting malicious workspaces, attackers can set variables like OPENCLAW_GIT_DIR to manipulate OpenClaw runtime behavior during critical operations, such as source updates and installer workflows. This vulnerability allows for the potential hijacking of trusted OpenClaw runtime processes.

Attack Chain

  1. Attacker crafts a malicious workspace containing a dotenv file.
  2. The dotenv file includes environment variables prefixed with OPENCLAW_, such as OPENCLAW_GIT_DIR.
  3. The victim user imports or uses the attacker-controlled workspace in OpenClaw.
  4. OpenClaw loads the dotenv file, inadvertently overriding its own runtime configuration.
  5. During a source-update operation, OpenClaw uses the attacker-controlled OPENCLAW_GIT_DIR to locate the Git repository.
  6. The attacker redirects OpenClaw to a malicious Git repository under their control.
  7. OpenClaw executes commands from the attacker’s malicious Git repository, leading to code execution.

Impact

Successful exploitation allows attackers to execute arbitrary code within the context of the OpenClaw application. This could lead to the compromise of the user’s system, data exfiltration, or further malicious activities. Given the potentially widespread use of OpenClaw in development environments, this vulnerability poses a significant risk to organizations using affected versions.

Recommendation

  • Upgrade to OpenClaw version 2026.4.20 or later to remediate the vulnerability (CVE-2026-44114).
  • Implement file integrity monitoring on workspace dotenv files to detect unauthorized modifications.
  • Deploy the Sigma rule Detect OpenClaw Environment Variable Overrides to identify suspicious processes modifying OpenClaw’s runtime behavior.

Detection coverage 2

Detect OpenClaw Environment Variable Overrides

medium

Detects processes attempting to set environment variables with the OPENCLAW_ prefix, potentially indicating an attempted override.

sigma tactics: defense_evasion techniques: T1070 sources: process_creation, windows

Detect OpenClaw Git Directory Manipulation

high

Detects processes that utilize a modified git directory, potentially indicating an attempt to use a malicious repository.

sigma tactics: defense_evasion techniques: T1070 sources: process_creation, windows

Detection queries are kept inside the platform. Get full rules →