A pull request that never gets merged can still run code on your build server if your pipeline types composer validate on it. That is the core of Composer2Shell, a Composer vulnerability published on 24 November 2026 and named by Orca Security six days later.
In short: Composer2Shell (GHSA-374h-4mh9-7rpm) lets a PHP project prepared by an attacker execute commands as whoever runs Composer inside it, through read-only commands such as composer show, list or validate. It affects Composer 2.7.0 to 2.11.2 and 2.2.23 to 2.2.32, and Composer 2.11.3 and 2.2.33 fix it.
- What is Composer2Shell?
- Background: why Composer reads files from your project
- How does Composer2Shell work?
- Timeline of the disclosure
- Who is affected by the Composer vulnerability?
- Why CI pipelines carry the most risk
- How does Composer2Shell compare with other Composer bugs?
- How do you detect Composer2Shell abuse?
- How do you mitigate Composer2Shell?
- What is still unknown?
- The bottom line
- Sources
What is Composer2Shell?
Composer2Shell is a code execution flaw in Composer, the standard dependency manager for PHP. The Composer maintainers describe it as a bypass of the fix for CVE-2024-24821, a 2024 bug with the same preconditions and the same impact. GitHub rates it high, CVSS 3.1 score 8.8, and files it under CWE-95, the weakness class for code that gets evaluated after untrusted input slips into it.
The advisory credits a researcher at Orca Security as reporter. Orca’s write-up, published on 30 November 2026 and attributed in its page data to Roi Nisimi, gave the bug its name. There is no CVE ID yet; Orca says one is pending.
The impact is plain: the attacker’s code runs with the rights of the person or CI job running Composer. On a developer laptop that means SSH keys and cloud credentials. On a build runner it means pipeline secrets.
Background: why Composer reads files from your project
Composer is not a niche tool. On 1 December 2026, Packagist, the main Composer package registry, reported 484,862 packages and about 219.4 billion total installs. The Composer repository on GitHub has 29,601 stars and is MIT licensed.
When you run Composer in a project, it reads metadata the project carries, including files Composer itself generates under vendor/composer/. One of these, installed.php, records which packages are installed. It is PHP code, and Composer loads it.
That design is the root of a whole family of bugs. If the project folder came from someone else, those generated files came from someone else too.
What CVE-2024-24821 fixed
The original advisory, GHSA-7c6p-848j-wh5h, was published on 8 February 2024. It said several files in the working directory are included when Composer runs, so tampered copies of InstalledVersions.php or installed.php lead to code execution. All CLI commands were affected, including self-update. The maintainers listed three high-risk cases: Composer run with sudo, pipelines that run Composer on untrusted projects, and shared environments.
The fix arrived in Composer 2.7.0 and 2.2.23. According to Orca, it treats installed.php as untrusted and only loads it after an allow-list check confirms it contains nothing but plain data: arrays, numbers, booleans and strings.
How does Composer2Shell work?
Composer2Shell defeats that check by changing the file after it was checked. Here is the mechanism at the level Orca describes it, without the proof-of-concept.
The check runs too early
Orca explains that after the allow-list check passes, Composer substitutes a directory path into the file’s contents. That path is derived from the vendor-dir setting in composer.json, a value the project controls.
The substitution is plain text search-and-replace. It does not know it is writing inside a quoted string, so a crafted path can carry syntax that breaks out of the string. The edited code is then evaluated, and the allow-list check is never run on the final version.
Why read-only commands trigger it
The file is loaded whenever Composer initialises a project, before it does anything the user asked for. The advisory names list, validate, show and outdated. Orca also confirmed diagnose, licenses, config --list, dump-autoload and install on Composer 2.11.2.
That is what makes the bug sharp. Most people treat composer show or composer validate as harmless inspection, the kind of command you run before deciding whether to trust a project.
How was it fixed?
Per Orca, the patched versions insert the path without treating it as a replacement pattern and re-run the safety check on the edited code before evaluating it. Composer 2.11.3 also fixed two smaller issues: package metadata being rendered as console markup, and credentials embedded in repository URLs appearing in download error messages.
Timeline of the disclosure
| Date | Event |
|---|---|
| 8 Feb 2024 | GHSA-7c6p-848j-wh5h (CVE-2024-24821) published, fixed in 2.7.0 and 2.2.23 |
| 10 Nov 2026 | Composer 2.11.2 and 2.2.32 ship several unrelated security fixes |
| 19 Nov 2026 | Orca reports the bypass through GitHub private vulnerability reporting |
| 19 Nov 2026 | Maintainers accept the report, within 25 minutes according to Orca |
| 24 Nov 2026 | Composer 2.11.3 and 2.2.33 released; GHSA-374h-4mh9-7rpm published |
| 30 Nov 2026 | Orca publishes its composer2shell write-up |
Five days from report to fixed releases on both supported lines is a fast response by any standard.
Who is affected by the Composer vulnerability?
You are exposed, according to the advisory, when all three of these are true:
- You run Composer 2.2.23 to 2.2.32, or 2.7.0 to 2.11.2.
- You run it in a project whose
composer.jsonand vendor directory someone else prepared or can write to: an untrusted checkout, a pull request built in CI, or a folder shared with other users. - You run it without
--no-pluginsand without--no-scripts.
The affected ranges start exactly where the CVE-2024-24821 fix landed. Reading the two advisories together, every Composer 2 release before 2.11.3 (or 2.2.33 on LTS) is exposed to one bug or the other in this scenario.
What it is not: the advisory states it cannot be exploited remotely or by installing a package. A malicious package on Packagist cannot trigger it. The attacker has to get you to run Composer inside their folder.
The situations Orca highlights
Orca lists realistic ways that happens:
- cloning a repository to reproduce a bug, or running a take-home interview task
- shared or multi-tenant hosts, where one user can run code as another
- CI jobs that build fork code with privileged triggers such as
pull_request_target,workflow_run, or comment commands any GitHub user can start - an insider or compromised laptop pushing a branch that runs a normal internal pipeline holding deploy keys
Fake job tasks are a proven lure. We covered a campaign where malicious NuGet packages were hidden inside take-home tests, and the same trick works with a PHP project.
How to check your exposure
Run composer --version on developer machines, build images and runners. Then check where Composer comes from in each pipeline, because it is often pinned:
- Dockerfiles that copy
composer.pharor pull a fixed Composer image tag setup-phpsteps with a pinnedtools: composer:2.x.yvalue, which Orca calls out- distribution packages: Orca says
apton Ubuntu installs Composer 2.9.5, which is in the affected range
What about GitHub-hosted runners?
Orca reported that Ubuntu and Windows runners shipped Composer 2.11.2, Intel macOS runners 2.10.2, and that the Intel macOS images had not been rebuilt since August. We checked the runner image readmes in the actions/runner-images repository on 1 December 2026:
| Runner image readme | Image version | Composer listed | Status |
|---|---|---|---|
| Ubuntu 24.04 | 20261122.23.1 | 2.11.2 | Affected |
| Windows Server 2025 | 20261124.341.2 | 2.11.3 | Fixed |
| macOS 15 | 20260824.0482.1 | 2.10.2 | Affected |
So the picture is already shifting. Windows Server 2025 moved to the fixed version, while the Ubuntu 24.04 and macOS 15 readmes still listed vulnerable versions. Do not rely on the runner image; run composer self-update in the job before Composer touches untrusted code.
Why CI pipelines carry the most risk
A developer can choose not to run Composer on a stranger’s repository. A pipeline cannot choose. It runs whatever the trigger hands it.
Orca’s CI scenario is simple: an outsider opens a pull request containing a crafted composer.json and vendor folder, a privileged workflow checks it out, and any Composer step runs the payload. What is exposed is whatever the job can reach: repository secrets, the GITHUB_TOKEN that actions/checkout stores in the git config by default, and caches or build artifacts that later jobs trust.
Orca also notes that some approval gates are weaker than they look, for example when moving a pull request from draft to ready starts a job without fresh review. If your pipelines already worry you, our guide on how a dev branch can reach tier zero through GitHub attack paths shows how far a stolen workflow token can travel, and the wfx-loot GitHub Actions secret stealer shows attackers already farming CI secrets through pull requests at scale.
How does Composer2Shell compare with other Composer bugs?
November 2026 was a busy month for Composer security. The 10 November release, 2.11.2, fixed GHSA-jhfp-4ppm-crmm, a different 8.8-rated bug where a crafted composer.lock or installed.json could run a system command during install or update.
| CVE-2024-24821 | GHSA-jhfp-4ppm-crmm | Composer2Shell | |
|---|---|---|---|
| Published | 8 Feb 2024 | 10 Nov 2026 | 24 Nov 2026 |
| CVSS 3.1 | 8.8 | 8.8 | 8.8 |
| Attack vector | Local | Network, user interaction | Local |
| Attacker controls | Files in vendor/composer/ |
composer.lock or installed.json |
composer.json and vendor folder |
| Commands that trigger | All, including self-update |
install, update |
Any that load the project |
| Affected versions | 2.0 to 2.2.22, 2.3 to 2.6.x | 2.10.0 to 2.11.1 | 2.2.23 to 2.2.32, 2.7.0 to 2.11.2 |
Stopped by --no-plugins / --no-scripts |
Not stated | No | Yes |
| Fixed in | 2.7.0, 2.2.23 | 2.11.2 | 2.11.3, 2.2.33 |
The contrast in the last rows matters for defenders. The flags that protect against Composer2Shell do nothing against the lock-file bug, which the maintainers say can be triggered by a pull request that only edits composer.lock. Only updating covers both.
The pattern is familiar from other developer tools. Like the Vite dev server RCE, Composer2Shell turns a tool developers think of as local and safe into an execution path when the input comes from someone else.
How do you detect Composer2Shell abuse?
Neither the advisory nor Orca publishes indicators of compromise or ATT&CK mappings, and no exploitation has been reported. Detection therefore means finding exposure and watching for the behaviour the attack needs.
Where to look
- Version inventory. Collect
composer --versionoutput from CI logs, container images and endpoint software inventories. Flag 2.7.0 to 2.11.2 and 2.2.23 to 2.2.32. - Pull request content. Most projects do not commit their
vendor/folder. A pull request from outside that adds or edits files undervendor/composer/, or changesvendor-dirincomposer.json, deserves a human look before any job runs. - Workflow configuration. List workflows that combine
pull_request_target,workflow_runor comment triggers with a checkout of the pull request head and a Composer step. - Process behaviour. On runners and developer machines with EDR, a PHP process started by Composer that spawns a shell,
curl,wgetor a network connection to an unknown host during a read-only command likevalidateorshowis abnormal. - Secret use. Watch cloud and GitHub audit logs for tokens used from unexpected IP addresses shortly after a fork pull request built.
ATT&CK mapping
This mapping is ours, not the sources’: T1195.001 (Compromise Software Dependencies and Development Tools) for the delivery through a project, T1059 (Command and Scripting Interpreter) for the execution, and T1552 (Unsecured Credentials) for the secrets a CI job exposes.
How do you mitigate Composer2Shell?
In priority order:
- Update Composer everywhere. Run
composer self-updateto reach 2.11.3, or 2.2.33 on the LTS line. Rebuild container images and update pinned versions in Dockerfiles andsetup-phpsteps. - Update inside CI jobs. Until you trust every runner image, run
composer self-update(or pin 2.11.3 insetup-php) before Composer touches any checked-out code, as Orca recommends. - Use the flags on untrusted code. Run Composer with
--no-pluginsor--no-scriptson any project you do not control. Remember they do not cover the lock-file bug fixed in 2.11.2. - Stop building fork code with privileges. Do not check out and build fork code under
pull_request_targetorworkflow_rununless each run is approved, and re-approve after every new commit. - Shrink what a job can steal. Scope secrets to the jobs that need them, default workflow permissions to read-only, and set
persist-credentials: falseon checkout. - Remove sudo Composer. The 2024 advisory already advised removing sudo rights to run Composer, so a bug like this cannot become root.
- Reset suspect files. For a project you are unsure about, the 2024 advisory suggests deleting
vendor/composer/installed.phpandInstalledVersions.phpand reinstalling with--no-scripts --no-plugins.
What is still unknown?
- CVE ID. None has been assigned yet, so scanners that match only CVE IDs may not flag affected versions. Search for the GHSA ID instead.
- Runner rollout. Orca says GitHub rebuilds runner images about weekly but the Intel macOS images had gone months without a rebuild. When every image carries 2.11.3 is not stated anywhere we found.
- Other distributions. Orca names Ubuntu’s apt package (2.9.5). We did not verify which Linux distributions or official Docker images have shipped fixed builds.
- Exploitation. No source reports attacks. That is not proof there were none, especially in CI, where few teams log what Composer does.
- More bypasses. This is the second time the same file has been the entry point. Whether the new re-check closes the class for good is something only time and researchers will show.
The bottom line
Composer2Shell turns composer show into code execution when the project folder belongs to an attacker. It is local, not wormable, and fixed in Composer 2.11.3 and 2.2.33. The exposure that matters is CI running Composer on pull request code, so update Composer inside the job, add --no-plugins for untrusted projects, and stop building fork code with secrets in reach.
Sources
- GitHub advisory GHSA-374h-4mh9-7rpm: Code execution via crafted vendor-dir in untrusted project (Composer, 24 November 2026)
- Orca Security: composer2shell, the PHP package manager can get you hacked (30 November 2026)
- Composer 2.11.3 release notes
- Composer 2.2.33 release notes
- Composer 2.11.2 release notes
- GitHub advisory GHSA-7c6p-848j-wh5h (CVE-2024-24821)
- GitHub advisory GHSA-jhfp-4ppm-crmm
- actions/runner-images: Ubuntu 24.04 readme
- actions/runner-images: Windows Server 2025 readme
- actions/runner-images: macOS 15 readme
- Packagist statistics
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.