{"answers":{"affected":"5 open source packages ship an affected version, including composer/composer and composer. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-24821 in the wild and no public exploit code.","fix":"Upgrade composer/composer to a fixed version for your release line: 2.2.23 or 2.7.0.","what":"CVE-2024-24821 is a high-severity code injection vulnerability in composer, published on 8 Feb 2024. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-24821 and fix it if it is affected.\n\nWhat it is: CVE-2024-24821 is a high-severity code injection vulnerability in composer, published on 8 Feb 2024. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-24821 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- composer/composer (Packagist): affected from 2.0.0-alpha1; fixed in 2.2.23\n- composer/composer (Packagist): affected from 2.0.0-alpha1; fixed in 2.2.23\n- composer/composer (Packagist): affected from 2.3.0-rc1; fixed in 2.7.0\n- composer/composer (Packagist): affected from 2.3.0-rc1; fixed in 2.7.0\n- composer (Bitnami): affected from 2.0.0; fixed in 2.2.23, 2.7.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-24821/ (Markdown: https://insights.sbomify.com/CVE-2024-24821/index.md)","id":"CVE-2024-24821","markdown":"https://insights.sbomify.com/CVE-2024-24821/index.md","name":"CVE-2024-24821","record":{"aliases":["BIT-composer-2024-24821","CLEANSTART-2024-JY83809","DEBIAN-CVE-2024-24821","DSA-5632-1","GHSA-7c6p-848j-wh5h","SUSE-SU-2024:0592-1","UBUNTU-CVE-2024-24821","openSUSE-SU-2024:13681-1"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution","privilege_escalation"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"PHP dependency manager","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary code and escalate privileges by tampering with Composer's local installation files, affecting CLI commands and self-updates.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"composer","vendor":"getcomposer"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-829","name":"Inclusion of Functionality from Untrusted Control Sphere"}],"description":"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```","ecosystems":["Bitnami","Packagist","SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","SUSE:Linux Enterprise Module for Web and Scripting 15 SP5","SUSE:Linux Enterprise Server 15 SP4-LTSS","SUSE:Linux Enterprise Server for SAP Applications 15 SP4","SUSE:Manager Server 4.3","openSUSE:Leap 15.5","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php in Composer","id":"CVE-2024-24821","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":13,"n_references":2,"next":{"headline":"Pimcore Admin Classic Bundle permissions are not getting checked when working with tags","id":"CVE-2024-24822"},"packages":[{"ecosystem":"Bitnami","fixed":["2.2.23","2.7.0"],"introduced":["2.0.0","2.3.0"],"last_affected":[],"package":"composer","purl":"pkg:bitnami/composer","source":"BIT-composer-2024-24821"},{"ecosystem":"Packagist","fixed":["2.2.23"],"introduced":["2.0.0-alpha1"],"last_affected":[],"package":"composer/composer","purl":null,"source":"GHSA-7c6p-848j-wh5h"},{"ecosystem":"Packagist","fixed":["2.2.23"],"introduced":["2.0.0-alpha1"],"last_affected":[],"package":"composer/composer","purl":"pkg:composer/composer/composer","source":"GHSA-7c6p-848j-wh5h"},{"ecosystem":"Packagist","fixed":["2.7.0"],"introduced":["2.3.0-rc1"],"last_affected":[],"package":"composer/composer","purl":null,"source":"GHSA-7c6p-848j-wh5h"},{"ecosystem":"Packagist","fixed":["2.7.0"],"introduced":["2.3.0-rc1"],"last_affected":[],"package":"composer/composer","purl":"pkg:composer/composer/composer","source":"GHSA-7c6p-848j-wh5h"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/suse/php-composer2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOS","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/suse/php-composer2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSS","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Web and Scripting 15 SP5","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/suse/php-composer2\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP5","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"SUSE:Linux Enterprise Server 15 SP4-LTSS","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/suse/php-composer2\u0026distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP4-LTSS","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP4","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/suse/php-composer2\u0026distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP4","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"SUSE:Manager Server 4.3","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/suse/php-composer2\u0026distro=SUSE%20Manager%20Server%204.3","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["2.2.3-150400.3.9.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/opensuse/php-composer2\u0026distro=openSUSE%20Leap%2015.5","source":"SUSE-SU-2024:0592-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["2.7.1-1.1"],"introduced":["0"],"last_affected":[],"package":"php-composer2","purl":"pkg:rpm/opensuse/php-composer2\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:13681-1"}],"prev":{"headline":"Icinga Director configuration is susceptible to Cross-Site Request Forgery","id":"CVE-2024-24820"},"products":["composer"],"published":"2024-02-08","related":[{"cvss_score":8.8,"headline":"Composer has Command Injection via Malicious Perforce Reference","id":"CVE-2026-40261","kev_date_added":null,"published":"2026-04-15"},{"cvss_score":8.8,"headline":"Composer allows cache poisoning from other projects built on the same host","id":"CVE-2015-8371","kev_date_added":null,"published":"2023-09-21"},{"cvss_score":8.2,"headline":"Command injection in composer on Windows","id":"CVE-2021-41116","kev_date_added":null,"published":"2021-10-05"},{"cvss_score":7.8,"headline":"Composer is vulnerable to Command Injection via Malicious Perforce Repository","id":"CVE-2026-40176","kev_date_added":null,"published":"2026-04-15"},{"cvss_score":1.3,"headline":"Composer vulnerable to ANSI sequence injection","id":"CVE-2025-67746","kev_date_added":null,"published":"2025-12-30"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-06-17","vendors":["composer"]},"summary":"Attackers can execute arbitrary code and escalate privileges by tampering with Composer's local installation files, affecting CLI commands and self-updates.","url":"https://insights.sbomify.com/CVE-2024-24821/"}