CVE-2022-24828 Missing input validation can lead to command execution in composer

High 8.3 Published Updated

Attackers can execute arbitrary commands via crafted input in VcsDriver::getFileContent when integrators allow user-controlled file or identifier arguments.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-24828?

CVE-2022-24828 is a high-severity command injection vulnerability in Fedoraproject Fedora, published on 13 Apr 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-88, CWE-20

Which versions are affected by CVE-2022-24828?

7 open source packages ship an affected version, including composer/composer and composer. It affects 3 products.

PackageAffectedFixed in
composer/composer PackagistAll versions1.10.26
composer/composer PackagistAll versions1.10.26
composer/composer PackagistFrom 2.02.2.12
composer/composer PackagistFrom 2.02.2.12
composer/composer PackagistFrom 2.32.3.5
composer/composer PackagistFrom 2.32.3.5
1 more packages
composer BitnamiAll versions1.10.26, 2.2.12, 2.3.5
Linux distribution packages (4)
php-composer2 SUSE:Linux Enterprise Module for Web and Scripting 15 SP4All versions2.2.3-150400.3.3.1
php-composer2 openSUSE:Leap 15.4All versions2.2.3-150400.3.3.1
php-composer openSUSE:TumbleweedAll versions1.10.26-1.1
php-composer2 openSUSE:TumbleweedAll versions2.3.5-1.1

Products include Fedoraproject Fedora, Getcomposer Composer, Tenable Tenable.sc.

How do I fix CVE-2022-24828?

Upgrade composer/composer to a fixed version for your release line: 1.10.26, 2.2.12 or 2.3.5.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2022-24828 being exploited?

There is no known exploitation of CVE-2022-24828 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as BIT-composer-2022-24828, CLEANSTART-2024-VD23894, DEBIAN-CVE-2022-24828, GHSA-x7cr-6qr6-2hh6, SUSE-SU-2022:3020-1, UBUNTU-CVE-2022-24828 and 2 more.

Is CVE-2022-24828 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free