<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy" -->

---
title: composer2shell: The PHP Package Manager can get you...
description: Any Composer command, even composer show, runs attacker code if you run it inside a booby-trapped PHP project. The flaw, composer2shell (CVSS 8.8), affects...
canonical: https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: composer2shell: The PHP Package Manager can get you Hacked (CVSS 8.8) | daily.dev
og:description: Any Composer command, even composer show, runs attacker code if you run it inside a booby-trapped PHP project. The flaw, composer2shell (CVSS 8.8), affects...
og:url: https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy
og:image: https://api.daily.dev/og/posts/5HD5NdeqY.png
og:image:alt: composer2shell: The PHP Package Manager can get you Hacked (CVSS 8.8)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# composer2shell: The PHP Package Manager can get you Hacked (CVSS 8.8)

**[Orca Security Blog](https://daily.dev/sources/orca-security-blog)** · 11 min read · 0 upvotes · 2 comments

## Summary

Any Composer command, even composer show, runs attacker code if you run it inside a booby-trapped PHP project. The flaw, composer2shell (CVSS 8.8), affects Composer 2.2.23 to 2.2.32 and 2.7.0 to 2.11.2. A crafted vendor-dir setting in composer.json hides a shell command in installed.php that slips past Composer's safety check. Composer 2.11.3 and 2.2.33 fix it, and --no-plugins or --no-scripts also blocks it. CI pipelines that run Composer on fork pull requests are the biggest risk, and GitHub-hosted Ubuntu and Windows runners still ship vulnerable 2.11.2. Run composer self-update.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://orca.security/resources/research/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8>

## Questions this post answers

### Which Composer versions are affected by composer2shell and how do I fix it?

Composer 2.2.23 to 2.2.32 and 2.7.0 to 2.11.2 are affected by composer2shell (GHSA-374h-4mh9-7rpm, CVSS 8.8). Upgrade to 2.11.3, or 2.2.33 on the LTS line, by running composer self-update. Running Composer with --no-plugins or --no-scripts on projects you don't control also prevents the payload from loading.

_Developers shipping PHP use daily.dev to catch Composer and dependency security fixes early._

### Can running composer show on an untrusted PHP project get me hacked?

Yes, on vulnerable versions. A crafted vendor-dir in composer.json plus a malicious installed.php executes attacker code as soon as Composer loads the project, so composer show, list, validate, diagnose and install all trigger it. It isn't exploitable remotely or via Packagist packages; the attacker must control the project directory you run Composer in.

_Anyone who clones unfamiliar repos benefits from following PHP security news on daily.dev._

### Are GitHub Actions runners vulnerable to the Composer composer2shell bug?

Yes. Ubuntu and Windows GitHub-hosted runners ship Composer 2.11.2, and Intel macOS runners ship 2.10.2, all vulnerable. Apple-silicon macOS and ubuntu-slim have no Composer. Fix it by running composer self-update before Composer touches untrusted code, or pin composer:2.11.3 with setup-php. Avoid building fork code under pull_request_target without maintainer approval.

_Teams hardening CI pipelines can follow GitHub Actions security developments on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@mohommedmotahiralam** · 0 upvotes

> The line I'd act on first is the one about runners: GitHub-hosted Ubuntu and Windows images still ship 2.11.2. So `composer self-update` belongs in the workflow itself until the images catch up, and not only on laptops.

**@pdfopsdev** · 0 upvotes

> the CI-on-fork-PR angle is the scary one here, anyone running composer install as part of a PR check job on an untrusted fork is basically running attacker code with repo secrets in scope. --no-scripts should probably be the default for any fork-triggered workflow regardless of this CVE.

## Similar posts on daily.dev

- [Unverified](https://daily.dev/posts/unverified-tiojtlabj) · PHPUnit Expert · 0 upvotes · 0 comments
- [Composer 2.9.6 Fixes Two Perforce Command Injection Vulnerabilities](https://daily.dev/posts/composer-2-9-6-fixes-two-perforce-command-injection-vulnerabilities-1cyx9zwzx) · Laravel News · 25 upvotes · 3 comments
- [Malicious Postinstall Hook Found Across 700\+ GitHub Reposito...](https://daily.dev/posts/malicious-postinstall-hook-found-across-700-github-reposito--a4oaimw4h) · Socket · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#php](https://daily.dev/tags/php), [#cicd](https://daily.dev/tags/cicd), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"composer2shell: The PHP Package Manager can get you Hacked (CVSS 8.8)","url":"https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy"},"datePublished":"2026-11-30T17:15:02.971Z","dateModified":"2026-11-30T17:15:26.956Z","description":"Any Composer command, even composer show, runs attacker code if you run it inside a booby-trapped PHP project. The flaw, composer2shell (CVSS 8.8), affects...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/577202dd4bd29528fa893d0668f13c14?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/577202dd4bd29528fa893d0668f13c14?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Orca Security Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Orca Security Blog","logo":"https://media.daily.dev/image/upload/s--kkQFNboJ--/f_auto,q_auto/v1780213281/logos/orca-security-blog?_a=BAMAMiWQ0","url":"https://daily.dev/sources/orca-security-blog"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"security,php,cicd,github-actions","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Orca Security Blog","item":"https://daily.dev/sources/orca-security-blog"},{"@type":"ListItem","position":3,"name":"composer2shell: The PHP Package Manager can get you Hacked (CVSS 8.8)"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy","comment":[{"@type":"Comment","text":"The line I’d act on first is the one about runners: GitHub-hosted Ubuntu and Windows images still ship 2.11.2. So composer self-update belongs in the workflow itself until the images catch up, and not only on laptops.","datePublished":"2026-11-30T18:33:36.282Z","url":"https://daily.dev/posts/5HD5NdeqY#c-NCDkK0Y1U","author":{"@type":"Person","name":"Mohommed Motahir Alam","url":"https://daily.dev/mohommedmotahiralam","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"}},{"@type":"Comment","text":"the CI-on-fork-PR angle is the scary one here, anyone running composer install as part of a PR check job on an untrusted fork is basically running attacker code with repo secrets in scope. --no-scripts should probably be the default for any fork-triggered workflow regardless of this CVE.","datePublished":"2026-11-30T18:14:53.172Z","url":"https://daily.dev/posts/5HD5NdeqY#c-cXOtdfjkK","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/composer2shell-the-php-package-manager-can-get-you-hacked-cvss-8-8--5hd5ndeqy#faq","mainEntity":[{"@type":"Question","name":"Which Composer versions are affected by composer2shell and how do I fix it?","acceptedAnswer":{"@type":"Answer","text":"Composer 2.2.23 to 2.2.32 and 2.7.0 to 2.11.2 are affected by composer2shell (GHSA-374h-4mh9-7rpm, CVSS 8.8). Upgrade to 2.11.3, or 2.2.33 on the LTS line, by running composer self-update. Running Composer with --no-plugins or --no-scripts on projects you don't control also prevents the payload from loading. Developers shipping PHP use daily.dev to catch Composer and dependency security fixes early."}},{"@type":"Question","name":"Can running composer show on an untrusted PHP project get me hacked?","acceptedAnswer":{"@type":"Answer","text":"Yes, on vulnerable versions. A crafted vendor-dir in composer.json plus a malicious installed.php executes attacker code as soon as Composer loads the project, so composer show, list, validate, diagnose and install all trigger it. It isn't exploitable remotely or via Packagist packages; the attacker must control the project directory you run Composer in. Anyone who clones unfamiliar repos benefits from following PHP security news on daily.dev."}},{"@type":"Question","name":"Are GitHub Actions runners vulnerable to the Composer composer2shell bug?","acceptedAnswer":{"@type":"Answer","text":"Yes. Ubuntu and Windows GitHub-hosted runners ship Composer 2.11.2, and Intel macOS runners ship 2.10.2, all vulnerable. Apple-silicon macOS and ubuntu-slim have no Composer. Fix it by running composer self-update before Composer touches untrusted code, or pin composer:2.11.3 with setup-php. Avoid building fork code under pull_request_target without maintainer approval. Teams hardening CI pipelines can follow GitHub Actions security developments on daily.dev."}}]}
```

