setup-php: Command Injection in Repository-Derived PHP Version Resolution
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-78.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| shivammathur | setup-php | 2.25.0 to before 2.37.1 | 2.37.1 | Patch available | CNA |
| — | shivammathur/setup-php (GitHub Actions) | 2.25.0 to before 2.37.1 | 2.37.1 | Patch available | GHSA-pqwm-q9pv-ph8r |
- setup-php Vendorshivammathur Affected 2.25.0 to before 2.37.1 Fixed in 2.37.1 Patch available CNA
- shivammathur/setup-php (GitHub Actions) Vendor— Affected 2.25.0 to before 2.37.1 Fixed in 2.37.1 Patch available GHSA-pqwm-q9pv-ph8r
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:shivammathur:setup_php:*:*:*:*:*:*:*:* | 2.25.0 to before 2.37.1 | Vulnerable | shivammathur |
- cpe:2.3:a:shivammathur:setup_php:*:*:*:*:*:*:*:* Versions 2.25.0 to before 2.37.1 Vulnerable ·shivammathur
Remediation
- Fix · CNA setup-php (shivammathur) Fixed in 2.37.1
- Fix · GHSA-pqwm-q9pv-ph8r shivammathur/setup-php (GitHub Actions) Fixed in 2.37.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-46420
- 2026-10-03 Alias added: GHSA-pqwm-q9pv-ph8r
References
Sources
- CVE-2026-46420 · CVE Program
- CVE-2026-46420 · NVD
- FIRST EPSS
- GHSA-pqwm-q9pv-ph8r · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences