<?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>Composer — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/composer/</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, 15 Apr 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/composer/feed.xml" rel="self" type="application/rss+xml"/><item><title>Composer Command Injection via Malicious Perforce Repository</title><link>https://feed.craftedsignal.io/briefs/2026-04-composer-command-injection/</link><pubDate>Wed, 15 Apr 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-composer-command-injection/</guid><description>Composer is vulnerable to command injection via a malicious Perforce repository due to improper escaping of user-supplied Perforce connection parameters, potentially leading to arbitrary command execution in the context of the user running Composer.</description><content:encoded><![CDATA[<p>Composer, a dependency manager for PHP, is susceptible to a command injection vulnerability (CVE-2026-40176) in versions 2.0.0 before 2.2.27 and versions 2.3.0 before 2.9.6. The vulnerability resides in the <code>Perforce::generateP4Command()</code> method, which improperly escapes user-supplied Perforce connection parameters (port, user, client) when constructing shell commands. This allows an attacker who controls a repository configuration, specifically within a malicious <code>composer.json</code> file declaring a Perforce VCS repository, to inject arbitrary commands. The injected commands are executed in the context of the user running Composer, even if Perforce is not installed. This vulnerability can be exploited if Composer is run on untrusted projects with attacker-supplied <code>composer.json</code> files.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious <code>composer.json</code> file.</li>
<li>The malicious <code>composer.json</code> declares a Perforce VCS repository.</li>
<li>The <code>composer.json</code> contains injected commands within the Perforce connection parameters (port, user, client).</li>
<li>A user unknowingly executes a Composer command (e.g., <code>composer install</code>) in a directory containing the malicious <code>composer.json</code>.</li>
<li>Composer parses the <code>composer.json</code> and calls the <code>Perforce::generateP4Command()</code> method.</li>
<li>The <code>Perforce::generateP4Command()</code> method constructs a shell command using the attacker-controlled, unescaped Perforce connection parameters.</li>
<li>Composer executes the injected command via <code>proc_open</code> or similar functions.</li>
<li>The attacker achieves arbitrary command execution in the context of the user running Composer, potentially leading to sensitive information disclosure, system compromise, or further malicious activities.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows attackers to execute arbitrary commands on the victim&rsquo;s system with the privileges of the user running Composer. This can lead to complete system compromise, data exfiltration, or denial of service. While the number of victims is currently unknown, any system running a vulnerable version of Composer and processing untrusted <code>composer.json</code> files is at risk. The primary attack vector involves tricking developers into running Composer on projects containing malicious <code>composer.json</code> files.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Composer to version 2.2.27 or 2.9.6 or later to patch CVE-2026-40176.</li>
<li>Carefully inspect <code>composer.json</code> files from untrusted sources before running Composer to verify Perforce-related fields contain valid values.</li>
<li>Deploy the Sigma rule to detect command execution with suspicious arguments when composer executes and tune for your environment.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>composer</category><category>command-injection</category><category>php</category></item></channel></rss>