Skip to content
Info disclosure Write-up Intermediate

Composer leaks contents of tokens configured as GitHub OAuth tokens

Composer validated GitHub OAuth tokens against a character set that rejects hyphens, and when validation failed it placed the rejected token verbatim into an exception message printed to stderr. On GitHub Actions, where the built-in GITHUB_TOKEN uses a new hyphen-containing format and is auto-registered into Composer's auth file, this disclosed the token in job logs.

github.com

Published on github.com

naderman published GHSA-f9f8-rm49-7jv2 May 13, 2026

The author, on github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The token validation rejected hyphens and then interpolated the rejected token verbatim into an exception message that was printed to stderr.

Impact

The raw token could appear in CI logs, though exposure is bounded by the token's scope and short lifetime, and GitHub's secret masker may fail to redact it.

What the attacker needed

GitHub Actions workflow using Composer; token in new hyphenated format; stderr captured in logs

The fix

The issue was fixed in Composer versions 2.9.8, 2.2.28 and 1.10.28.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Composer is a tool for managing PHP libraries, and it stores login tokens for services like GitHub in a config file. When it checked a token and found a character it did not expect, it wrote the whole token into an error message, which ended up in build logs that other people can read. Anyone with access to those logs could then use the token while it was still valid.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.