<?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 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/environment-variable/</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>Wed, 29 Apr 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/environment-variable/feed.xml" rel="self" type="application/rss+xml"/><item><title>OpenClaw Incomplete Host Environment Variable Sanitization Vulnerability (CVE-2026-41387)</title><link>https://feed.craftedsignal.io/briefs/2026-04-openclaw-env-vuln/</link><pubDate>Wed, 29 Apr 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-openclaw-env-vuln/</guid><description>OpenClaw before 2026.3.22 is vulnerable to incomplete host environment variable sanitization, allowing attackers to redirect package resolution or runtime bootstrap to attacker-controlled infrastructure and execute trojanized content.</description><content:encoded><![CDATA[<p>OpenClaw versions prior to 2026.3.22 contain a vulnerability related to incomplete sanitization of host environment variables. This flaw, found in <code>host-env-security-policy.json</code> and <code>host-env-security.ts</code>, allows for the overriding of package manager environment settings. An attacker can leverage this vulnerability to redirect approved execution requests, manipulating the package resolution process or the runtime bootstrap. By doing so, they can point these processes to attacker-controlled infrastructure. This enables the execution of trojanized content, potentially leading to supply chain attacks or arbitrary code execution within the affected environment. The vulnerability is identified as CVE-2026-41387.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies an OpenClaw instance running a version prior to 2026.3.22.</li>
<li>Attacker crafts malicious environment variables designed to override the package manager&rsquo;s default settings.</li>
<li>The attacker triggers an approved execution request within the OpenClaw environment.</li>
<li>Due to the incomplete sanitization, the attacker-controlled environment variables are used by the package manager.</li>
<li>The package manager is redirected to the attacker&rsquo;s infrastructure for package resolution or runtime bootstrap.</li>
<li>The attacker&rsquo;s infrastructure serves trojanized content disguised as legitimate packages or runtime components.</li>
<li>OpenClaw executes the trojanized content, granting the attacker initial access to the system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2026-41387 can lead to the execution of arbitrary code within the OpenClaw environment. This can result in compromised systems, data breaches, or supply chain attacks. Due to the nature of package management redirection, the impact could extend beyond the initial target, affecting other systems relying on the compromised OpenClaw instance. The vulnerability has a CVSS v3.1 score of 7.8, indicating a high severity.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade OpenClaw to version 2026.3.22 or later to remediate the vulnerability described in CVE-2026-41387.</li>
<li>Implement stricter input validation on environment variables used by OpenClaw, focusing on package manager settings, to prevent redirection attacks.</li>
<li>Monitor network traffic for connections to unusual or untrusted domains during package resolution or runtime bootstrap, as this may indicate an attempted redirection attack.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>vulnerability</category><category>supply-chain</category><category>environment-variable</category></item><item><title>PowerShell Execution via Environment Variables</title><link>https://feed.craftedsignal.io/briefs/2024-01-powershell-env-var-execution/</link><pubDate>Wed, 03 Jan 2024 10:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-powershell-env-var-execution/</guid><description>Adversaries use PowerShell to execute malicious code stored in environment variables, leveraging Invoke-Expression or its aliases to bypass static analysis and execute payloads dynamically, as seen in malware loaders and stagers like the VIP Keylogger.</description><content:encoded><![CDATA[<p>Attackers are increasingly leveraging PowerShell to execute malicious code embedded within environment variables. This method involves storing commands or encoded content in environment variables and then using <code>Invoke-Expression</code> (or its alias <code>iex</code>) to dynamically construct and execute code at runtime. This tactic is employed to evade traditional static analysis techniques and conceal the true intent of the executed code. Observed in malware loaders and stagers, including those associated with the VIP Keylogger campaign, this technique is a significant threat. Defenders should be aware of this trend and implement appropriate detection mechanisms. The focus is on identifying PowerShell scripts that combine environment variable access (<code>$env:</code>) with <code>Invoke-Expression</code> or its aliases, based on PowerShell Script Block Logging (Event ID 4104).</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker gains initial access to the system, possibly through phishing or exploiting a software vulnerability.</li>
<li>PowerShell is invoked, either directly or indirectly, via a script or another process.</li>
<li>The attacker sets an environment variable containing malicious code or a command. This might involve using <code>[Environment]::SetEnvironmentVariable</code>.</li>
<li>A PowerShell script is executed that reads the content of the environment variable using <code>$env:</code>.</li>
<li>The content read from the environment variable is passed to <code>Invoke-Expression</code> or its alias <code>iex</code>.</li>
<li><code>Invoke-Expression</code> dynamically executes the code, effectively bypassing static analysis.</li>
<li>The executed code downloads and executes a secondary payload, such as a keylogger or a remote access tool.</li>
<li>The attacker achieves their objective, such as stealing credentials or establishing persistent access.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to the execution of arbitrary code on the compromised system, allowing attackers to install malware, steal sensitive data, or establish a persistent foothold. The VIP Keylogger campaign, for example, demonstrates how this technique can be used to harvest user credentials. Due to the obfuscated nature of this attack, it is difficult to detect and remediate, often leading to extended dwell time for the attacker. Compromised systems can be further used as a launchpad for attacks against other systems within the network.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable PowerShell Script Block Logging (Event ID 4104) on all Windows systems to capture the de-obfuscated script blocks before execution.</li>
<li>Deploy the provided Sigma rules to your SIEM to detect PowerShell scripts that access environment variables and use <code>Invoke-Expression</code> or its aliases. Tune these rules to your environment to reduce false positives.</li>
<li>Investigate any alerts generated by these rules to determine if malicious activity is occurring.</li>
<li>Monitor PowerShell execution for suspicious environment variable access and dynamic code execution.</li>
<li>Implement application control to prevent the execution of unauthorized PowerShell scripts.</li>
<li>Review and harden PowerShell execution policies to limit the attack surface.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>powershell</category><category>environment-variable</category><category>invoke-expression</category><category>execution</category></item></channel></rss>