Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

BIT-composer-2026-40176: Composer is vulnerable to Command Injection via Malicious Perforce Repository

0
High
Published: 04/18/2026 (04/18/2026, 08:36:16 UTC)
Source: GCVE Database
Product: composer

Description

Composer, a PHP dependency manager, contains a command injection vulnerability in versions 1.0 through 2.2.26 and 2.3 through 2.9.5. The vulnerability exists in the Perforce::generateP4Command() method, which improperly escapes user-supplied Perforce connection parameters. An attacker can exploit this by crafting a malicious composer.json file declaring a Perforce VCS repository, leading to arbitrary command execution with the privileges of the user running Composer. This issue cannot be exploited through composer.json files of dependencies, only from the root composer.json or composer config directory. The vulnerability is fixed in versions 2.2.27 and 2.9.6.

Affected software

Bitnamimore threats →ghsa
composer
pkg:bitnami/composer
Affected versions
>=1.0.0 <2.2.27>=2.3.0 <2.9.6

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/06/2026, 23:06:18 UTC

Technical Analysis

Composer versions >=1.0.0 <2.2.27 and >=2.3.0 <2.9.6 are vulnerable to command injection via the Perforce::generateP4Command() method. This method constructs shell commands by interpolating Perforce connection parameters (port, user, client) without proper escaping, allowing an attacker to inject arbitrary commands through a malicious composer.json file that declares a Perforce VCS repository. Exploitation requires running Composer commands on untrusted projects with attacker-controlled composer.json files. The vulnerability is resolved in Composer 2.2.27 and 2.9.6.

Potential Impact

Successful exploitation allows arbitrary command execution with the privileges of the user running Composer. This can lead to system compromise or unauthorized actions on the host. The vulnerability affects only users who run Composer on untrusted projects containing malicious composer.json files with Perforce VCS repository declarations. It does not affect composer.json files of installed dependencies.

Mitigation Recommendations

A fix is available in Composer versions 2.2.27 and 2.9.6. Users should upgrade to one of these versions or later to remediate this vulnerability. Avoid running Composer commands on untrusted projects or with untrusted composer.json files until patched.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
BIT-composer-2026-40176
Osv Schema Version
1.6.2
Aliases
["CVE-2026-40176"]
Ecosystems
["Bitnami"]
Database Specific Severity
High
Cvss Version
null

Threat ID: 6a4c348127e9c79719606e2c

Added to database: 07/06/2026, 23:04:33 UTC

Last enriched: 07/06/2026, 23:06:18 UTC

Last updated: 07/07/2026, 00:07:54 UTC

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses