{"id":"CVE-2026-59948","aliases":["CVE-2026-59948","GHSA-499r-g7pc-vmp9","BIT-COMPOSER-2026-59948"],"related":[],"kind":"vulnerability","state":"published","title":"Composer: Arbitrary file write outside vendor via malicious transitive package name","summary":"Composer is a dependency Manager for the PHP language. Prior to 2.2.29 and 2.10.2, a maliciously crafted package from an untrusted repository other than Packagist.org or Private Packagist can cause Composer to write attacker-controlled files outside the vendor directory and outside the project during install or update by using an invalid package name that is not correctly validated before dependency-resolution results are written or installed. This issue is fixed in versions 2.2.29 and 2.10.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Composer is a dependency Manager for the PHP language. Prior to 2.2.29 and 2.10.2, a maliciously crafted package from an untrusted repository other than Packagist.org or Private Packagist can cause Composer to write attacker-controlled files outside the vendor directory and outside the project during install or update by using an invalid package name that is not correctly validated before dependency-resolution results are written or installed. This issue is fixed in versions 2.2.29 and 2.10.2.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nA maliciously crafted package, published on an untrusted third party repository other than Packagist.org or Private Packagist, can cause Composer to write files outside the `vendor/` directory and outside your project, with attacker-controlled content, during a normal `install` or `update` through using an invalid package name, which was not correctly validated by Composer.\n\nThis is an arbitrary file write that can be used to execute code outside the Composer project's context in which you expected the package code to execute (for example by writing shell startup files, SSH `authorized_keys`, or a cron entry). It is a supply-chain issue: it requires a malicious or compromised package to be present in the dependency graph, it is not otherwise remotely exploitable against a machine.\n\nThe fix makes Composer validate every package produced by dependency resolution before anything is written to `composer.lock` or installed, and abort with a security error if a package name is not a valid `vendor/package` name.\n\n## Am I affected?\n\nYou may be affected if you install packages from an untrusted third party repository, which does not sufficiently validate package names. Packagist.org and Private Packagist are safe, as they validate package names correctly.\n\n## Patched versions\n\nFixed in **2.2.29** and **2.10.2**. Composer 1.x is also affected and you should move to a safe 2.x release.\n\n## Workarounds\n\nDo not use untrusted package repositories. If you have to, mirror them through an internal repository like Private Packagist.","format":"markdown","source":"ghsa"}],"published":"2026-07-08T19:33:48.414Z","modified":"2026-12-01T16:30:34.202Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-22","CWE-787"],"affected":[{"ranges":[{"version":">= 1.0, < 2.2.29","status":"affected"},{"version":">= 2.3.0, < 2.10.2","status":"affected"}],"vendor":"composer","product":"composer","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.10.2"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.0.0","status":"affected","fixed":"2.2.29"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"2.2.29"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.10.2"}],"ecosystem":"Bitnami","package":"composer","purl":"pkg:bitnami/composer","source":"bitnami"}],"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-499r-g7pc-vmp9","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/commit/502c6c4f699802d9cf464728b3e8a95674f919a0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/commit/c50b1efd13ebd73f6dca19b31424c5a02bf93cc1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/releases/tag/2.10.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/releases/tag/2.2.29","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59948","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/composer/composer","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-07-09T14:32:00.579Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59948","url":"https://www.cve.org/CVERecord?id=CVE-2026-59948","licence":"CVE Terms of Use","modified":"2026-07-09T14:32:07.719Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-499r-g7pc-vmp9","url":"https://github.com/advisories/GHSA-499r-g7pc-vmp9","licence":"CC-BY-4.0","modified":"2026-12-01T16:30:34.202Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59948","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59948","licence":"Public domain","modified":"2026-07-10T19:14:18.563Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-COMPOSER-2026-59948","url":"https://osv.dev/vulnerability/BIT-COMPOSER-2026-59948","licence":"Apache-2.0","modified":"2026-07-27T09:00:07.263Z"}],"updatedAt":"2026-12-01T17:07:25.140Z","epss":{"score":0.00138,"percentile":0.03368,"date":"2026-12-01T12:00:22.000Z"}}