{"id":"CVE-2026-46420","published":"2026-07-17T19:51:10Z","modified":"2026-07-20T18:15:56Z","title":"setup-php: Command Injection in Repository-Derived PHP Version Resolution","vendor":"shivammathur","product":"setup-php","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.6,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0201,"percentile":0.81347,"provenance":"source"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"references":[{"url":"https://github.com/shivammathur/setup-php/security/advisories/GHSA-pqwm-q9pv-ph8r","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/shivammathur/setup-php/commit/eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b","tags":["x_refsource_MISC"]},{"url":"https://github.com/shivammathur/setup-php/releases/tag/2.37.1","tags":["x_refsource_MISC"]}],"priority":{"score":25.2,"factors":[{"name":"EPSS percentile","points":16.27},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":3.92}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-07-18","earliestUrl":"https://github.com/Jvr2022/CVE-2026-46420","repos":[{"name":"Jvr2022/CVE-2026-46420","url":"https://github.com/Jvr2022/CVE-2026-46420","stars":1,"created":"2026-07-18"}]},"first":{"date":"2026-07-18","source":"PoC-in-GitHub","url":"https://github.com/Jvr2022/CVE-2026-46420"},"provenance":"source"},"vendorSlug":"shivammathur","affectedVersions":[{"vendor":"shivammathur","product":"setup-php","versions":[">= 2.25.0, < 2.37.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-20T18:09:22.675511Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"GitHub Actions","package":"shivammathur/setup-php","vulnerableRanges":[">=2.25.0, <2.37.1"],"patched":["2.37.1"],"from":["GHSA-pqwm-q9pv-ph8r"],"provenance":"source"}],"summary":{"text":"setup-php, a GitHub Action for configuring PHP environments, contains an improper neutralization flaw in how it resolves the PHP version from repository-controlled files (such as .php-version, composer.lock, and composer.json), allowing those values to be injected into generated shell or PowerShell setup scripts. An attacker who can supply repository contents can achieve command injection on a GitHub Actions runner when a workflow such as pull_request_target checks out attacker-controlled content before invoking setup-php, affecting versions from 2.25.0 up to but not including 2.37.1.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T07:24:30Z"},"euvd":{"id":"EUVD-2026-45303","exploited":false,"provenance":"source"}}