Shivammathur setup-php
setup-php: Command Injection in Repository-Derived PHP Version Resolution
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 2.25.0, < 2.37.1
Fixed in 2.37.1
Mitigation
Upgrade setup-php to 2.37.1 or later.
References
- Vendor advisory github.com/shivammathur/setup-php/security/adv…
- Patch github.com/shivammathur/setup-php/commit/eeef3…
- Release notes github.com/shivammathur/setup-php/releases/tag…
Timeline
Days relative to CVE publicationFirst public PoC 1.1 days after publication; not in CISA KEV. First PoC: Jvr2022/CVE-2026-46420 (created 18 Jul 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| Jvr2022/CVE-2026-46420 | 18 Jul 2026 +1.1 d | 1 | PoC
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.