{"id":"CVE-2022-24828","published":"2022-04-13T21:00:22Z","modified":"2025-04-23T18:40:09Z","title":"Missing input validation can lead to command execution in composer","vendor":"composer","product":"composer","tier":"tail","description":{"text":"Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call `VcsDriver::getFileContent` can have a code injection vulnerability if the user can control the `$file` or `$identifier` argument. This leads to a vulnerability on packagist.org for example where the composer.json's `readme` field can be used as a vector for injecting parameters into hg/Mercurial via the `$file` argument, or git via the `$identifier` argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call `getFileContent` with arbitrary data into `$file`/`$identifier`. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.3,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01886,"percentile":0.80024,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-x7cr-6qr6-2hh6","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709","tags":["x_refsource_MISC"]},{"url":"https://www.tenable.com/security/tns-2022-09","tags":["x_refsource_CONFIRM"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCG/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEF/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/625MT3IKWKFVIWLSYZFSXHVUA2LES7YQ/","tags":["vendor-advisory","x_refsource_FEDORA"]}],"priority":{"score":21.8,"factors":[{"name":"EPSS percentile","points":16.0},{"name":"CVSS severity","points":5.81}]},"vendorSlug":"composer","affectedVersions":[{"vendor":"composer","product":"composer","versions":["< 1.10.26",">= 2.0.0, < 2.2.12",">= 2.3, < 2.3.6"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-04-23T15:54:27.059100Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"composer/composer","vulnerableRanges":["<1.10.26",">=2.0, <2.2.12",">=2.3, <2.3.5"],"patched":["1.10.26","2.2.12","2.3.5"],"from":["GHSA-x7cr-6qr6-2hh6"],"provenance":"source"}],"summary":{"text":"A missing input validation flaw in Composer, the PHP dependency manager, affects integrators who call VcsDriver::getFileContent with user-controllable $file or $identifier arguments, allowing data injected into Mercurial or Git commands. An attacker would need to supply crafted data through a field such as a package's composer.json readme value (where the integrator passes it into those arguments) and get a user to interact with it, with no authentication required and remote network access sufficient to reach the affected integration.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:52:19Z"},"euvd":{"id":"EUVD-2022-1866","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2015-8371","published":"2023-09-21","fixed":"1.0.0","kev":false},{"cve":"CVE-2021-29472","published":"2021-04-27","fixed":"2.0.13","kev":false},{"cve":"CVE-2021-41116","published":"2021-10-05","fixed":"2.1.9","kev":false,"link":{"from":"CVE-2021-41116","to":"CVE-2022-24828","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"1.10.23","toFixed":"1.10.26","daysApart":190},{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.1.9","toFixed":"2.2.12","daysApart":190}]}},{"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-2022-24828","to":"CVE-2023-43655","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"1.10.26","toFixed":"1.10.27","daysApart":534},{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.2.12","toFixed":"2.2.22","daysApart":534}]}},{"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}],"package":"Packagist:composer/composer"}}