GHSA-5wxr-w449-57cm: Setup PHP GitHub Tokens Configured By Setup-php Vulnerability

MODERATE
CVSS 5.9
CWE-532
Published
Advisory Summary

GHSA-5wxr-w449-57cm is a MODERATE (CVSS 5.9) github tokens configured by setup-php vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Setup PHP libraries in the GitHub Actions ecosystem. The issue involves github tokens configured by setup-php may be exposed through pinned affected composer versions. Remediation is available by upgrading affected packages to version 2.37.1.

GHSA-5wxr-w449-57cm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5wxr-w449-57cm
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Setup PHP
Package Ecosystem GitHub Actions
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-5wxr-w449-57cm

To remediate this vulnerability, upgrade all affected Setup PHP dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

shivammathur/setup-php fixed: 2.37.1
Upgrade shivammathur/setup-php to 2.37.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for shivammathur/setup-php

How to Check if You Are Affected

To determine whether your application is affected by GHSA-5wxr-w449-57cm, inspect your project dependencies for Setup PHP:

inspect dependencies for shivammathur/setup-php

Analyze the terminal output to locate any version of Setup PHP in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.37.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Setup PHP, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

GHSA-5wxr-w449-57cm Affected Setup PHP Versions

1 component(s)
Fixed Versions:
2.37.1
Product / Package Ecosystem Affected Versions Fixed Version
shivammathur/setup-php
GitHub Actions
< 2.37.1
2.37.1

References

Frequently Asked Questions

What is GHSA-5wxr-w449-57cm?
GHSA-5wxr-w449-57cm is a security vulnerability in Setup PHP involving GitHub tokens configured by setup-php may be exposed through pinned affected Composer versions under CWE-532: Insertion of Sensitive Information into Log File.
Which Setup PHP versions are affected?
Affected versions include releases prior to 2.37.1 across affected packages: shivammathur/setup-php.
What version fixes GHSA-5wxr-w449-57cm?
Upgrading to 2.37.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is shivammathur/setup-php affected?
Yes, shivammathur/setup-php is affected in releases prior to 2.37.1. Upgrade your dependency to 2.37.1 or later.
What is the CVSS score of GHSA-5wxr-w449-57cm?
GHSA-5wxr-w449-57cm has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-5wxr-w449-57cm?
GHSA-5wxr-w449-57cm is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check GitHub Actions dependencies for GHSA-5wxr-w449-57cm?
Run the dependency tree command: 'inspect dependencies for shivammathur/setup-php'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5wxr-w449-57cm",
  "modified" : "2026-05-20T15:32:31Z",
  "published" : "2026-05-20T15:32:31Z",
  "aliases" : [ ],
  "summary" : "Setup PHP: GitHub tokens configured by setup-php may be exposed through pinned affected Composer versions",
  "details" : "### Impact\nThis affects only workflows that pin an exact affected Composer semver version through setup-php, for example `tools: composer:2.9.7`.\n\nWorkflows 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.\n\nsetup-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.\n\nPublic 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.\n\n### Patches\nsetup-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.\n\n### Workarounds\nUpgrade 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.\n\nIt 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" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "GitHub Actions",
      "name" : "shivammathur/setup-php"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.37.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/composer/composer/security/advisories/GHSA-f9f8-rm49-7jv2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/shivammathur/setup-php/security/advisories/GHSA-5wxr-w449-57cm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/shivammathur/setup-php/commit/7748c243803a56671412f9f7c745769e9573c6d4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/shivammathur/setup-php"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-20T15:32:31Z",
    "nvd_published_at" : null
  }
}