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.jsons 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.
The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Composer | Getcomposer | * | 1.10.26 (excluding) |
Composer | Getcomposer | 2.0.0 (including) | 2.2.12 (excluding) |
Composer | Getcomposer | 2.3.0 (including) | 2.3.5 (excluding) |
Composer | Ubuntu | bionic | * |
Composer | Ubuntu | devel | * |
Composer | Ubuntu | esm-apps/bionic | * |
Composer | Ubuntu | esm-apps/focal | * |
Composer | Ubuntu | esm-apps/jammy | * |
Composer | Ubuntu | esm-apps/noble | * |
Composer | Ubuntu | esm-apps/xenial | * |
Composer | Ubuntu | focal | * |
Composer | Ubuntu | impish | * |
Composer | Ubuntu | jammy | * |
Composer | Ubuntu | kinetic | * |
Composer | Ubuntu | lunar | * |
Composer | Ubuntu | mantic | * |
Composer | Ubuntu | noble | * |
Composer | Ubuntu | oracular | * |
Composer | Ubuntu | upstream | * |
Composer | Ubuntu | xenial | * |
When creating commands using interpolation into a string, developers may assume that only the arguments/options that they specify will be processed. This assumption may be even stronger when the programmer has encoded the command in a way that prevents separate commands from being provided maliciously, e.g. in the case of shell metacharacters. When constructing the command, the developer may use whitespace or other delimiters that are required to separate arguments when the command. However, if an attacker can provide an untrusted input that contains argument-separating delimiters, then the resulting command will have more arguments than intended by the developer. The attacker may then be able to change the behavior of the command. Depending on the functionality supported by the extraneous arguments, this may have security-relevant consequences.