Improper Input Validation Affecting composer/composer package, versions <1.10.26>=2.0.0, <2.2.12>=2.3.0, <2.3.5


Severity

Recommended
0.0
high
0
10

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

Threat Intelligence

EPSS
0.39% (75th 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 Improper Input Validation vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-COMPOSERCOMPOSER-2711857
  • published14 Apr 2022
  • disclosed14 Apr 2022
  • creditthomas-chauchefoin-sonarsource

Introduced: 14 Apr 2022

CVE-2022-24828  (opens in a new tab)
CWE-20  (opens in a new tab)

How to fix?

Upgrade composer/composer to version 1.10.26, 2.2.12, 2.3.5 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 Improper Input Validation via the VcsDriver::getFileContent function call, which can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier.

CVSS Scores

version 3.1