CVE-2026-46420: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in shivammathur setup-php
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.
AI Analysis
Technical Summary
The setup-php GitHub Action by shivammathur, used to configure PHP environments, improperly neutralizes special elements in inputs derived from repository files (.php-version, composer.lock, composer.json). These inputs are incorporated into generated shell or PowerShell setup scripts without sufficient constraints, leading to OS command injection on GitHub Actions runners. This vulnerability affects versions >=2.25.0 and <2.37.1 and is resolved in version 2.37.1.
Potential Impact
An attacker who can influence repository files checked out in GitHub Actions workflows (e.g., pull_request_target) may execute arbitrary OS commands on the runner environment. This can lead to limited confidentiality, integrity, and availability impacts as indicated by the CVSS vector (AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).
Mitigation Recommendations
Upgrade to version 2.37.1 or later where this vulnerability is fixed. Until then, avoid running setup-php in workflows that check out untrusted or attacker-controlled repository content, especially in pull_request_target events. Patch status is confirmed fixed in 2.37.1.
CVE-2026-46420: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in shivammathur setup-php
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.
CVSS v3.1
Score 5.6medium
Affected software
pkg:github/shivammathur/setup-phpRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The setup-php GitHub Action by shivammathur, used to configure PHP environments, improperly neutralizes special elements in inputs derived from repository files (.php-version, composer.lock, composer.json). These inputs are incorporated into generated shell or PowerShell setup scripts without sufficient constraints, leading to OS command injection on GitHub Actions runners. This vulnerability affects versions >=2.25.0 and <2.37.1 and is resolved in version 2.37.1.
Potential Impact
An attacker who can influence repository files checked out in GitHub Actions workflows (e.g., pull_request_target) may execute arbitrary OS commands on the runner environment. This can lead to limited confidentiality, integrity, and availability impacts as indicated by the CVSS vector (AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).
Mitigation Recommendations
Upgrade to version 2.37.1 or later where this vulnerability is fixed. Until then, avoid running setup-php in workflows that check out untrusted or attacker-controlled repository content, especially in pull_request_target events. Patch status is confirmed fixed in 2.37.1.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-13T22:18:22.829Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a5b5eac2d1edb114c7fb21d
Added to database: 07/18/2026, 11:08:28 UTC
Last enriched: 07/25/2026, 22:45:53 UTC
Last updated: 08/29/2026, 22:52:11 UTC
Views: 78
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.