Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2026-40176

published high CVSS 3.1 · 7.8

Composer is vulnerable to Command Injection via Malicious Perforce Repository

Published
15 Apr 2026, 20:47:39 UTC
Updated
02 Nov 2026, 23:04:32 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
composer — composer>= 2.3, < 2.9.6 · >= 1.0, < 2.2.27 Affected Not stated GitHub_M
Red Hat — composer-mainRed Hat Hardened Images · 2.9.7-1.hum1 and later · Other versions: affected Unaffected Not stated redhat-SADP
Amazon Linux AL2023 Release evaluationALAS2023-2026-1625 Fixed Not stated Amazon Linux assessment
Alpine Linux edge composer Fixed 2.9.6-r0 Package fix record
SUSE / openSUSE SLE-15-SP4 php-composer2noarch Advisory build 2.2.27-150400.3.18.1 SUSE-SU-2026:1970-1
Amazon Linux AL2023 composernoarch Listed in advisory Not stated ALAS2023-2026-1625
Alpine Linux v3.23 composer Fixed 2.9.6-r0 Package fix record
Alpine Linux v3.24 composer Fixed 2.9.6-r0 Package fix record
Show 15 more entries
Distro / vendorReleasePackage / productPublisher statusFixed buildSource
SUSE / openSUSE SLE-15-SP5 php-composer2noarch Advisory build 2.2.27-150400.3.18.1 SUSE-SU-2026:1970-1
SUSE / openSUSE SLE-15-SP6 php-composer2noarch Advisory build 2.6.4-150600.3.12.1 SUSE-SU-2026:3105-1
SUSE / openSUSE SLE-15-SP6 php-composer2noarch Advisory build 2.6.4-150600.3.9.1 SUSE-SU-2026:1784-1
SUSE / openSUSE SLE-15-SP7 php-composer2noarch Advisory build 2.6.4-150600.3.12.1 SUSE-SU-2026:3105-1
SUSE / openSUSE SLE-15-SP7 php-composer2noarch Advisory build 2.6.4-150600.3.9.1 SUSE-SU-2026:1784-1
SUSE / openSUSE SLE-16 php-composer2noarch Advisory build 2.8.9-160000.3.1 SUSE-SU-2026:21542-1
SUSE / openSUSE SLE-16 php-composer2noarch Advisory build 2.8.9-160000.4.1 SUSE-SU-2026:23116-1
SUSE / openSUSE SLE-16 php-composer2noarch Advisory build 2.8.9-160000.4.1 SUSE-SU-2026:23138-1
SUSE / openSUSE openSUSE-Leap-16.0 php-composer2noarch Advisory build 2.8.9-160000.3.1 OPENSUSE-SU-2026:20670-1
SUSE / openSUSE openSUSE-Leap-16.0 php-composer2noarch Advisory build 2.8.9-160000.4.1 OPENSUSE-SU-2026:21520-1
SUSE / openSUSE openSUSE-Tumbleweed php-composer2aarch64 Advisory build 2.9.7-1.1 OPENSUSE-SU-2026:10643-1
SUSE / openSUSE openSUSE-Tumbleweed php-composer2ppc64le Advisory build 2.9.7-1.1 OPENSUSE-SU-2026:10643-1
SUSE / openSUSE openSUSE-Tumbleweed php-composer2s390x Advisory build 2.9.7-1.1 OPENSUSE-SU-2026:10643-1
SUSE / openSUSE openSUSE-Tumbleweed php-composer2x86_64 Advisory build 2.9.7-1.1 OPENSUSE-SU-2026:10643-1
Amazon Linux AL2023 composersrc Listed in advisory Not stated ALAS2023-2026-1625

Description

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).

en · GitHub_M · cna

en · redhat-SADP · adp

A flaw was found in Composer. `Perforce::generateP4Command()` constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping, allowing an attacker to inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository.

Vendor advisories explicitly linked to this CVE.

16

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
7.8 / 10
Severity
high
Provider
GitHub_M · cna
Vector string
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Additional Assessments

Additional normalized CVSS assessments
VersionScoreSeverityProviderVectorScenarios
3.1 7.8 high redhat-SADP · adp CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H —

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
composer composer >= 2.3, < 2.9.6 (affected)>= 1.0, < 2.2.27 (affected) GitHub_M · cna
Red Hat Red Hat Hardened Images 2.9.7-1.hum1 and later (unaffected · rpm)Default: affected redhat-SADP · adp

Weaknesses

3
  • CWE-20 CWE-20: Improper Input Validation (GitHub_M · cna)
  • CWE-78 CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (GitHub_M · cna)
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (redhat-SADP · adp)

References

8

Provider assertions

3

GitHub_M · cna

Composer is vulnerable to Command Injection via Malicious Perforce Repository

redhat-SADP · adp

composer: command injection via malicious Perforce repository definition

CISA-ADP · adp

CISA ADP Vulnrichment

Provenance

Schema
5.2
Searchable
yes
Content hash
f8b07a7b1af669a1a4416dba941fdb537dd677294b387cf0debf29963964b4f5
Ingested
02 Nov 2026, 23:14:50 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected