{"id":"CVE-2024-35241","aliases":["CVE-2024-35241","GHSA-47f6-5gq3-vx9c","BIT-COMPOSER-2024-35241"],"related":[],"kind":"vulnerability","state":"published","title":"Composer vulnerable to command injection via malicious git branch name","summary":"Composer is a dependency manager for PHP. On the 2.x branch prior to versions 2.2.24 and 2.7.7, the `status`, `reinstall` and `remove` commands with packages installed from source via git containing specially crafted branch names in the repository can be used to execute code. Patches for this issue are available in version 2.2.24 for 2.2 LTS or 2.7.7 for mainline. As a workaround, avoid installing dependencies via git by using `--prefer-dist` or the `preferred-install: dist` config setting.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Composer is a dependency manager for PHP. On the 2.x branch prior to versions 2.2.24 and 2.7.7, the `status`, `reinstall` and `remove` commands with packages installed from source via git containing specially crafted branch names in the repository can be used to execute code. Patches for this issue are available in version 2.2.24 for 2.2 LTS or 2.7.7 for mainline. As a workaround, avoid installing dependencies via git by using `--prefer-dist` or the `preferred-install: dist` config setting.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nThe `status`, `reinstall` and `remove` commands with packages installed from source via git containing specially crafted branch names in the repository can be used to execute code.\n\n### Patches\n\n2.2.24 for 2.2 LTS or 2.7.7 for mainline\n\n### Workarounds\n\nAvoid installing dependencies via git by using `--prefer-dist` or the `preferred-install: dist` config setting.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Composer es un administrador de dependencias para PHP. En la rama 2.x anterior a las versiones 2.2.24 y 2.7.7, los comandos `status`, `reinstall` y `remove` con paquetes instalados desde el código fuente a través de git que contienen nombres de ramas especialmente manipulados en el repositorio se pueden usar para ejecutar código. Los parches para este problema están disponibles en la versión 2.2.24 para 2.2 LTS o 2.7.7 para la línea principal. Como workaround, evite instalar dependencias a través de git usando `--prefer-dist` o la configuración de configuración `preferred-install: dist`.","source":"nvd"}],"published":"2024-06-10T21:19:47.123Z","modified":"2026-09-10T03:49:18.831Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-77"],"affected":[{"ranges":[{"version":">= 2.0, < 2.2.24","status":"affected"},{"version":">= 2.3, < 2.7.7","status":"affected"}],"vendor":"composer","product":"composer","source":"cvelist"},{"ranges":[{"version":"39","status":"affected"},{"version":"40","status":"affected"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:39:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"2.0","fixed":"2.2.24","status":"affected"}],"vendor":"getcomposer","product":"composer","cpe":"cpe:2.3:a:getcomposer:composer:2.0:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"2.3","fixed":"2.7.7","status":"affected"}],"vendor":"getcomposer","product":"composer","cpe":"cpe:2.3:a:getcomposer:composer:2.3:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0","status":"affected","fixed":"2.2.24"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3","status":"affected","fixed":"2.7.7"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.2.24"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.7.7"}],"ecosystem":"Bitnami","package":"composer","purl":"pkg:bitnami/composer","source":"bitnami"}],"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-47f6-5gq3-vx9c","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/commit/b93fc6ca437da35ae73d667d0618749c763b67d4","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/commit/ee28354ca8d33c15949ad7de2ce6656ba3f68704","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/","tags":["web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/","tags":["web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.vicarius.io/vsociety/posts/cve-2024-35241-detect-composer-vulnerability","tags":["web"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://www.vicarius.io/vsociety/posts/cve-2024-35241-mitigate-vulnerable-composer","tags":["web"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35241","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/composer/composer","tags":["package"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2024-07-15T20:42:58.759Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-35241","url":"https://www.cve.org/CVERecord?id=CVE-2024-35241","licence":"CVE Terms of Use","modified":"2025-04-21T15:20:35.089Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-47f6-5gq3-vx9c","url":"https://github.com/advisories/GHSA-47f6-5gq3-vx9c","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:18.831Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-35241","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35241","licence":"Public domain","modified":"2026-06-17T07:34:36.580Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-COMPOSER-2024-35241","url":"https://osv.dev/vulnerability/BIT-COMPOSER-2024-35241","licence":"Apache-2.0","modified":"2025-05-20T10:02:07.006Z"}],"updatedAt":"2026-11-25T22:58:41.650Z","epss":{"score":0.01487,"percentile":0.74348,"date":"2026-11-30T12:00:22.000Z"}}