/

CVE-2026-45793

Severity:

HIGH RISK

(7.5)

Information Exposure (CWE-200) in PHP Composer IO

CVE-2026-45793

Awaiting Analysis

Vulnerability type

Category:

Information Exposure

CWE:

CWE-200

Impact:

Credential / Secret Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Composer's BaseIO::loadConfiguration() mishandles invalid GitHub OAuth tokens by echoing them back in exception messages, which can surface in stderr or CI logs.

When GitHub Actions GITHUB_TOKEN values include characters that fail the simplistic regex validation, the full secret may be unintentionally disclosed in build output.

Affected context

This vulnerability occurs in environments where Composer is used with GitHub OAuth tokens, particularly within CI/CD pipelines such as GitHub Actions.

It is relevant when Composer's configuration loading runs with tokens that do not match the expected token pattern and when stderr or logs are collected, stored, or shared.

The risk is higher in automated workflows where logs are exposed to multiple systems or users.

Exploit preconditions

  • Attack surface: CI/CD build logs, console output, and any system aggregating Composer stderr.
  • Required access: Ability to read pipeline logs or process output, either via CI permissions or downstream log aggregation tools.
  • Trigger point: ComposerIO::BaseIO::loadConfiguration() rejecting a GitHub token that does not match the regex ^[.A-Za-z0-9_]+$, such as ghs_<id>_<base64url-JWT> containing -.
  • Why exploitation is possible: Rejected token values are interpolated directly into UnexpectedValueException messages without redaction, causing sensitive secrets to be printed to stderr and persisted in logs.

Why this happens

The core issue is an information exposure pattern where sensitive data is reflected verbatim in error messages and logging channels.

Composer's validation logic uses a narrow regex that rejects some legitimate GitHub tokens, then embeds the raw token into the resulting exception string.

This maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, as secrets that should remain confined to the runtime environment are written to observable logs and error streams.

Potential impact

  • GitHub Actions GITHUB_TOKEN values may be exposed in CI pipeline logs.
  • Attackers with log access could reuse leaked tokens to access repositories or workflows.
  • Compromise of build integrity through unauthorized changes to dependencies or code.
  • Broader account or organization impact if leaked tokens have elevated scopes.

General mitigation guidance

Effective mitigation focuses on minimizing the chance that secrets are ever rendered in logs and on reducing the value of any exposed data.

Common defensive patterns include:

  • Designing validation routines so that they never echo back secrets or full credential strings in exceptions or diagnostics.
  • Implementing centralized secret-handling utilities that automatically mask or redact sensitive values before logging.
  • Applying least-privilege scopes to access tokens so that inadvertent exposure has limited impact.
  • Configuring CI/CD systems to treat tokens as secrets by default, with log scrubbing and restricted log access policies.

How teams detect issues like this

Organizations can detect similar information exposure risks by:

  • Scanning application and pipeline logs for patterns that resemble tokens, keys, or other credentials.
  • Using static analysis or security linters to flag code paths where user-supplied or configuration-derived secrets are incorporated into error messages.
  • Incorporating targeted code review checks around logging, exception handling, and secret management routines.
  • Applying policy-based controls in CI/CD platforms to automatically detect and redact known secret formats from output.

Sources

SourceLink
github.comgithub.com/composer/composer/commit/3f5e7f9fbfa541137d6d1d5643ec3b718e9d5039
github.comgithub.com/composer/composer/commit/65e6390c49f1a11cd8b660d81822086db51fe2d1
github.comgithub.com/composer/composer/commit/e66c8fdb7ff5409bd2f358c5f194038e49e93714
github.comgithub.com/composer/composer/pull/12853
github.comgithub.com/composer/composer/pull/12855
github.comgithub.com/composer/composer/releases/tag/1.10.28
github.comgithub.com/composer/composer/releases/tag/2.2.28
github.comgithub.com/composer/composer/releases/tag/2.9.8
github.comgithub.com/composer/composer/security/advisories/GHSA-f9f8-rm49-7jv2

Frequently asked

questions

No. The issue is about leaking secret tokens through logs, not executing arbitrary code. Exploitation involves using exposed tokens to gain unauthorized access.

An attacker must be able to view Composer stderr or CI/CD pipeline logs where the exception messages are recorded. This often means CI viewer or log system access.

Ensure that validation and error reporting routines never include full secret values in their messages. Use masking/redaction utilities and treat all secrets as non-loggable data.

Establish secure logging guidelines, centralize secret management, enforce code review checks for logging of sensitive data, and deploy automated scanners that detect credential-like patterns in application and pipeline logs.

Find out what's already
exploitable in your codebase.