What to do3 steps
Upgrade Composer to 2.11.3, or 2.2.33 on the LTS line.
Run
composer self-update. Every affected mainline release (2.7.0 to 2.11.2) upgrades to 2.11.3; the 2.2 LTS line (2.2.23 to 2.2.32) upgrades to 2.2.33.Do not run Composer in untrusted project directories.
Treat a cloned repository, a pull request or a shared working directory as untrusted until you trust its
composer.jsonand vendor directory.Harden CI that builds pull requests.
Run Composer with
--no-pluginsand--no-scriptswhere it only needs to resolve or inspect, set the workflow token permissions to read-only by default, and usepersist-credentials: falseon checkout so a shell cannot steal CI credentials.
Are you affected?only if all are true
- Composer 2.2.23 to 2.2.32, or 2.7.0 to 2.11.2, is installed.
- Composer runs inside a project directory whose composer.json and vendor directory someone else can write to or has prepared: an untrusted checkout, a pull request built in CI, or a directory shared with other users.
- It runs without --no-plugins and without --no-scripts.
Check your version
- Your machine
composer --version - Prompt for your own agent, read-onlyAm I affected by Composer2Shell?
Read the prompt
Check whether the systems I am authorized to inspect are affected by Composer2Shell. Composer loads vendor/composer/installed.php from the project on every command, and a crafted vendor directory bypasses the CVE-2024-24821 allow-list to run arbitrary code as the user running Composer, even on read-only commands like composer show, whenever Composer runs in an attacker-prepared checkout or a pull request built in CI. It is exploitable under these conditions: - Composer 2.2.23 to 2.2.32, or 2.7.0 to 2.11.2, is installed. - Composer runs inside a project directory whose composer.json and vendor directory someone else can write to or has prepared: an untrusted checkout, a pull request built in CI, or a directory shared with other users. - It runs without --no-plugins and without --no-scripts. Fixed releases: - Composer: 2.2.33 (branch 2.2), 2.11.3 (branch 2.11); before 2.2.23 is not affected Affected: 2.2.23 to 2.2.32 (2.2 LTS) and 2.7.0 to 2.11.2 (mainline). The 2.2 LTS line is fixed in 2.2.33; every mainline 2.7 to 2.11 release upgrades to 2.11.3. Versions before 2.2.23 predate the CVE-2024-24821 fix this one bypasses. Commands the catalog lists to find the version or the setting (read each one before you run it): - Your machine: composer --version What the catalog says to do on an affected system (report these, do not carry them out): 1. Upgrade Composer to 2.11.3, or 2.2.33 on the LTS line. 2. Do not run Composer in untrusted project directories. 3. Harden CI that builds pull requests. For each host, container image or application, report affected, not affected, fixed or unknown, with the evidence, and list anything you could not access. Work read-only: do not change configuration, restart services or send exploit input. More: https://composer.2shell.wtf/composer2shell
Affected versions2 branches
| Composer branch | Fixed in |
|---|---|
| 2.2 | 2.2.33 |
| 2.11 | 2.11.3 |
Composer before 2.2.23 is not affected.
Affected: 2.2.23 to 2.2.32 (2.2 LTS) and 2.7.0 to 2.11.2 (mainline). The 2.2 LTS line is fixed in 2.2.33; every mainline 2.7 to 2.11 release upgrades to 2.11.3. Versions before 2.2.23 predate the CVE-2024-24821 fix this one bypasses.
Timeline3 events
Reported to the vendor
Orca reports it to Composer through GitHub private vulnerability reporting; accepted within 25 minutes
Patched
Composer 2.11.3 and 2.2.33 (LTS) released
Disclosed
GitHub Security Advisory GHSA-374h-4mh9-7rpm published
Sources3 links
Sources checked on . This page tells you how to check and what to install. It cannot tell you that you are safe.
