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-40261

published high CVSS 3.1 · 8.8

Composer has Command Injection via Malicious Perforce Reference

Published
15 Apr 2026, 20:56:32 UTC
Updated
15 Jul 2026, 01:01:10 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
composer — composer>= 2.3.0, < 2.9.6 · >= 1.0.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::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.

en · GitHub_M · cna

en · redhat-SADP · adp

A flaw was found in Composer. `Perforce::syncCodeBase()` appends the `$sourceReference` parameter to a shell command without proper escaping, allowing an attacker to inject arbitrary commands through a crafted source reference containing shell metacharacters.

Vendor advisories explicitly linked to this CVE.

16

Assessment

CVSS risk assessment and additional context for this vulnerability.

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

Additional Assessments

Additional normalized CVSS assessments
VersionScoreSeverityProviderVectorScenarios
3.1 8.8 high redhat-SADP · adp CVSS:3.1/AV:N/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.0, < 2.9.6 (affected)>= 1.0.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-78 CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (GitHub_M · cna)
  • CWE-20 CWE-20: Improper Input Validation (GitHub_M · cna)
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (redhat-SADP · adp)

References

6

Provider assertions

3

GitHub_M · cna

Composer has Command Injection via Malicious Perforce Reference

redhat-SADP · adp

composer: command injection via malicious Perforce source reference/url

CISA-ADP · adp

CISA ADP Vulnrichment

Provenance

Schema
5.2
Searchable
yes
Content hash
6d6e564743e620d38ea4b9b6999204b8f5149543270b653c4208d556385fd6d4
Ingested
23 Sep 2026, 09:13:02 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