<?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>Electerm — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/electerm/</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/electerm/feed.xml" rel="self" type="application/rss+xml"/><item><title>Electerm Command Injection Vulnerability via runLinux Function</title><link>https://feed.craftedsignal.io/briefs/2024-01-electerm-command-injection/</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-electerm-command-injection/</guid><description>A command injection vulnerability exists in electerm's install.js due to insufficient validation in the runLinux() function, allowing attackers to execute arbitrary commands by manipulating remote release metadata.</description><content:encoded><![CDATA[<p>A critical command injection vulnerability has been identified in Electerm, specifically affecting users who install the application via <code>npm install -g electerm</code> on Linux systems. The vulnerability resides within the <code>runLinux()</code> function in <code>github.com/elcterm/electerm/npm/install.js</code>. This function lacks proper validation when appending remote version strings into an <code>exec(&quot;rm -rf ...&quot;)</code> command. An attacker capable of controlling the remote release metadata (e.g., version string, release name) served by Electerm&rsquo;s update server could exploit this flaw to execute arbitrary system commands. This could lead to tampering with local files and a complete compromise of development or runtime assets. This vulnerability affects Electerm versions prior to 3.3.8.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains control over the Electerm update server or performs a man-in-the-middle attack.</li>
<li>The attacker crafts malicious release metadata, including a crafted version string containing command injection payloads.</li>
<li>A user on a Linux system executes <code>npm install -g electerm</code> to install or update Electerm.</li>
<li>The <code>install.js</code> script fetches the malicious release metadata from the compromised update server.</li>
<li>The <code>runLinux()</code> function appends the attacker-controlled version string directly into an <code>exec(&quot;rm -rf ...&quot;)</code> command.</li>
<li>The <code>exec()</code> function executes the command, resulting in arbitrary command execution with the privileges of the user running <code>npm install</code>.</li>
<li>The attacker can then tamper with local files, install backdoors, or escalate privileges.</li>
<li>The attacker achieves complete system compromise, potentially exfiltrating sensitive data or using the compromised system as a pivot point.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows attackers to execute arbitrary system commands on the victim&rsquo;s machine. This can lead to complete system compromise, including unauthorized access to sensitive data, installation of malware, and further propagation of the attack within the network. Given the nature of <code>npm install</code>, developers are primarily at risk. The impact could be significant for development environments.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the following rule to detect command injection attempts within npm installations referencing the electerm package: <code>Electerm NPM install Command Injection</code>.</li>
<li>Monitor network traffic for connections to unexpected or suspicious update servers that could be serving malicious Electerm release metadata using network connection logs.</li>
<li>While the vulnerability is patched in later versions, ensure users are aware of the risks associated with running older versions of Electerm (<code>&lt; 3.3.8</code>).</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>command-injection</category><category>electerm</category><category>npm</category></item></channel></rss>