{
  "threat_severity" : "Important",
  "public_date" : "2026-04-15T20:47:39Z",
  "bugzilla" : {
    "description" : "composer: command injection via malicious Perforce repository definition",
    "id" : "2458828",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2458828"
  },
  "cvss3" : {
    "cvss3_base_score" : "7.8",
    "cvss3_scoring_vector" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
    "status" : "verified"
  },
  "cwe" : "CWE-78",
  "details" : [ "A flaw was found in Composer. `Perforce::generateP4Command()` constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping, allowing an attacker to inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository." ],
  "statement" : "To exploit this vulnerability, a user needs to run Composer commands on untrusted projects with attacker-supplied composer.json files. VCS repositories are only loaded from the root composer.json or the composer config directory, so this issue cannot be exploited through composer.json files of packages installed as dependencies. This issue can cause arbitrary command execution but it is limited to the context of the user running Composer. Due to these reasons, this flaw has been rated with an important severity.",
  "affected_release" : [ {
    "product_name" : "Red Hat Hardened Images",
    "release_date" : "2026-04-14T00:00:00Z",
    "advisory" : "RHSA-2026:8165",
    "cpe" : "cpe:/a:redhat:hummingbird:1",
    "package" : "composer-main-2.9.7-1.hum1"
  } ],
  "references" : [ "https://www.cve.org/CVERecord?id=CVE-2026-40176\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-40176\nhttps://github.com/composer/composer/releases/tag/2.9.6\nhttps://github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p" ],
  "name" : "CVE-2026-40176",
  "mitigation" : {
    "value" : "To mitigate this vulnerability, only run Composer commands on projects from trusted sources. Also, inspect composer.json files before running Composer commands on them, specifically checking that Perforce-related fields contain valid values.",
    "lang" : "en:us"
  },
  "csaw" : false
}