Skip to content
OpenAdvisories
High · 8.3 CVE-2022-24828 BIT-composer-2022-24828EUVD-2022-1866GHSA-x7cr-6qr6-2hh6

Missing input validation can lead to command execution in composer

Published Apr 13, 2022 · Updated Apr 23, 2025 · Assigned by GitHub_M

Description

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call `VcsDriver::getFileContent` 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`. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Affected products

VendorProductAffectedFixed
composer composer < 1.10.26, >= 2.0.0, < 2.2.12, >= 2.3, < 2.3.6 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 composer 2.2.12-1 —
Debian 13 composer 2.2.12-1 —
Debian 12 composer 2.2.12-1 —
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS composer 2.7.1-2ubuntu0.1~esm1 USN-7603-1
Ubuntu Pro 22.04 LTS composer 2.2.6-2ubuntu4+esm1 USN-7603-1
Ubuntu Pro 20.04 LTS composer 1.10.1-1ubuntu0.1~esm2 USN-7603-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS composer 1.6.3-1ubuntu0.1~esm2 USN-7603-1
Ubuntu Pro 16.04 LTS composer 1.0.0~beta2-1ubuntu0.1~esm2 USN-7603-1
ReleasePackageFixed inAdvisory
SLES 15 SP4 php-composer2 2.2.3-150400.3.3.1 SUSE-SU-2022:3020-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SUSE Package Hub 15 SP3 php-composer 1.10.26-bp153.2.6.1 openSUSE-SU-2022:0132-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed php-composer 1.10.26-1.1 openSUSE-SU-2024:12054-1
openSUSE Tumbleweed php-composer2 2.3.5-1.1 openSUSE-SU-2024:12048-1
openSUSE Leap 15.4 php-composer2 2.2.3-150400.3.3.1 SUSE-SU-2022:3020-1
openSUSE Leap 15.3 php-composer 1.10.26-bp153.2.6.1 openSUSE-SU-2022:0132-1
ReleasePackageFixed inAdvisory
Alpine v3.24 composer 2.3.5-r0 —
Alpine v3.23 composer 2.3.5-r0 —
Alpine v3.22 composer 2.3.5-r0 —
Alpine v3.21 composer 2.3.5-r0 —
Alpine v3.20 composer 2.3.5-r0 —
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 composer 2.3.5-r0 —
Alpine v3.18 composer 2.3.5-r0 —
Alpine v3.17 composer 2.3.5-r0 —
Alpine v3.16 composer 2.3.5-r0 —
Alpine v3.15 composer 2.2.12-r0 —

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist composer/composer < 1.10.26 1.10.26 GHSA-x7cr-6qr6-2hh6
Packagist composer/composer >= 2.0, < 2.2.12 2.2.12 GHSA-x7cr-6qr6-2hh6
Packagist composer/composer >= 2.3, < 2.3.5 2.3.5 GHSA-x7cr-6qr6-2hh6

Advisories 5

References