{"id":"CVE-2024-24821","published":"2024-02-08T23:54:04Z","modified":"2025-06-17T21:29:29Z","title":"Code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php in Composer","vendor":"composer","product":"composer","tier":"tail","description":{"text":"Composer is a dependency Manager for the PHP language. In affected versions several files within the local working directory are included during the invocation of Composer and in the context of the executing user. As such, under certain conditions arbitrary code execution may lead to local privilege escalation, provide lateral user movement or malicious code execution when Composer is invoked within a directory with tampered files. All Composer CLI commands are affected, including composer.phar's self-update. The following scenarios are of high risk: Composer being run with sudo, Pipelines which may execute Composer on untrusted projects, Shared environments with developers who run Composer individually on the same project. This vulnerability has been addressed in versions 2.7.0 and 2.2.23. It is advised that the patched versions are applied at the earliest convenience. Where not possible, the following should be addressed: Remove all sudo composer privileges for all users to mitigate root privilege escalation, and avoid running Composer within an untrusted directory, or if needed, verify that the contents of `vendor/composer/InstalledVersions.php` and `vendor/composer/installed.php` do not include untrusted code.  A reset can also be done on these files by the following:```sh\nrm vendor/composer/installed.php vendor/composer/InstalledVersions.php\ncomposer install --no-scripts --no-plugins\n```","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00279,"percentile":0.20859,"provenance":"source"},"cwes":[{"id":"CWE-829","name":"Inclusion of Functionality from Untrusted Control Sphere"}],"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/composer/composer/commit/64e4eb356b159a30c766cd1ea83450a38dc23bf5","tags":["x_refsource_MISC"]}],"priority":{"score":10.3,"factors":[{"name":"EPSS percentile","points":4.17},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"composer","affectedVersions":[{"vendor":"composer","product":"composer","versions":[">= 2.0, < 2.2.23",">= 2.3, < 2.7"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-02-11T18:11:46.151113Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"composer/composer","vulnerableRanges":[">=2.0.0-alpha1, <2.2.23",">=2.3.0-rc1, <2.7.0"],"patched":["2.2.23","2.7.0"],"from":["GHSA-7c6p-848j-wh5h"],"provenance":"source"}],"summary":{"text":"Composer, the PHP dependency manager, loads the files vendor/composer/InstalledVersions.php and vendor/composer/installed.php from the local working directory whenever any CLI command runs, so tampered copies of these files can execute code. An attacker who can plant or modify those files in a project directory can run code as the invoking user, with local access and the user's privileges, and this becomes privilege escalation when Composer runs under sudo or in shared or pipeline environments that process untrusted projects.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:58:09Z"},"euvd":{"id":"EUVD-2024-0553","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-41116","published":"2021-10-05","fixed":"2.1.9","kev":false},{"cve":"CVE-2022-24828","published":"2022-04-13","fixed":"2.3.5","kev":false},{"cve":"CVE-2023-43655","published":"2023-09-29","fixed":"2.6.4","kev":false,"link":{"from":"CVE-2023-43655","to":"CVE-2024-24821","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.2.22","toFixed":"2.2.23","daysApart":132}]}},{"cve":"CVE-2024-24821","published":"2024-02-08","fixed":"2.7.0","kev":false},{"cve":"CVE-2024-35241","published":"2024-06-10","fixed":"2.7.7","kev":false,"link":{"from":"CVE-2024-24821","to":"CVE-2024-35241","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.2.23","toFixed":"2.2.24","daysApart":123}]}},{"cve":"CVE-2024-35242","published":"2024-06-10","fixed":"2.7.7","kev":false,"link":{"from":"CVE-2024-24821","to":"CVE-2024-35242","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.2.23","toFixed":"2.2.24","daysApart":123}]}},{"cve":"CVE-2025-67746","published":"2025-12-30","fixed":"2.9.3","kev":false}],"package":"Packagist:composer/composer"}}