Skip to main content

setup-php EUVDEUVD-2026-45303

| CVE-2026-46420 CRITICAL
OS Command Injection (CWE-78)
2026-05-20 https://github.com/shivammathur/setup-php GHSA-pqwm-q9pv-ph8r
9.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Open malicious pull request
  2. Delivery
    Plant crafted .php-version/composer manifest
  3. Exploit
    Privileged workflow checks out PR code
  4. Execution
    setup-php resolves version into setup script
  5. Persist
    Injected commands execute on runner
  6. Impact
    Exfiltrate secrets / GITHUB_TOKEN

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires (1) a workflow that runs setup-php in a trusted/privileged context - most notably pull_request_target, or any job operating on attacker-controlled refs/branches with access to secrets - AND (2) that job checking out attacker-controlled repository contents before setup-php runs, AND (3) setup-php resolving the PHP version from a repository-controlled file (.php-version, composer.lock via platform-overrides.php, or composer.json via config.platform.php) rather than from an explicit php-version input. Limiting factors: the attack is neutralized if the action version is 2.37.1+/@v2, if php-version is set explicitly in the workflow, or if untrusted code is only handled in unprivileged pull_request jobs without secrets. It is not a distinct security boundary where the attacker can already edit the workflow file or directly control the php-version input, since that already grants arbitrary execution.

Impact

The nominal CVSS 9.8 (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H) overstates unconditional risk: real exploitation depends on a specific and non-default-dangerous workflow pattern - running setup-php in a trusted context (e.g. pull_request_target) after checking out attacker-controlled content and letting it resolve the PHP version from repo files. Where that pattern exists, an attacker needs no privileges beyond opening a pull request, which is why network/unauthenticated framing is fair, but the required vulnerable configuration raises real-world attack complexity. Corroborating signals are mixed but coherent: EPSS is only 1.58% (82nd percentile), there is no CISA KEV listing and no identified public exploit, yet the outcome (runner RCE with repo secrets/token exposure) is severe. Any team running pull_request_target-style workflows with setup-php should treat this as urgent regardless of organization size, while teams pinned to the @v2 floating tag are already remediated. Note the tension to verify: CVSS says AC:L/PR:N, but the description implies a non-default trusted-context configuration is required - assess against your actual workflow triggers rather than the raw score.

Exploit ScenarioDerived

An attacker opens a pull request against a repository whose CI uses a pull_request_target workflow that checks out the PR head and then runs setup-php with repository-derived version resolution. The attacker's PR includes a crafted .php-version (or composer.json/composer.lock platform value) containing shell metacharacters; when setup-php builds and runs its setup script, the injected commands execute on the runner with the workflow's token and secrets. No public exploit is identified at time of analysis, and CVSS AC:L implies the injection itself is straightforward once the vulnerable workflow pattern is present.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 1.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Aug 18, 2026

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.

Earlier versions of this analysis (1)
v1 May 20, 2026 - 16:32 CVSS 5.6

Command injection in shivammathur/setup-php (versions 2.25.0 through 2.37.0) allows an attacker who can influence repository files to execute arbitrary commands on a GitHub Actions runner when the action resolves the PHP version from attacker-controlled content. The risk is highest in privileged workflows using pull_request_target that check out untrusted PR code before invoking setup-php, potentially exposing repository secrets and CI/CD infrastructure. No public exploit code or KEV listing exists at time of analysis, but the attack is realistic in any project using this common CI action pattern with auto-merging or cross-repo workflows.

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.

Affected VersionsENISA

setup-php 2.25.0, < 2.37.1

Affected Packages

euvd setup_php_2_25_0 fix: 2.37.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.1 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Analysis Updated
Aug 18, 2026 - 16:13 vuln.today
v2 - CVSS changed
Severity Changed
Aug 18, 2026 - 16:07 NVD
MEDIUM CRITICAL
CVSS changed
Aug 18, 2026 - 16:07 NVD
5.6 (MEDIUM) 9.8 (CRITICAL)

DescriptionNVD

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-version
  • composer.lock via platform-overrides.php
  • composer.json via config.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.

Executive ViewAI

Why It Matters

The PHP setup tool (shivammathur/setup-php) used in GitHub Actions CI/CD pipelines contains a critical vulnerability allowing attackers to inject and execute arbitrary code through pull requests. Any organization using versions 2.25.0-2.37.0 risks unauthorized code execution in their build infrastructure, with potential for stealing credentials, modifying application code, or launching supply-chain attacks.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
1.6%
Top 18% exploitable
Prevalence
High
one of the most widely used PHP CI GitHub Actions
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 1.6%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

51
Low Medium High Critical
KEV: 0
EPSS: +2
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

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

CVE-2012-1823 CRITICAL POC
9.8 May 11

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

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

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

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

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

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy