CVE-2021-41116 Command injection in composer on Windows

High 8.2 Published Updated

Windows users installing untrusted dependencies via Composer are vulnerable to command injection, allowing attackers to execute arbitrary code.

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-2021-41116?

CVE-2021-41116 is a high-severity command injection vulnerability in composer, published on 5 Oct 2021. 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 an open source dependency manager for the PHP language. In affected versions windows users running Composer to install untrusted dependencies are subject to command injection and should upgrade their composer version. Other OSs and WSL are not affected. The issue has been resolved in composer versions 1.10.23 and 2.1.9. There are no workarounds for this issue.

Weakness: CWE-77

Which versions are affected by CVE-2021-41116?

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

PackageAffectedFixed in
composer/composer PackagistAll versions1.10.23
composer/composer PackagistAll versions1.10.23
composer/composer PackagistFrom 2.0.0-alpha12.1.9
composer/composer PackagistFrom 2.0.0-alpha12.1.9
composer BitnamiAll versions1.10.23, 2.1.9
Linux distribution packages (2)
php-composer openSUSE:TumbleweedAll versions1.10.25-1.1
php-composer2 openSUSE:TumbleweedAll versions2.1.12-1.1

Products include Getcomposer Composer, Tenable Tenable.sc.

How do I fix CVE-2021-41116?

Upgrade composer/composer to a fixed version for your release line: 1.10.23 or 2.1.9.

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

Is CVE-2021-41116 being exploited?

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

Sources

Also known as BIT-composer-2021-41116, CLEANSTART-2024-SA12234, GHSA-frqg-7g38-6gcf, UBUNTU-CVE-2021-41116, openSUSE-SU-2024:11617-1, openSUSE-SU-2024:11874-1.

Is CVE-2021-41116 in your software?

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

Check your SBOMs for free