<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Environment-Variable-Override — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/environment-variable-override/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 24 Apr 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/environment-variable-override/feed.xml" rel="self" type="application/rss+xml"/><item><title>OpenClaw Arbitrary Code Execution via Environment Variable Override (CVE-2026-41336)</title><link>https://feed.craftedsignal.io/briefs/2026-04-openclaw-env-override/</link><pubDate>Fri, 24 Apr 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-openclaw-env-override/</guid><description>OpenClaw before 2026.3.31 allows attackers to execute arbitrary code by overriding the OPENCLAW_BUNDLED_HOOKS_DIR environment variable using a workspace .env file, enabling the loading of attacker-controlled hook code.</description><content:encoded><![CDATA[<p>OpenClaw versions prior to 2026.3.31 are susceptible to an arbitrary code execution vulnerability, tracked as CVE-2026-41336. This flaw stems from the application&rsquo;s insecure handling of environment variables. Specifically, the OPENCLAW_BUNDLED_HOOKS_DIR environment variable, which dictates the directory from which OpenClaw loads bundled hooks, can be overridden by a workspace-specific .env file. This allows a malicious actor to craft a .env file within an untrusted workspace that points to a directory containing attacker-controlled hook code. Upon loading the workspace, OpenClaw will execute the malicious code, effectively granting the attacker arbitrary code execution within the application&rsquo;s context. This vulnerability poses a significant risk to systems utilizing OpenClaw, as it can lead to complete system compromise.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker creates a malicious hook code file (e.g., <code>evil_hook.py</code>) containing arbitrary code to be executed.</li>
<li>The attacker creates a directory (e.g., <code>/tmp/evil_hooks</code>) and places the malicious hook code file within it.</li>
<li>The attacker crafts a <code>.env</code> file containing the line <code>OPENCLAW_BUNDLED_HOOKS_DIR=/tmp/evil_hooks</code>.</li>
<li>The attacker places the malicious <code>.env</code> file into a workspace that a victim user is likely to open within OpenClaw.</li>
<li>The victim user opens the workspace within OpenClaw.</li>
<li>OpenClaw reads the <code>.env</code> file and overrides the default <code>OPENCLAW_BUNDLED_HOOKS_DIR</code> with the attacker-controlled path <code>/tmp/evil_hooks</code>.</li>
<li>OpenClaw loads and executes the malicious hook code from <code>evil_hook.py</code>, granting the attacker arbitrary code execution.</li>
<li>The attacker gains control of the OpenClaw process and potentially the underlying system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2026-41336 allows an attacker to execute arbitrary code within the context of the OpenClaw application. This could lead to the complete compromise of the affected system, including data theft, modification, or destruction. Given the nature of the vulnerability, any system running a vulnerable version of OpenClaw is at risk if it processes untrusted workspaces. The CVSS v3.1 base score of 7.8 reflects the high potential impact of this vulnerability.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade OpenClaw to version 2026.3.31 or later to patch CVE-2026-41336.</li>
<li>Implement strict workspace validation to prevent the loading of malicious <code>.env</code> files.</li>
<li>Monitor process creations originating from the OpenClaw process for suspicious activity using the <code>OpenClaw Suspicious Process Creation</code> Sigma rule.</li>
<li>Deploy the <code>OpenClaw Environment Variable Override</code> Sigma rule to detect attempts to override the OPENCLAW_BUNDLED_HOOKS_DIR variable.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>cve</category><category>code-execution</category><category>environment-variable-override</category></item><item><title>OpenClaw Plugin Trust Verification Bypass via Environment Variable Override</title><link>https://feed.craftedsignal.io/briefs/2024-01-openclaw-env-override/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-openclaw-env-override/</guid><description>OpenClaw before 2026.3.31 allows attackers with control over workspace configuration to inject malicious plugins by overriding the OPENCLAW_BUNDLED_PLUGINS_DIR environment variable through workspace .env files, compromising plugin trust verification.</description><content:encoded><![CDATA[<p>OpenClaw, a yet-to-be-defined application, is susceptible to a plugin trust verification bypass. Prior to version 2026.3.31, the application permits workspace-specific <code>.env</code> files to redefine the <code>OPENCLAW_BUNDLED_PLUGINS_DIR</code> environment variable. This vulnerability enables an attacker who has control over the workspace configuration to inject malicious plugins. By manipulating the directory from which OpenClaw loads bundled plugins, an attacker can circumvent the intended trust mechanisms, leading to the execution of untrusted code within the application&rsquo;s context. This could lead to code execution, data exfiltration, or other malicious activities, depending on the injected plugin&rsquo;s capabilities.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains access to the OpenClaw workspace configuration files. This could be achieved through compromised credentials or other means of unauthorized access.</li>
<li>Attacker creates or modifies a <code>.env</code> file within the workspace.</li>
<li>The <code>.env</code> file is populated with a malicious definition of the <code>OPENCLAW_BUNDLED_PLUGINS_DIR</code> variable, pointing to a directory under the attacker&rsquo;s control.</li>
<li>Attacker places a malicious plugin in the directory specified in the modified <code>OPENCLAW_BUNDLED_PLUGINS_DIR</code>.</li>
<li>OpenClaw application is launched or reloaded, parsing the <code>.env</code> file and setting the <code>OPENCLAW_BUNDLED_PLUGINS_DIR</code> environment variable accordingly.</li>
<li>OpenClaw attempts to load plugins from the directory specified by the attacker-controlled <code>OPENCLAW_BUNDLED_PLUGINS_DIR</code>.</li>
<li>The malicious plugin is loaded and executed by OpenClaw, granting the attacker code execution within the application&rsquo;s environment.</li>
<li>The attacker can now perform malicious actions such as data exfiltration or further compromise of the system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability could lead to complete compromise of the OpenClaw application and potentially the underlying system. An attacker could inject malicious plugins to steal sensitive data, modify application behavior, or establish persistence for future attacks. The severity of the impact depends on the permissions granted to the OpenClaw process and the capabilities of the injected plugin. The number of affected users or organizations is currently unknown.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade OpenClaw to version 2026.3.31 or later to remediate the vulnerability (CVE-2026-41396).</li>
<li>Monitor file creation and modification events for <code>.env</code> files within OpenClaw workspaces. Deploy the Sigma rule <code>Detect Suspicious .env File Modification in OpenClaw Workspace</code> to detect malicious modifications.</li>
<li>Implement strict access controls for OpenClaw workspace configuration files to prevent unauthorized modification.</li>
<li>Consider restricting the ability of the OpenClaw application to load plugins from arbitrary directories.</li>
<li>Implement the file integrity monitoring (FIM) of plugin directories.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>cve-2026-41396</category><category>environment-variable-override</category><category>plugin-injection</category></item></channel></rss>