Home » Security News » Composer Vulnerabilities Expose PHP Projects to Re...

Composer Vulnerabilities Expose PHP Projects to Remote Command Execution

Composer Vulnerabilities Expose PHP Projects to Remote Command Execution

Add Techlomedia as a preferred source on Google. Preferred Source

Two serious security vulnerabilities have been discovered in Composer, a widely used dependency manager for PHP. These flaws could allow attackers to execute arbitrary commands on systems running affected versions.

The issues impact Composer’s handling of Perforce version control repositories. Both vulnerabilities are related to improper input validation, which opens the door for command injection attacks.

The first flaw, tracked as CVE-2026-40176, has a CVSS score of 7.8. It allows attackers to inject malicious commands through a specially crafted composer.json file. If a project is configured to use a Perforce repository, an attacker could manipulate the configuration and execute commands on the system of the user running Composer.

The second vulnerability, CVE-2026-40261, is even more severe with a CVSS score of 8.8. This flaw is caused by improper escaping of input. Attackers can exploit it by embedding shell metacharacters in a crafted source reference, again leading to command execution.

One important detail is that both vulnerabilities can be exploited even if Perforce is not installed on the system. Composer would still process the malicious input and execute the injected commands.

The vulnerabilities affect multiple versions of Composer. Systems running versions starting from 2.3 up to but not including 2.9.6 are impacted. Similarly, versions from 2.0 up to but not including 2.2.27 are also vulnerable. These issues have now been fixed in versions 2.9.6 and 2.2.27.

Developers who cannot update immediately are advised to take extra precautions. They should carefully review composer.json files before running Composer, especially when working with external or unknown projects. It is also recommended to rely only on trusted repositories and avoid installing dependencies using the “–prefer-dist” option or the “preferred-install: dist” setting.

The Composer team has checked Packagist and confirmed that there is no evidence of these vulnerabilities being actively exploited so far. As an additional safety measure, publishing Perforce-related metadata has been disabled on Packagist since April 10, 2026.

Follow Techlomedia on Google News to stay updated. Follow on Google News

Affiliate Disclosure:

This article may contain affiliate links. We may earn a commission on purchases made through these links at no extra cost to you.

Deepanker Verma

About the Author: Deepanker Verma

Deepanker Verma is the Founder and Editor-in-Chief of TechloMedia. He holds Engineering degree in Computer Science and has over 15 years of experience in the technology sector. Deepanker bridges the gap between complex engineering and consumer electronics. He is also a a known Security Researcher acknowledged by global giants including Apple, Microsoft, and eBay. He uses his technical background to rigorously test gadgets, focusing on performance, security, and long-term value.

Related Posts

Stay Updated with Techlomedia

Join our newsletter to receive the latest tech news, reviews, and guides directly in your inbox.