Skip to content
Heist/ feed
Back to feed
High

composer — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-40261

Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::syncCodeBase() method, which appends the $sourceReference parameter to a shell command without proper escaping, and additionally in the Perforce::generateP4Command() method as in GHSA-wg36-wvj6-r67p / CVE-2026-40176, which interpolates user-supplied Perforce connection parameters (port, user, client) from the source url field without proper escaping. An attacker can inject arbitrary commands through crafted source reference or source url values containing shell metacharacters, even if Perforce is not installed. Unlike CVE-2026-40176, the source reference and url are provided as part of package metadata, meaning any compromised or malicious Composer repository can serve package metadata declaring perforce as a source type with malicious values. This vulnerability is exploitable when installing or updating dependencies from source, including the default behavior when installing dev-prefixed versions. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline). If developers are unable to immediately update, they can avoid installing dependencies from source by using --prefer-dist or the preferred-install: dist config setting, and only use trusted Composer repositories as a workaround.

Products
composer
Affected versions
1.0.0~alpha10+20150602-1, 1.0.0~alpha10+20150602-2, 1.0.0~alpha11-1, 1.0.0~alpha11-1ubuntu1, 1.0.0~alpha11-2, 1.0.0~alpha11-3, 1.0.0~beta1-1ubuntu1, 1.0.0~beta2-1, 1.0.0~beta2-1ubuntu0.1~esm1, 1.0.0~beta2-1ubuntu0.1~esm2, 1.10.0-1, 1.10.1-1, 1.10.1-1ubuntu0.1~esm1, 1.10.1-1ubuntu0.1~esm2, 1.5.1-1, 1.5.2-1, 1.6.2-1, 1.6.3-1, 1.6.3-1ubuntu0.1~esm1, 1.6.3-1ubuntu0.1~esm2, 1.9.0-2, 1.9.1-1, 1.9.2-1, 1.9.3-1, 2.0.13-1ubuntu1, 2.0.9-2ubuntu2, 2.0.9-2ubuntu3, 2.1.12-1ubuntu1, 2.10.1-2, 2.10.2-1, 2.2.6-2ubuntu4, 2.2.6-2ubuntu4+esm1, 2.5.8-1, 2.6.5-1, 2.6.6-1, 2.7.1-2, 2.7.1-2ubuntu0.1~esm1, 2.8.6-1, 2.8.8-1, 2.9.5-1
Fixed versions
Not specified
CVEs
CVE-2026-40261
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 02:44 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-40261

core-osv · Original source

Published 15 Apr 2026, 21:17 UTC

Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::syncCodeBase() method, which appends the $sourceReference parameter to a shell command without proper escaping, and additionally in the Perforce::generateP4Command() method as in GHSA-wg36-wvj6-r67p / CVE-2026-40176, which interpolates user-supplied Perforce connection parameters (port, user, client) from the source url field without proper escaping. An attacker can inject arbitrary commands through crafted source reference or source url values containing shell metacharacters, even if Perforce is not installed. Unlike CVE-2026-40176, the source reference and url are provided as part of package metadata, meaning any compromised or malicious Composer repository can serve package metadata declaring perforce as a source type with malicious values. This vulnerability is exploitable when installing or updating dependencies from source, including the default behavior when installing dev-prefixed versions. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline). If developers are unable to immediately update, they can avoid installing dependencies from source by using --prefer-dist or the preferred-install: dist config setting, and only use trusted Composer repositories as a workaround.

osv:UBUNTU-CVE-2026-40261

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

composer

Fixed versions: Not specified

Complete source record
{
  "id": "ca364369b28fec95f29a29a238ea8878fb5e662169cda3fcc07cca809c68f050",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-40261",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-40261",
    "summary": "Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::syncCodeBase() method, which appends the $sourceReference parameter to a shell command without proper escaping, and additionally in the Perforce::generateP4Command() method as in GHSA-wg36-wvj6-r67p / CVE-2026-40176, which interpolates user-supplied Perforce connection parameters (port, user, client) from the source url field without proper escaping. An attacker can inject arbitrary commands through crafted source reference or source url values containing shell metacharacters, even if Perforce is not installed. Unlike CVE-2026-40176, the source reference and url are provided as part of package metadata, meaning any compromised or malicious Composer repository can serve package metadata declaring perforce as a source type with malicious values. This vulnerability is exploitable when installing or updating dependencies from source, including the default behavior when installing dev-prefixed versions. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline). If developers are unable to immediately update, they can avoid installing dependencies from source by using --prefer-dist or the preferred-install: dist config setting, and only use trusted Composer repositories as a workaround.",
    "evidence": "osv:UBUNTU-CVE-2026-40261",
    "products": [
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.0~alpha10+20150602-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~alpha10+20150602-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~alpha11-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~alpha11-1ubuntu1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~alpha11-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~alpha11-3",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~beta1-1ubuntu1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~beta2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~beta2-1ubuntu0.1~esm1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.0~beta2-1ubuntu0.1~esm2",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.5.1-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.5.2-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.6.2-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.6.3-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.6.3-1ubuntu0.1~esm1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.6.3-1ubuntu0.1~esm2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.9.0-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.3-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.10.0-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.10.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.10.1-1ubuntu0.1~esm1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.10.1-1ubuntu0.1~esm2",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.0.9-2ubuntu2",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2.0.9-2ubuntu3",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2.0.13-1ubuntu1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2.1.12-1ubuntu1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2.2.6-2ubuntu4",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2.2.6-2ubuntu4+esm1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.5.8-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "2.6.5-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "2.6.6-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "2.7.1-2",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "2.7.1-2ubuntu0.1~esm1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.8.6-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "2.8.8-1",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.9.5-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "2.10.1-2",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "2.10.2-1",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "composer",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.8.8-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "2.9.5-1",
            "evidence": "/affected/7/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "UBUNTU-CVE-2026-40261",
      "aliases": [
        "UBUNTU-CVE-2026-40261"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fxenial",
            "ecosystem": "Ubuntu:Pro:16.04:LTS"
          },
          "versions": [
            "1.0.0~alpha10+20150602-1",
            "1.0.0~alpha10+20150602-2",
            "1.0.0~alpha11-1",
            "1.0.0~alpha11-1ubuntu1",
            "1.0.0~alpha11-2",
            "1.0.0~alpha11-3",
            "1.0.0~beta1-1ubuntu1",
            "1.0.0~beta2-1",
            "1.0.0~beta2-1ubuntu0.1~esm1",
            "1.0.0~beta2-1ubuntu0.1~esm2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "1.0.0~beta2-1ubuntu0.1~esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fbionic",
            "ecosystem": "Ubuntu:Pro:18.04:LTS"
          },
          "versions": [
            "1.5.1-1",
            "1.5.2-1",
            "1.6.2-1",
            "1.6.3-1",
            "1.6.3-1ubuntu0.1~esm1",
            "1.6.3-1ubuntu0.1~esm2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "1.6.3-1ubuntu0.1~esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Ffocal",
            "ecosystem": "Ubuntu:Pro:20.04:LTS"
          },
          "versions": [
            "1.9.0-2",
            "1.9.1-1",
            "1.9.2-1",
            "1.9.3-1",
            "1.10.0-1",
            "1.10.1-1",
            "1.10.1-1ubuntu0.1~esm1",
            "1.10.1-1ubuntu0.1~esm2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "1.10.1-1ubuntu0.1~esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fjammy",
            "ecosystem": "Ubuntu:Pro:22.04:LTS"
          },
          "versions": [
            "2.0.9-2ubuntu2",
            "2.0.9-2ubuntu3",
            "2.0.13-1ubuntu1",
            "2.1.12-1ubuntu1",
            "2.2.6-2ubuntu4",
            "2.2.6-2ubuntu4+esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "2.2.6-2ubuntu4+esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fnoble",
            "ecosystem": "Ubuntu:Pro:24.04:LTS"
          },
          "versions": [
            "2.5.8-1",
            "2.6.5-1",
            "2.6.6-1",
            "2.7.1-2",
            "2.7.1-2ubuntu0.1~esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "2.7.1-2ubuntu0.1~esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "2.8.6-1",
            "2.8.8-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "2.8.8-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "2.9.5-1",
            "2.10.1-2",
            "2.10.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "2.10.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "composer",
            "purl": "pkg:deb/ubuntu/composer?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "2.8.8-1",
            "2.9.5-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "composer",
                "binary_version": "2.9.5-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:58:54.135384317Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-40261"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-40261",
        "https://www.cve.org/CVERecord?id=CVE-2026-40261",
        "https://github.com/composer/composer/security/advisories/GHSA-gqw4-4w2p-838q"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-40261",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 359152,
  "published_at": "2026-04-15T21:17:00+00:00"
}