{"schemaVersion":3,"id":"CVE-2026-40176","aliases":["UBUNTU-CVE-2026-40176","DEBIAN-CVE-2026-40176","CGA-6w8f-9cjg-7cxw","CGA-p84m-qq88-p2q7"],"status":"published","duplicateOf":null,"title":null,"description":"Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::generateP4Command() method, which constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker can inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository, leading to command execution in the context of the user running Composer, even if Perforce is not installed. VCS repositories are only loaded from the root composer.json or the composer config directory, so this cannot be exploited through composer.json files of packages installed as dependencies. Users are at risk if they run Composer commands on untrusted projects with attacker-supplied composer.json files. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline).","dates":{"published":"2026-04-15T20:47:39.839Z","modified":"2026-07-15T01:01:19.144Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":4.6,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":4.6,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Wolfi","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":4.6,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Chainguard","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":4.6,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00998,"percentile":0.62179,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":-0.06700000000000005,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.01065},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00998,"percentile":0.62179}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01065,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00998,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00998,"percentile":0.62179}]},"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":[],"exploitCount":0,"weaknesses":[{"id":"CWE-20","name":"Improper Input Validation","description":"The product receives input or data, but it does\n        not validate or incorrectly validates that the input has the\n        properties that are required to process the data safely and\n        correctly.","type":"weakness","status":"Stable","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/20.html"},{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')","description":"The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/78.html"}],"affected":[{"vendor":"chainguard","product":"composer","name":"composer","label":"composer","ecosystem":"Chainguard","cpePart":null,"purl":"pkg:apk/chainguard/composer","purlType":"apk","versions":[{"text":"< 2.9.7-r0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.9.7-r0","eol":null,"hubHref":null},{"vendor":"wolfi","product":"composer","name":"composer","label":"composer","ecosystem":"Wolfi","cpePart":null,"purl":"pkg:apk/wolfi/composer","purlType":"apk","versions":[{"text":"< 2.9.7-r0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.9.7-r0","eol":null,"hubHref":null},{"vendor":"composer","product":"composer","name":"composer","label":"composer","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 2.3, < 2.9.6","noFixRecorded":false,"fixedIn":null},{"text":"≥ 1.0, < 2.2.27","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.3, < 2.9.6 | ≥ 1.0, < 2.2.27","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.5.5-1+deb12u4","noFixRecorded":false,"fixedIn":null},{"text":"< 2.8.8-1+deb13u2","noFixRecorded":false,"fixedIn":null},{"text":"< 2.9.7-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.5.5-1+deb12u4 | < 2.8.8-1+deb13u2 | < 2.9.7-1","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":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"getcomposer","product":"composer","name":"composer","label":"composer","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 1.0.0, ≤ 2.2.26","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.3.0, ≤ 2.9.5","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 1.0.0, ≤ 2.2.26 | ≥ 2.3.0, ≤ 2.9.5","eol":{"isEol":null,"eolDate":null,"matchMethod":"cpe","cycle":null,"product":{"name":"composer","label":"Composer","category":"app"}},"hubHref":"/vendor/getcomposer/composer"}],"affectedCount":6,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p","label":"github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p","hostname":"github.com","tags":["X Refsource CONFIRM","REPORT","Advisory","Vendor Advisory"]},{"url":"https://github.com/composer/composer/releases/tag/2.9.6","label":"github.com/composer/composer/releases/tag/2.9.6","hostname":"github.com","tags":["X Refsource MISC","WEB","Release Notes"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-40176","label":"access.redhat.com/security/cve/CVE-2026-40176","hostname":"access.redhat.com","tags":["VDB Entry","X Refsource REDHAT","Advisory"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2458828","label":"bugzilla.redhat.com/show_bug.cgi?id=2458828","hostname":"bugzilla.redhat.com","tags":["Issue Tracking","X Refsource REDHAT","REPORT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.json","label":"security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.json","hostname":"security.access.redhat.com","tags":["X Sadp Csaf Vex","WEB"]},{"url":"https://access.redhat.com/errata/RHSA-2026:8165","label":"access.redhat.com/errata/RHSA-2026:8165","hostname":"access.redhat.com","tags":["Vendor Advisory","X Refsource REDHAT","Advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-40176","label":"ubuntu.com/security/CVE-2026-40176","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-40176","label":"www.cve.org/CVERecord?id=CVE-2026-40176","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-40176","label":"security-tracker.debian.org/tracker/CVE-2026-40176","hostname":"security-tracker.debian.org","tags":["Advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40176.json","label":"github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40176.json","hostname":"github.com","tags":["Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40176","label":"nvd.nist.gov/vuln/detail/CVE-2026-40176","hostname":"nvd.nist.gov","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":["OPENSUSE-SU-2026:10643-1","OPENSUSE-SU-2026:21520-1","RHSA-2026:8165","SUSE-SU-2026:23116-1","SUSE-SU-2026:23138-1","SUSE-SU-2026:3105-1"],"duplicates":[],"related":["CGA-XM9J-PQ83-P8JQ","OPENSUSE-SU-2026:10643-1","OPENSUSE-SU-2026:21520-1","SUSE-SU-2026:23116-1","SUSE-SU-2026:23138-1","SUSE-SU-2026:3105-1"]},"timeline":[{"kind":"published","date":"2026-04-15T20:47:39.839Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-07-15T01:01:19.144Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":31,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T16:50:46.835Z","stale":false,"partial":false}}