{"id":"CVE-2022-24828","aliases":["CVE-2022-24828","GHSA-x7cr-6qr6-2hh6","BIT-COMPOSER-2022-24828"],"related":[],"kind":"vulnerability","state":"published","title":"Missing input validation can lead to command execution in composer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"The Composer method `VcsDriver::getFileContent()` with user-controlled `$file` or `$identifier` arguments is susceptible to an argument injection vulnerability. It can be leveraged to gain arbitrary command execution if the Mercurial or the Git driver are used.\n\nThis led to a vulnerability on Packagist.org and Private Packagist, i.e., using the composer.json `readme` field as a vector for injecting parameters into the `$file` argument for the Mercurial driver or via the `$identifier` argument for the Git and Mercurial drivers.\n\nComposer itself can be attacked through branch names by anyone controlling a Git or Mercurial repository, which is explicitly listed by URL in a project's composer.json.\n\nTo the best of our knowledge, this was not actively exploited. The vulnerability has been patched on Packagist.org and Private Packagist within a day of the vulnerability report.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Composer es un administrador de dependencias para el lenguaje de programación PHP. Los integradores usando el código de Composer para llamar a la función \"VcsDriver::getFileContent\" pueden tener una vulnerabilidad de inyección de código si el usuario puede controlar el argumento \"$file\" o \"$identifier\". Esto conlleva a una vulnerabilidad en packagist.org, por ejemplo, donde el campo \"readme\" de composer.json puede ser usado como vector para inyectar parámetros en hg/Mercurial por medio del argumento \"$file\", o en git por medio del argumento \"$identifier\" si son permitidos datos arbitrarios allí (Packagist no lo hace, pero quizás otros integradores sí). El propio Composer no debería verse afectado por la vulnerabilidad, ya que no llama a \"getFileContent\" con datos arbitrarios en $file\"/\"$identifier\". Por lo que sabemos, no ha sido abusado de ello, y la vulnerabilidad ha sido parcheada en packagist.org y en Private Packagist un día después del informe de la vulnerabilidad","source":"nvd"}],"published":"2022-04-13T21:00:22.000Z","modified":"2026-09-08T08:45:57.053Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","score":8.3,"rating":"HIGH"},{"scorer":"NVD","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":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-20","CWE-88","CWE-94"],"affected":[{"ranges":[{"version":"< 1.10.26","status":"affected"},{"version":">= 2.0.0, < 2.2.12","status":"affected"},{"version":">= 2.3, < 2.3.6","status":"affected"}],"vendor":"composer","product":"composer","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.10.26"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0","status":"affected","fixed":"2.2.12"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3","status":"affected","fixed":"2.3.5"}],"ecosystem":"Packagist","package":"composer/composer","purl":"pkg:composer/composer/composer","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.10.26"},{"status":"affected","introduced":"2.0.0","fixed":"2.2.12"},{"status":"affected","introduced":"2.3.0","fixed":"2.3.5"}],"vendor":"getcomposer","product":"composer","cpe":"cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","fixed":"5.21.0"}],"vendor":"tenable","product":"tenable.sc","cpe":"cpe:2.3:a:tenable:tenable.sc:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"34"},{"status":"affected","version":"35"},{"status":"affected","version":"36"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.10.26"},{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.2.12"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.3.5"}],"ecosystem":"Bitnami","package":"composer","purl":"pkg:bitnami/composer","source":"bitnami"}],"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-x7cr-6qr6-2hh6","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709","tags":["advisory","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://www.tenable.com/security/tns-2022-09","tags":["advisory","patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCG/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEF/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/625MT3IKWKFVIWLSYZFSXHVUA2LES7YQ/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24828","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2022-24828.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/composer/composer","tags":["package"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/625MT3IKWKFVIWLSYZFSXHVUA2LES7YQ","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEF","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCG","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-04-23T15:54:27.059Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-24828","url":"https://www.cve.org/CVERecord?id=CVE-2022-24828","licence":"CVE Terms of Use","modified":"2025-04-23T18:40:09.513Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-x7cr-6qr6-2hh6","url":"https://github.com/advisories/GHSA-x7cr-6qr6-2hh6","licence":"CC-BY-4.0","modified":"2024-02-21T05:32:42.447Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-24828","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24828","licence":"Public domain","modified":"2026-06-17T04:32:36.670Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-COMPOSER-2022-24828","url":"https://osv.dev/vulnerability/BIT-COMPOSER-2022-24828","licence":"Apache-2.0","modified":"2026-09-08T08:45:57.053Z"}],"updatedAt":"2026-11-25T22:58:10.619Z","epss":{"score":0.01886,"percentile":0.80115,"date":"2026-12-01T12:00:22.000Z"}}