Junglewise Threat Intelligence

shivammathur setup-php GitHub token disclosure via pinned Composer versions

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

Vendors: GitHub Actions.

Executive brief

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.

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

Related threats