# CVE-2026-46420: setup-php: Command Injection in Repository-Derived PHP Version Resolution

- Severity: Medium 5.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.54%, higher than 75% of CVEs (2026-12-01)
- Published: 2026-05-20T15:31:52.000Z
- Modified: 2026-10-24T20:10:00.137Z
- Also known as: GHSA-pqwm-q9pv-ph8r
- Weaknesses: CWE-78
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- shivammathur setup-php: >= 2.25.0, < 2.37.1
- shivammathur/setup-php (GitHub Actions): from 2.25.0 before 2.37.1
- shivammathur setup_php: from 2.25.0 before 2.37.1

## Every score

- GitHub_M: CVSS:3.1 5.6 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:3.1 5.6 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/shivammathur/setup-php/security/advisories/GHSA-pqwm-q9pv-ph8r> (patch, vendor-advisory, web)
- <https://github.com/shivammathur/setup-php/commit/eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b> (patch, web)
- <https://github.com/shivammathur/setup-php/releases/tag/2.37.1> (product, release-notes)
- <https://github.com/shivammathur/setup-php> (package)

## Sources

- CVE List: [CVE-2026-46420](https://www.cve.org/CVERecord?id=CVE-2026-46420), CVE Terms of Use, modified 2026-07-20
- GitHub Advisory Database: [GHSA-pqwm-q9pv-ph8r](https://github.com/advisories/GHSA-pqwm-q9pv-ph8r), CC-BY-4.0, modified 2026-05-20
- NVD: [CVE-2026-46420](https://nvd.nist.gov/vuln/detail/CVE-2026-46420), Public domain, modified 2026-10-24

---

Page: https://cve.day/CVE-2026-46420 · Whole record: https://cve.day/CVE-2026-46420.json · Rebuilt by cve.day 2026-11-25T22:59:28.528Z
