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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | composer | 2.2.12-1 | — |
| Debian 13 | composer | 2.2.12-1 | — |
| Debian 12 | composer | 2.2.12-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE Package Hub 15 SP3 | php-composer | 1.10.26-bp153.2.6.1 | openSUSE-SU-2022:0132-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| 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
- USN-7603-1 composer vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- SUSE-SU-2022:3020-1 Security update for php-composer2 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2022:0132-1 Security update for php-composer SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:12048-1 php-composer2-2.3.5-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:12054-1 php-composer-1.10.26-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://github.com/composer/composer/security/advisories/GHSA-x7cr-6qr6-2hh6
- https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709
- https://www.tenable.com/security/tns-2022-09
- FEDORA-2022-617a6df23e vendor-advisory
- FEDORA-2022-47d2e7da46 vendor-advisory
- FEDORA-2022-60ec715192 vendor-advisory