CVE-2023-43655: Composer/composer Remote Code Execution Vulnerability
HIGHCVE-2023-43655 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Composer/composer libraries in the Packagist ecosystem. The issue involves composer remote code execution vulnerability via web-accessible composer.phar. Remediation is available by upgrading affected packages to version 1.10.27, 2.2.22, 2.6.4.
CVE-2023-43655 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2023-43655
To remediate this vulnerability, upgrade all affected Composer/composer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade composer/composer to 1.10.27
Upgrade composer/composer to 2.2.22
Upgrade composer/composer to 2.6.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for composer/composer
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-43655, inspect your project dependencies for Composer/composer:
inspect dependencies for composer/composer
Analyze the terminal output to locate any version of Composer/composer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.27), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Composer/composer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-43655 Affected Composer/composer Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
composer/composer
|
Packagist |
< 1.10.27
|
1.10.27
|
|
composer/composer
|
Packagist |
≥ 2.0.0
< 2.2.22
|
2.2.22
|
|
composer/composer
|
Packagist |
≥ 2.3.0
< 2.6.4
|
2.6.4
|
References
Frequently Asked Questions
What is CVE-2023-43655?
Which Composer/composer versions are affected?
What version fixes CVE-2023-43655?
Is composer/composer affected?
What is the CVSS score of CVE-2023-43655?
What CWE is associated with CVE-2023-43655?
How can I check Packagist dependencies for CVE-2023-43655?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jm6m-4632-36hf",
"modified" : "2025-02-13T19:15:08Z",
"published" : "2023-09-29T20:39:21Z",
"aliases" : [ "CVE-2023-43655" ],
"summary" : "Composer Remote Code Execution vulnerability via web-accessible composer.phar",
"details" : "### Impact\n\nUsers publishing a composer.phar to a public web-accessible server where the composer.phar can be executed as a php file may be impacted if PHP also has `register_argc_argv` enabled in php.ini.\n\n### Patches\n\n2.6.4, 2.2.22 and 1.10.27 patch this vulnerability.\n\n### Workarounds\n\nMake sure `register_argc_argv` is disabled in php.ini, and avoid publishing composer.phar to the web as this really should not happen.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "composer/composer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.10.27"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "composer/composer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.2.22"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "composer/composer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.0"
}, {
"fixed" : "2.6.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/composer/composer/security/advisories/GHSA-jm6m-4632-36hf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-43655"
}, {
"type" : "WEB",
"url" : "https://github.com/composer/composer/commit/4fce14795aba98e40b6c4f5047305aba17a6120d"
}, {
"type" : "WEB",
"url" : "https://github.com/composer/composer/commit/955a48e6319c8962e5cd421b07c00ab3c728968c"
}, {
"type" : "WEB",
"url" : "https://github.com/composer/composer/commit/95e091c921037b7b6564942845e7b738f6b95c9c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/composer/composer"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2024/03/msg00030.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/66H2WKFUO255T3BZTL72TNYJYH2XM5FG"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7AWYAUZNH565NWPIKGEIYBWHYNM5JGAE"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KFOPGPW2KS37O3KJWBRGTUWHTXCQXBS2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-09-29T20:39:21Z",
"nvd_published_at" : "2023-09-29T20:15:09Z"
}
}