{"schemaVersion":3,"id":"CVE-2021-29472","aliases":["openSUSE-SU-2021:1289-1","UBUNTU-CVE-2021-29472","USN-5220-1","DEBIAN-CVE-2021-29472","DLA-2654-1","DSA-4907-1","openSUSE-SU-2024:11166-1"],"status":"published","duplicateOf":null,"title":null,"description":"Composer is a dependency manager for PHP. URLs for Mercurial repositories in the root composer.json and package source download URLs are not sanitized correctly. Specifically crafted URL values allow code to be executed in the HgDriver if hg/Mercurial is installed on the system. The impact to Composer users directly is limited as the composer.json file is typically under their own control and source download URLs can only be supplied by third party Composer repositories they explicitly trust to download and execute source code from, e.g. Composer plugins. The main impact is to services passing user input to Composer, including Packagist.org and Private Packagist. This allowed users to trigger remote code execution. The vulnerability has been patched on Packagist.org and Private Packagist within 12h of receiving the initial vulnerability report and based on a review of logs, to the best of our knowledge, was not abused by anyone. Other services/tools using VcsRepository/VcsDriver or derivatives may also be vulnerable and should upgrade their composer/composer dependency immediately. Versions 1.10.22 and 2.0.13 include patches for this issue.","dates":{"published":"2021-04-27T20:30:15.000Z","modified":"2024-08-03T22:11:05.384Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":7.2,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":7.2,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":6.5,"severity":"medium","vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.04752,"percentile":0.91791,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0.09199999999999972,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.0466},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.04752,"percentile":0.91791}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.0466,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.04624,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.04752,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.04752,"percentile":0.91791}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_C374F74352BE304A","name":"Exploit Reference (blog.sonarsource.com)","source":"reference","url":"https://blog.sonarsource.com/php-supply-chain-attack-on-composer/","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-88","name":"Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')","description":"The product constructs a string for a command to be executed by a separate component\nin another control sphere, but it does not properly delimit the\nintended arguments, options, or switches within that command string.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/88.html"},{"id":"CWE-94","name":"Improper Control of Generation of Code ('Code Injection')","description":"The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/94.html"}],"affected":[{"vendor":"composer","product":"composer","name":"composer","label":"composer","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 1.10.22","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0, < 2.0.13","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22 | ≥ 2.0, < 2.0.13","eol":null,"hubHref":"/vendor/composer/composer"},{"vendor":"debian","product":"composer","name":"composer","label":"composer","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/composer","purlType":"deb","versions":[{"text":"< 2.0.9-2","noFixRecorded":false,"fixedIn":null},{"text":"< 1.8.4-1+deb10u1","noFixRecorded":false,"fixedIn":null},{"text":"< 1.2.2-1+deb9u1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.0.9-2 | < 1.8.4-1+deb10u1 | < 1.2.2-1+deb9u1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"composer","name":"composer","label":"composer","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/composer","purlType":"deb","versions":[{"text":"< 1.0.0~beta2-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 1.6.3-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 1.10.1-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.0.0~beta2-1ubuntu0.1~esm1 | < 1.6.3-1ubuntu0.1~esm1 | < 1.10.1-1ubuntu0.1~esm1","eol":null,"hubHref":null},{"vendor":"debian","product":"debian_linux","name":"debian linux","label":"debian_linux","ecosystem":null,"cpePart":"o","purl":null,"purlType":null,"versions":[{"text":"9.0","noFixRecorded":false,"fixedIn":null},{"text":"10.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"9.0 | 10.0","eol":{"isEol":true,"eolDate":"2022-07-01T00:00:00.000Z","matchMethod":"cpe","cycle":{"name":"9","label":"9 (Stretch)","eolFrom":"2022-07-01T00:00:00.000Z","isLts":false,"isMaintained":true,"latestVersion":"9.13"},"product":{"name":"debian","label":"Debian","category":"os"}},"hubHref":"/vendor/debian/debian_linux"},{"vendor":"fedoraproject","product":"fedora","name":"fedora","label":"fedora","ecosystem":null,"cpePart":"o","purl":null,"purlType":null,"versions":[{"text":"33","noFixRecorded":false,"fixedIn":null},{"text":"34","noFixRecorded":false,"fixedIn":null}],"versionsText":"33 | 34","eol":{"isEol":true,"eolDate":"2021-11-30T00:00:00.000Z","matchMethod":"cpe","cycle":{"name":"33","label":"33","eolFrom":"2021-11-30T00:00:00.000Z","isLts":false,"isMaintained":false,"latestVersion":null},"product":{"name":"fedora","label":"Fedora Linux","category":"os"}},"hubHref":"/vendor/fedoraproject/fedora"},{"vendor":"getcomposer","product":"composer","name":"composer","label":"composer","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 1.10.22","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0, < 2.0.13","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22 | ≥ 2.0, < 2.0.13","eol":{"isEol":null,"eolDate":null,"matchMethod":"cpe","cycle":null,"product":{"name":"composer","label":"Composer","category":"app"}},"hubHref":"/vendor/getcomposer/composer"},{"vendor":"opensuse","product":"php-composer&distro=openSUSE Leap 15.2","name":"php-composer","label":"php-composer&distro=openSUSE Leap 15.2","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/php-composer&distro=openSUSE Leap 15.2","purlType":"rpm","versions":[{"text":"< 1.10.22-bp153.2.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22-bp153.2.3.1","eol":null,"hubHref":null},{"vendor":"opensuse","product":"php-composer&distro=openSUSE Leap 15.3","name":"php-composer","label":"php-composer&distro=openSUSE Leap 15.3","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/php-composer&distro=openSUSE Leap 15.3","purlType":"rpm","versions":[{"text":"< 1.10.22-bp153.2.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22-bp153.2.3.1","eol":null,"hubHref":null},{"vendor":"opensuse","product":"php-composer&distro=openSUSE Tumbleweed","name":"php-composer","label":"php-composer&distro=openSUSE Tumbleweed","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/php-composer&distro=openSUSE Tumbleweed","purlType":"rpm","versions":[{"text":"< 1.10.22-2.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22-2.2","eol":null,"hubHref":null},{"vendor":"suse","product":"php-composer&distro=SUSE Package Hub 15 SP1","name":"php-composer","label":"php-composer&distro=SUSE Package Hub 15 SP1","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/php-composer&distro=SUSE Package Hub 15 SP1","purlType":"rpm","versions":[{"text":"< 1.10.22-bp153.2.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22-bp153.2.3.1","eol":null,"hubHref":null},{"vendor":"suse","product":"php-composer&distro=SUSE Package Hub 15 SP2","name":"php-composer","label":"php-composer&distro=SUSE Package Hub 15 SP2","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/php-composer&distro=SUSE Package Hub 15 SP2","purlType":"rpm","versions":[{"text":"< 1.10.22-bp153.2.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22-bp153.2.3.1","eol":null,"hubHref":null},{"vendor":"suse","product":"php-composer&distro=SUSE Package Hub 15 SP3","name":"php-composer","label":"php-composer&distro=SUSE Package Hub 15 SP3","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/php-composer&distro=SUSE Package Hub 15 SP3","purlType":"rpm","versions":[{"text":"< 1.10.22-bp153.2.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.10.22-bp153.2.3.1","eol":null,"hubHref":null}],"affectedCount":12,"eol":{"hasEol":true,"count":2},"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx","label":"github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx","hostname":"github.com","tags":["X Refsource CONFIRM","REPORT","Third Party Advisory"]},{"url":"https://getcomposer.org/","label":"getcomposer.org","hostname":"getcomposer.org","tags":["X Refsource MISC","REPORT","Vendor Advisory"]},{"url":"https://www.debian.org/security/2021/dsa-4907","label":"www.debian.org/security/2021/dsa-4907","hostname":"www.debian.org","tags":["Vendor Advisory","X Refsource DEBIAN","Third Party Advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00009.html","label":"lists.debian.org/debian-lts-announce/2021/05/msg00009.html","hostname":"lists.debian.org","tags":["Mailing List","X Refsource MLIST","Third Party Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory","X Refsource FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory","X Refsource FEDORA"]},{"url":"https://blog.sonarsource.com/php-supply-chain-attack-on-composer/","label":"blog.sonarsource.com/php-supply-chain-attack-on-composer/","hostname":"blog.sonarsource.com","tags":["X Refsource MISC","Exploit","Third Party Advisory"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/6ALRJGAG4EXTTIEI2CGMZH3NCUQIQUTQ/","label":"lists.opensuse.org/archives/…","hostname":"lists.opensuse.org","tags":["Advisory"]},{"url":"https://bugzilla.suse.com/1185376","label":"bugzilla.suse.com/1185376","hostname":"bugzilla.suse.com","tags":["REPORT"]},{"url":"https://bugzilla.suse.com/1187416","label":"bugzilla.suse.com/1187416","hostname":"bugzilla.suse.com","tags":["REPORT"]},{"url":"https://www.suse.com/security/cve/CVE-2021-29472","label":"www.suse.com/security/cve/CVE-2021-29472","hostname":"www.suse.com","tags":["WEB"]},{"url":"https://ubuntu.com/security/CVE-2021-29472","label":"ubuntu.com/security/CVE-2021-29472","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://github.com/composer/composer/commit/083b73515d1d72bc61c6374440b3f8a37531f8cf","label":"github.com/composer/composer/commit/083b73515d1d72bc61c6374440b3f8a37531f8cf","hostname":"github.com","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-5220-1","label":"ubuntu.com/security/notices/USN-5220-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-29472","label":"www.cve.org/CVERecord?id=CVE-2021-29472","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-29472","label":"security-tracker.debian.org/tracker/CVE-2021-29472","hostname":"security-tracker.debian.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-04-27T20:30:15.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-03T22:11:05.384Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":46,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T17:20:29.788Z","stale":false,"partial":false}}