# Composer has a command injection via malicious perforce reference

Advisory record · `GHSA-gqw4-4w2p-838q`

- **Identifiers:** `GHSA-gqw4-4w2p-838q` · `BIT-composer-2026-40261` · `CVE-2026-40261` · `PKSA-t5r2-p5q9-mtpn`
- **State:** Confirmed
- **Severity:** CVSS 8.8 High
- **Critical:** No
- **Weakness (CWE):** [CWE-20](https://cwe.mitre.org/data/definitions/20.html) · [CWE-78](https://cwe.mitre.org/data/definitions/78.html)
- **Tags:** [Command injection](https://agentprime.io/advisories/tag/command-injection.md) · [CWE-20](https://agentprime.io/advisories/tag/cwe-20.md)
- **Published:** 14 Apr 2026
- **Updated:** 10 Sept 2026
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 14 Apr 2026, 20:01 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `composer/composer` (Packagist): affected `>=2.3.0, <2.9.6 || >=1.0.0, <2.2.27`; fixed in `2.9.6`, `2.2.27`

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 8.8 High, CVSS 3.1: `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`, from CNA (GitHub_M)

- **CISA KEV:** Not listed.
- **EPSS:** 0.017, the 77th percentile, on 15 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 14 Apr 2026, 09:46 UTC: [Published by the maintainers as a GitHub repository advisory](https://github.com/composer/composer/security/advisories/GHSA-gqw4-4w2p-838q)
- 31 Oct 2026, 13:59 UTC: First seen by agentprime
- 31 Oct 2026, 13:59 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-gqw4-4w2p-838q)

## Sources

- [GitHub Advisory Database: GHSA-gqw4-4w2p-838q](https://github.com/advisories/GHSA-gqw4-4w2p-838q)
- [OSV: GHSA-gqw4-4w2p-838q](https://osv.dev/vulnerability/GHSA-gqw4-4w2p-838q)
- <https://github.com/composer/composer/security/advisories/GHSA-gqw4-4w2p-838q>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40261>
- <https://access.redhat.com/errata/RHSA-2026:8165>
- <https://access.redhat.com/security/cve/CVE-2026-40261>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2458841>
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2026-40261.yaml>
- <https://github.com/composer/composer>
- <https://github.com/composer/composer/releases/tag/2.9.6>
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40261.json>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-gqw4-4w2p-838q>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-gqw4-4w2p-838q/>. Everything for agents: <https://agentprime.io/llms.txt>.
