CVE catalog

CVE-2026-40176

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::generateP4Command() method, which constructs shel

[CVE catalog]

Severity
High · CVSS 7.8CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Published
Source
[NVD] · [CVE record]
EPSS
1.04% · Oct 25, 2026

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::generateP4Command() method, which constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker can inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository, leading to command execution in the context of the user running Composer, even if Perforce is not installed. VCS repositories are only loaded from the root composer.json or the composer config directory, so this cannot be exploited through composer.json files of packages installed as dependencies. Users are at risk if they run Composer commands on untrusted projects with attacker-supplied composer.json files. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline).

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debiancomposersid2.10.3-1fixed
Debiancomposerforky2.10.3-1fixed
Debiancomposertrixie2.8.8-1+deb13u3fixed
Debiancomposerbookworm2.5.5-1+deb12u5fixed
Debiancomposerbookworm-security2.5.5-1+deb12u2vulnerable
CpecomposerNot reportedNot reportedunknown
Opensusephp-composer2tumbleweed2.9.7-1.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debiancomposersourcesid2.9.7-1not yet assignedNot reportedNot reported
Debiancomposersourceforky2.9.7-1not yet assignedNot reportedNot reported
Debiancomposersourcetrixie2.8.8-1+deb13u2not yet assignedNot reportedNot reported
Debiancomposersourcebookworm2.5.5-1+deb12u4not yet assignedNot reportedNot reported
Opensusephp-composer2rpmtumbleweed2.9.7-1.1Not reportedOPENSUSE-SU-2026:10643-1Not reported

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • [composer]Affected
    Details (4)
    • 2.5.5-1+deb12u5 · all · bookworm

      Fixed · Fixed: 2.5.5-1+deb12u4

      nvd · composer · debian · bookworm; nvd · composer · debian · 12

    • 2.5.5-1+deb12u5 · all · bookworm

      Fixed · Fixed: 2.5.5-1+deb12u4

      nvd · composer · debian · bookworm; nvd · composer · debian · 12

    • 2.5.5-1+deb12u2 · all · bookworm-security

      Affected · Fixed: 2.5.5-1+deb12u4

      nvd · composer · debian · bookworm; nvd · composer · debian · 12

    • 2.5.5-1+deb12u2 · all · bookworm-security

      Affected · Fixed: 2.5.5-1+deb12u4

      nvd · composer · debian · bookworm; nvd · composer · debian · 12

[Debian 13 (Trixie)]

  • [composer]Fixed
    Details (2)
    • 2.8.8-1+deb13u3 · all · trixie

      Fixed · Fixed: 2.8.8-1+deb13u2

      nvd · composer · debian · 13

    • 2.8.8-1+deb13u3 · all · trixie

      Fixed · Fixed: 2.8.8-1+deb13u2

      nvd · composer · debian · 13

[openSUSE Tumbleweed]

  • Source package: [php-composer2]

    Details (1)
    • 2.10.3-1.1 · noarch · tumbleweed

      Fixed · Fixed: 2.9.7-1.1

      nvd · php-composer2 · opensuse · tumbleweed

Observed:

References