{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "cpe": "cpe:2.3:a:shivammathur:setup_php:*:*:*:*:*:*:*:*",
            "extracted_events": [
              {
                "introduced": "2.25.0"
              },
              {
                "fixed": "2.37.1"
              }
            ],
            "source": [
              "CPE_RANGE",
              "REFERENCES"
            ]
          },
          "events": [
            {
              "introduced": "1fdc5e773bb54b5aa541c73679d6e9acc692d0cd"
            },
            {
              "fixed": "7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc"
            },
            {
              "fixed": "eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b"
            }
          ],
          "repo": "https://github.com/shivammathur/setup-php",
          "type": "GIT"
        }
      ]
    }
  ],
  "aliases": [
    "GHSA-pqwm-q9pv-ph8r"
  ],
  "database_specific": {
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
      "CWE-78"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46420.json"
  },
  "details": "setup-php is a GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and tools. From 2.25.0 prior to 2.37.1, shivammathur/setup-php resolves the PHP version from repository-controlled files such as .php-version, composer.lock through platform-overrides.php, and composer.json through config.platform.php, and insufficiently constrains those values before incorporating them into generated shell or PowerShell setup scripts, allowing command injection on a GitHub Actions runner when workflows such as pull_request_target check out attacker-controlled contents before invoking setup-php. This issue is fixed in version 2.37.1.",
  "id": "CVE-2026-46420",
  "modified": "2026-08-20T03:30:12.553081513Z",
  "published": "2026-07-17T19:51:10.253Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/shivammathur/setup-php/releases/tag/2.37.1"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46420.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/shivammathur/setup-php/security/advisories/GHSA-pqwm-q9pv-ph8r"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-46420"
    },
    {
      "type": "FIX",
      "url": "https://github.com/shivammathur/setup-php/commit/eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b"
    }
  ],
  "schema_version": "1.9.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "setup-php: Command Injection in Repository-Derived PHP Version Resolution"
}