<?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>VS Code — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/vs-code/</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, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/vs-code/feed.xml" rel="self" type="application/rss+xml"/><item><title>Suspicious Execution from VS Code Extension</title><link>https://feed.craftedsignal.io/briefs/2024-01-vscode-extension-execution/</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-vscode-extension-execution/</guid><description>Malicious VS Code extensions can execute arbitrary commands, leading to initial access and subsequent payload deployment on Windows systems.</description><content:encoded><![CDATA[<p>A malicious VS Code extension, configured to run upon editor startup, can execute arbitrary commands, potentially leading to the installation of remote access trojans (RATs) or other malicious payloads. The attack vector leverages the extension host under <code>.vscode/extensions/</code> to spawn processes such as script interpreters or download utilities. This activity has been observed in campaigns like the fake Clawdbot extension that installed ScreenConnect RAT. The execution can involve Living-off-the-Land binaries (LOLBins) or recently created executables from non-standard paths, posing a significant risk to Windows systems.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A user installs a malicious VS Code extension.</li>
<li>The extension is configured with <code>activationEvents: [&quot;onStartupFinished&quot;]</code> to run automatically when VS Code starts.</li>
<li>The VS Code extension host (<code>Code.exe</code> or <code>node.exe</code>) spawns a script interpreter (e.g., <code>powershell.exe</code>, <code>cmd.exe</code>) from within the <code>.vscode/extensions/</code> directory.</li>
<li>The script interpreter executes a command to download a malicious payload from a remote server using tools like <code>curl.exe</code>, <code>bitsadmin.exe</code>, or <code>mshta.exe</code>.</li>
<li>The downloaded payload is saved to disk, often in a temporary directory outside of Program Files.</li>
<li>The script interpreter executes the downloaded payload, leading to further malicious activity. For example, ScreenConnect might be installed.</li>
<li>Persistence mechanisms are established (e.g., via registry keys or scheduled tasks).</li>
<li>The attacker gains remote access to the compromised system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful attack can lead to the complete compromise of a developer&rsquo;s workstation, potentially affecting intellectual property and sensitive data. The installation of RATs like ScreenConnect can enable persistent remote access, allowing attackers to perform data exfiltration, lateral movement, and further malicious activities. The compromised machine can then be used as a pivot point to attack other systems within the organization.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the &ldquo;Suspicious Execution from VS Code Extension&rdquo; Sigma rule to your SIEM to detect malicious process execution from VS Code extensions.</li>
<li>Monitor process creation events for script interpreters and LOLBins spawned from the <code>.vscode/extensions/</code> directory.</li>
<li>Implement application control policies to restrict the execution of unsigned or untrusted executables.</li>
<li>Regularly review and audit installed VS Code extensions for suspicious activity or unnecessary permissions.</li>
<li>Educate developers about the risks of installing extensions from untrusted sources.</li>
<li>Block the C2 domains associated with ScreenConnect and other RATs at the firewall/DNS resolver.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>initial-access</category><category>execution</category><category>supply-chain-compromise</category><category>vscode</category></item></channel></rss>