{"answers":{"affected":"5 open source packages ship an affected version, including composer/composer and composer.","exploited":"There is no known exploitation of CVE-2024-35242 in the wild and no public exploit code.","fix":"Upgrade composer/composer to a fixed version for your release line: 2.2.24 or 2.7.7.","what":"CVE-2024-35242 is a high-severity command injection vulnerability in composer, published on 10 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2024-35242 and fix it if it is affected.\n\nWhat it is: CVE-2024-35242 is a high-severity command injection vulnerability in composer, published on 10 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2024-35242 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- composer/composer (Packagist): affected from 2.0; fixed in 2.2.24\n- composer/composer (Packagist): affected from 2.0; fixed in 2.2.24\n- composer/composer (Packagist): affected from 2.3; fixed in 2.7.7\n- composer/composer (Packagist): affected from 2.3; fixed in 2.7.7\n- composer (Bitnami): affected from 2.0.0; fixed in 2.2.24, 2.7.7\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-35242/ (Markdown: https://insights.sbomify.com/CVE-2024-35242/index.md)","id":"CVE-2024-35242","markdown":"https://insights.sbomify.com/CVE-2024-35242/index.md","name":"CVE-2024-35242","record":{"aliases":["BIT-composer-2024-35242","CLEANSTART-2024-DD29597","DEBIAN-CVE-2024-35242","GHSA-v9qv-c7wm-wgmf","UBUNTU-CVE-2024-35242"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"PHP dependency manager","requires_auth":"none","summary":"Attackers can execute arbitrary commands by tricking users into cloning repositories with malicious branch names using Composer.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"}],"description":"Composer is a dependency manager for PHP. On the 2.x branch prior to versions 2.2.24 and 2.7.7, the `composer install` command running inside a git/hg repository which has specially crafted branch names can lead to command injection. This requires cloning untrusted repositories. Patches are available in version 2.2.24 for 2.2 LTS or 2.7.7 for mainline. As a workaround, avoid cloning potentially compromised repositories.","ecosystems":["Bitnami","Packagist"],"exploits":{"exploitdb":0,"first_seen":"2024-07-15","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2024-07-15T15:01:31Z","kind":"github_poc","ref":"https://github.com/KKkai0315/CVE-2024-35242","stars":0,"title":"A test repository for the vulnerability CVE-2024-35242's PoC"}],"tier":"poc_unverified"},"has_fix":true,"headline":"Composer vulnerable to command injection via malicious git/hg branch names","id":"CVE-2024-35242","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"command_injection","year":"2024"},"n_packages":5,"n_references":5,"next":{"headline":"Hardcoded credentials in Multiple MFPs (multifunction printers)","id":"CVE-2024-35244"},"packages":[{"ecosystem":"Bitnami","fixed":["2.2.24","2.7.7"],"introduced":["2.0.0","2.3.0"],"last_affected":[],"package":"composer","purl":"pkg:bitnami/composer","source":"BIT-composer-2024-35242"},{"ecosystem":"Packagist","fixed":["2.2.24"],"introduced":["2.0"],"last_affected":[],"package":"composer/composer","purl":null,"source":"GHSA-v9qv-c7wm-wgmf"},{"ecosystem":"Packagist","fixed":["2.2.24"],"introduced":["2.0"],"last_affected":[],"package":"composer/composer","purl":"pkg:composer/composer/composer","source":"GHSA-v9qv-c7wm-wgmf"},{"ecosystem":"Packagist","fixed":["2.7.7"],"introduced":["2.3"],"last_affected":[],"package":"composer/composer","purl":null,"source":"GHSA-v9qv-c7wm-wgmf"},{"ecosystem":"Packagist","fixed":["2.7.7"],"introduced":["2.3"],"last_affected":[],"package":"composer/composer","purl":"pkg:composer/composer/composer","source":"GHSA-v9qv-c7wm-wgmf"}],"prev":{"headline":"Composer vulnerable to command injection via malicious git branch name","id":"CVE-2024-35241"},"products":["composer"],"published":"2024-06-10","related":[],"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":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-02-13","vendors":["composer"]},"summary":"Attackers can execute arbitrary commands by tricking users into cloning repositories with malicious branch names using Composer.","url":"https://insights.sbomify.com/CVE-2024-35242/"}