also looking at this
chore(deps): update shivammathur/setup-php action to v2.37.1 [security]
#73This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| shivammathur/setup-php | action | minor | 2.36.0 → 2.37.1 |
Setup PHP: Command Injection in Repository-Derived PHP Version Resolution
CVE-2026-46420 / GHSA-pqwm-q9pv-ph8r
More information
Details
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.
Severity
- CVSS Score: 5.6 / 10 (Medium)
- Vector String:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
References
- https://github.com/shivammathur/setup-php/security/advisories/GHSA-pqwm-q9pv-ph8r
- https://github.com/shivammathur/setup-php/commit/eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b
- https://github.com/advisories/GHSA-pqwm-q9pv-ph8r
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Setup PHP: GitHub tokens configured by setup-php may be exposed through pinned affected Composer versions
More information
Details
Impact
This affects only workflows that pin an exact affected Composer semver version through setup-php, for example tools: composer:2.9.7.
Workflows using the default Composer version, composer:v2, or no pinned Composer version are not affected through setup-php, because those Composer URLs have been updated to patched Composer releases for all setup-php versions.
setup-php does not directly print the token. The token may be exposed through Composer when Composer validates github-oauth auth and rejects GitHub's newer hyphen-containing token format.
Public repository logs may expose the token. GitHub-hosted runner GITHUB_TOKEN values expire after the job, but exposure may still matter during the token lifetime and for longer-lived GitHub App or user tokens.
Patches
setup-php 2.37.1 skips generated GitHub OAuth auth for pinned Composer versions affected by Composer GHSA-f9f8-rm49-7jv2 while preserving other Composer auth, including Packagist auth.
Workarounds
Upgrade to setup-php 2.37.1 or newer. You can also avoid the affected path by using a patched Composer version: 2.9.8, 2.2.28, 1.10.28, or newer supported Composer releases.
It is recommended to avoid pinning affected Composer versions such as composer:2.9.7, unless you have automations to do timely updates in your workflows.
Severity
- CVSS Score: 5.9 / 10 (Medium)
- Vector String:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
References
- https://github.com/composer/composer/security/advisories/GHSA-f9f8-rm49-7jv2
- https://github.com/shivammathur/setup-php/security/advisories/GHSA-5wxr-w449-57cm
- https://github.com/shivammathur/setup-php/commit/7748c243803a56671412f9f7c745769e9573c6d4
- https://github.com/advisories/GHSA-5wxr-w449-57cm
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
shivammathur/setup-php (shivammathur/setup-php)
v2.37.1
Changelog
Security Updates
- Fixed shell command escaping and PHP version input validation. (GHSA-pqwm-q9pv-ph8r / CVE-2026-46420)
[!NOTE] This can affect workflows that pass values from users or pull requests to
setup-php, for example from comments, dispatch inputs, PR titles/branches, generated matrices, or files such as.php-versionandcomposer.json. Be especially careful withpull_request_targetworkflows that use any value from the pull request. Workflows that only use fixed trusted values are not expected to be affected, but updating to2.37.1is recommended.
- Fixed GitHub auth handling for Composer versions affected by GHSA-f9f8-rm49-7jv2. It should now skip configuring GitHub OAuth if affected Composer versions are installed and show a warning to upgrade. (GHSA-5wxr-w449-57cm / CVE-2026-45793)
[!NOTE] This only affects workflows where the composer version is pinned like
composer:2.9.7, workflows that do not pin the version or usecomposer:v2are not affected as those get automatic updates. In case you pin the version, it is highly recommended to upgrade and have automation to do such timely upgrades in your workflows.
Fixes and Improvements
Fixed support for
phalconon Windows.Fixed restoring tools when using cached using previous runs.
Improved enabling
gearmanextension on Linux.Fixed fallback when installing
PhpManagerandVcRedistmodules on Windows.Fixed parsing extension inputs with backslash line continuation.
Improved workflow examples
- Added workflow examples for Drupal 11 composer-managed projects and WordPress plugins.
- Added workflow examples for Yii3 web applications and replaced Yii2 Starter Kit examples.
- Updated workflow examples to use currently supported PHP versions.
Updated OS release mappings for newer Ubuntu releases.
Updated internal workflows for Codecov v6 and NPM trusted publishing.
Updated Node.js dependencies.
Fixed composer version in README. (#1081)
Thanks @Pyker for the contribution
For the complete list of changes, please refer to the Full Changelog
v2.37.0
Changelog
Updated the action to use Node.js 24. (#1049)
Added support for
masterin thephp-versioninput. It should now set up a nightly build from the master branch ofphp-src.Added support to install
ioncubeandzephir_parserextensions on PHP 8.5.Expanded support for installing extensions using Homebrew on macOS from the
shivammathur/homebrew-extensionstap. This includespdo_firebird,sqlsrv,pdo_sqlsrv,pecl_http,swow,xhprof, and several other supported extensions.Improved switching PHP versions on Linux. Missing alternatives should now be registered automatically before switching versions. #1067
Improved support for Homebrew on macOS. It should now retry stuck
brewcommands with an inactivity watchdog.Improved support for adding tools. It should now correctly use the latest release download URL when a version is not specified. (#1064)
Improved tool setup and caching on self-hosted runners.
Improved support for
sqlsrvandpdo_sqlsrvon PHP 8.1 and 8.2.Fixed installing
pecl_httpon Windows. Switched todownloads.php.netfor fixingICUversion post install.Fixed cached
couchbaseinstalls on macOS using theshivammathur/cache-extensionsaction.Replaced
@actions/corewith local functions to reduce bundle size.Refactored to use ES2024+ features for Node 24.
Updated actions used in examples to their latest versions.
Updated Node.js dependencies.
Thanks @theluckystrike for the contribution 🎉
Thanks @code-kudu, @ssddanbrown, @RoundingWell, and @ntzrbtr for the sponsorship ❤️
For the complete list of changes, please refer to the Full Changelog
Configuration
📅 Schedule: (UTC)
- Branch creation
- ""
- Automerge
- At any time (no schedule defined)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
1 changed file on the files tab, with 0 review threads.