Executive brief
Composer, a popular dependency manager for PHP, contains a vulnerability where sensitive credentials like GitHub access tokens can be leaked into log files. When the tool is run in high-verbosity debug mode, it may print these secrets in plain text if they are embedded in repository URLs. This could allow anyone with access to build logs or CI/CD output to steal credentials and gain unauthorized access to private code repositories.
Technical details
Composer versions prior to 2.10.2 and 2.2.29 fail to mask the username portion of HTTP Basic Auth credentials when embedded in repository or package URLs. While the password field was previously masked, many services (like GitHub) allow authentication tokens to be placed in the username field (e.g., https://TOKEN@github.com). When Composer is executed with maximum verbosity (-vvv), these tokens are written to the debug output in clear text. An attacker with local access or access to shared build artifacts (like CI logs) can retrieve these tokens. The issue is fixed in versions 2.10.2 and 2.2.29 by applying masking to the username field in debug output.
Affected products
- Composer Composer >= 1.0.0, < 2.2.29
- Composer Composer >= 2.3.0, < 2.10.2
Timeline
- 2026-07-01: disclosed: Initial disclosure by reporter
- 2026-07-08: advisory: NVD publication date
- 2026-07-20: advisory: GitHub Advisory published
- 2026-07-20: patched: Patched versions 2.10.2 and 2.2.29 confirmed