# shivammathur setup-php GitHub token disclosure via pinned Composer versions

Source: https://junglewise.ai/threats/shivammathur-setup-php-github-token-disclosure-via-pinned-composer-87f215a6  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-20. Updated: 2026-05-20  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 5.9 · Published 2026-05-20

A vulnerability in the setup-php GitHub Action can lead to the exposure of sensitive GitHub authentication tokens in public build logs. This occurs when specific older versions of the Composer package manager are used, which fail to handle newer GitHub token formats correctly and print the raw token in error messages. If these logs are public, an attacker could steal the token to access private repositories or perform actions on behalf of the user or application until the token expires.

Vendors: [GitHub Actions](https://junglewise.ai/threats/vendors/actions).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Medium severity, with a CVSS score of 5.9, published 20 May 2026.

**Which products and versions are affected?** shivammathur/setup-php (GitHub Actions) < 2.37.1.

**Is there a fix for This vulnerability?** A patch was published on 2026-05-13: Fix committed to shivammathur/setup-php repository Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run shivammathur/setup-php (GitHub Actions) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The setup-php GitHub Action is vulnerable to sensitive information disclosure (CWE-532) when configured to use specific pinned versions of Composer (e.g., 2.9.7). The root cause is an underlying issue in Composer where newer GitHub token formats containing hyphens fail a regex validation check. When validation fails, Composer throws an UnexpectedValueException that interpolates the raw token into the error message, which is then printed to stderr and captured in GitHub Action logs. While GitHub-hosted runner tokens are short-lived, longer-lived GitHub App or user tokens may also be exposed. The vulnerability is mitigated in setup-php 2.37.1 by skipping GitHub OAuth configuration for known-affected Composer versions.

## Affected products

- shivammathur shivammathur/setup-php < 2.37.1

## Timeline

- 2026-05-13: patched: Fix committed to shivammathur/setup-php repository
- 2026-05-14: disclosed: Initial advisory publication
- 2026-05-20: advisory: Advisory reviewed and updated in GitHub Database

## References

- [https://github.com/composer/composer/security/advisories/GHSA-f9f8-rm49-7jv2](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/security/advisories/GHSA-5wxr-w449-57cm)
- [https://github.com/shivammathur/setup-php/commit/7748c243803a56671412f9f7c745769e9573c6d4](https://github.com/shivammathur/setup-php/commit/7748c243803a56671412f9f7c745769e9573c6d4)
- [https://api.github.com/repos/shivammathur/setup-php/security-advisories/GHSA-5wxr-w449-57cm](https://api.github.com/repos/shivammathur/setup-php/security-advisories/GHSA-5wxr-w449-57cm)

## Related threats

- [shivammathur setup-php command injection in PHP version resolution](https://junglewise.ai/threats/cve-2026-46420-shivammathur-setup-php-command-injection-in-php-version)
