Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attacker needs only to submit a PR (PR:N/UI:N), but exploitation depends on a specific non-default trusted-context workflow that resolves repo-derived versions, so AC:H; runner RCE gives full C/I/A.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
6DescriptionNVD
Summary
A command injection vulnerability was identified in shivammathur/setup-php when the action resolves the PHP version from repository-controlled files and uses that value while generating the platform setup script.
In affected versions, setup-php may read the PHP version from:
.php-versioncomposer.lockviaplatform-overrides.phpcomposer.jsonviaconfig.platform.php
If an attacker can influence one of these files and the workflow executes setup-php in a trusted context, they may be able to execute commands on the GitHub Actions runner.
Impact
This issue is exploitable when setup-php is run after checking out attacker-controlled repository contents and resolves the PHP version from repository files.
The most significant example is a privileged workflow such as pull_request_target that checks out untrusted pull request code before invoking setup-php. Similar risk can also arise in other workflows that operate on attacker-controlled refs, branches, or repository contents in a trusted context.
This is not a separate security boundary when an attacker can already modify the workflow definition itself or directly control the php-version workflow input, since that level of access already permits arbitrary command execution in GitHub Actions.
Technical details
In affected versions, repository-derived PHP version values were insufficiently constrained before being incorporated into the generated shell or PowerShell setup script executed by the action. This could allow attacker-controlled values from supported repository files to influence script execution in trusted workflow contexts.
Remediation
If you are using shivammathur/setup-php@v2, no action is needed on your end. Users who pin the setup-php release version or release version SHA should upgrade to a patched version.
The fix validates PHP version inputs, constrains manifest-derived versions, hardens script generation at the execution, and includes additional checks in related input-handling paths.
AnalysisAI
Command injection in shivammathur/setup-php (versions >= 2.25.0 and < 2.37.1) lets an attacker who controls repository files (.php-version, composer.lock platform-overrides.php, or composer.json config.platform.php) inject shell/PowerShell commands into the generated setup script, achieving code execution on the GitHub Actions runner. The classic trigger is a pull_request_target workflow that checks out untrusted PR code before running setup-php. No public exploit identified at time of analysis; EPSS is 1.58% (82nd percentile), and a vendor patch exists in 2.37.1.
Technical ContextAI
shivammathur/setup-php is a JavaScript/TypeScript GitHub Action that provisions a PHP toolchain in CI. It can resolve the desired PHP version from repository-controlled manifest files rather than only the workflow input. That resolved value is interpolated into a dynamically generated shell (Linux/macOS) or PowerShell (Windows) script that the action then executes. Because the version string was insufficiently constrained before interpolation, it becomes a classic CWE-78 OS Command Injection sink: manifest-derived text crosses from data into an executed command context. The affected package identifier is pkg:actions/shivammathur_setup-php.
RemediationAI
Vendor-released patch: upgrade to setup-php 2.37.1 (release: https://github.com/shivammathur/setup-php/releases/tag/2.37.1; fix commit eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b), which validates PHP version inputs, constrains manifest-derived versions, and hardens script generation. If you pin a SHA, repin to the 2.37.1 commit; if you pin a release tag, bump it; switching to the @v2 floating tag also resolves the issue. Until you can upgrade, the highest-value compensating control is to stop resolving untrusted content in privileged contexts: avoid pull_request_target (or other trusted-ref) workflows that check out PR code before invoking setup-php, or set the php-version explicitly in the workflow so the action does not read it from .php-version/composer.lock/composer.json (trade-off: you lose per-repo version auto-detection). Alternatively, split the workflow so untrusted checkout and build run in an unprivileged pull_request job without repository secrets. Advisory reference: GHSA-pqwm-q9pv-ph8r.
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
Same weakness CWE-78 – OS Command Injection
View allSame technique Command Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-45303
GHSA-pqwm-q9pv-ph8r