Command Injection Affecting composer/composer package, versions >=2.0, <2.2.24>=2.3, <2.7.7


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-COMPOSERCOMPOSER-7242924
  • published11 Jun 2024
  • disclosed10 Jun 2024
  • creditMaciej Piechota

Introduced: 10 Jun 2024

CVE-2024-35242  (opens in a new tab)
CWE-77  (opens in a new tab)

How to fix?

Upgrade composer/composer to version 2.2.24, 2.7.7 or higher.

Overview

composer/composer is a Dependency Manager for PHP. Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

Affected versions of this package are vulnerable to Command Injection via the composer install command. An attacker can execute arbitrary commands by crafting malicious branch names in git/hg repositories. This is only exploitable if cloning untrusted repositories.

Workaround

This vulnerability can be mitigated by avoiding cloning potentially compromised repositories.

CVSS Scores

version 4.0
version 3.1