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-7242923
  • published11 Jun 2024
  • disclosed10 Jun 2024
  • creditmartinhaunschmid

Introduced: 10 Jun 2024

CVE-2024-35241  (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 status, reinstall, and remove commands. An attacker can execute arbitrary code by exploiting specially crafted branch names in the git repository. This is only exploitable if dependencies are installed from source via git.

Workaround

This vulnerability can be mitigated by avoiding installing dependencies via git by using --prefer-dist or the preferred-install: dist config setting.

CVSS Scores

version 4.0
version 3.1