CVE-2026-59947: Composer Credential Leak in Debug Output
Composer, PHP's widely-used package manager, leaks authentication credentials in debug output under specific circumstances. When developers run Composer with the highest verbosity flag (-vvv), credentials embedded in repository URLs—such as GitHub Personal Access Tokens—can be exposed in logs or terminal output. This happens because Composer's credential sanitization functions fail to strip credentials from certain URL formats, specifically when the token appears in the username portion of the URL. The vulnerability affects Composer versions prior to 2.2.29 and 2.10.2.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 4.7 MEDIUM · CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
- Weaknesses (CWE)
- CWE-532
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-08 / 2026-07-10
NVD description (verbatim)
Composer is a dependency Manager for the PHP language. Prior to 2.2.29 and 2.10.2, when Composer is run with -vvv debug verbosity, it could print a credential embedded in the username slot of a repository or package URL, such as a GitHub Personal Access Token in https://TOKEN@host/, to debug output because AuthHelper, Url::sanitize, and ProcessExecutor did not sanitize username-only URL credentials. This issue is fixed in versions 2.2.29 and 2.10.2.
5 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from incomplete credential sanitization in Composer's AuthHelper, Url::sanitize, and ProcessExecutor components. When processing repository or package URLs containing embedded credentials in the username slot (e.g., https://TOKEN@host/), these components do not properly scrub the credentials before passing data to debug output. The issue only manifests when Composer runs with -vvv (maximum verbosity), which is typically used by developers during troubleshooting. The exposed credential format commonly includes GitHub Personal Access Tokens used for private repository access, though other authentication tokens in similar URL formats are equally at risk. This is classified as a log injection and information disclosure issue (CWE-532).
Business impact
Credential exposure in debug logs creates a pathway for unauthorized access to private code repositories and other authenticated resources. If debug output is captured, committed to version control, stored in logs, or shared during support interactions, attackers can extract valid tokens and assume the permissions of compromised accounts. For organizations relying on personal access tokens for CI/CD pipelines, development workflows, or automated package retrieval, a leaked token enables both lateral movement and data exfiltration. The impact is amplified in environments where verbose logging is enabled by default or where debug output is routinely collected for monitoring.
Affected systems
Composer versions prior to 2.2.29 (on the 2.2.x branch) and prior to 2.10.2 (on the 2.10.x branch) are affected. The vulnerability applies universally across operating systems and environments where Composer is deployed—development machines, build servers, CI/CD systems, and containerized environments. Any project using an affected version to manage dependencies is potentially at risk if debug verbosity is enabled or if developers routinely run high-verbosity commands.
Exploitability
Exploitability depends on opportunity rather than technical complexity. An attacker cannot trigger credential leakage remotely; the vulnerability requires a local or authenticated actor to run Composer with -vvv flag and then gain access to the resulting output. This might occur through log file access, terminal history, CI/CD log archives, or social engineering. The CVSS score of 4.7 (MEDIUM) reflects the local attack vector and requirement for privileged access to enable debug verbosity, balanced against the high confidentiality impact if credentials are obtained. Actual risk varies significantly based on organizational logging and access control practices.
Remediation
Upgrade Composer to version 2.2.29 or later (for 2.2.x users) or version 2.10.2 or later (for 2.10.x users). Both patched versions include credential sanitization fixes across AuthHelper, Url::sanitize, and ProcessExecutor. Additionally, organizations should audit existing debug logs for exposed tokens and rotate any credentials that may have been leaked. Review logging configurations to ensure debug verbosity is disabled in production and CI/CD environments unless absolutely necessary, and implement log access controls to restrict who can view build output and debug logs.
Patch guidance
Apply patches via your standard Composer update mechanism (composer self-update for the Composer binary itself, or dependency updates in composer.json for projects using Composer as a dependency). Verify that patched versions are in use by running composer --version and confirming the version number matches 2.2.29+ or 2.10.2+. After patching, clear any cached logs or debug output that may have been generated by unpatched versions. Test the patched version in a non-production environment first to ensure no workflow disruptions, particularly for projects with custom scripts that parse or rely on Composer output.
Detection guidance
Search historical CI/CD logs, developer terminal history, and version control commit messages for URLs containing credentials, particularly patterns like https://TOKEN@ or similar authentication markers. Monitor Composer debug output (when -vvv is enabled) for credential strings using SIEM log analysis rules. In development environments, use credential scanning tools such as git-secrets or truffleHog to detect exposed tokens in repositories. Establish baseline logging rules to alert when Composer runs with maximum verbosity in production systems, which would be unusual and warrant investigation.
Why prioritize this
While the CVSS score is MEDIUM, the practical risk is context-dependent but merits prompt attention. The vulnerability enables direct credential theft with high impact (unauthorized repository access), and the fix is straightforward and low-risk. Organizations with extensive debug logging, shared build environments, or strict CI/CD security postures should prioritize this patch. Teams managing sensitive or proprietary code repositories should treat this as higher priority. The low complexity of the fix makes this an efficient use of patching resources.
Risk score, explained
CVSS 4.7 reflects: local attack vector (requires local or authenticated access), high complexity to exploit (must enable debug verbosity and capture output), low privilege requirement (developer access suffices), and high confidentiality impact (credentials expose sensitive access). The score appropriately downgrades severity from HIGH because exploitation requires non-default behavior (maximum verbosity) and local access, but acknowledges the serious consequences of information disclosure.
Frequently asked questions
Do we need to enable -vvv debug verbosity to be vulnerable?
Yes. Composer must be run with the -vvv flag (maximum verbosity) for credentials to leak into debug output. Normal operation does not expose credentials. However, if your organization routinely enables debug logging during troubleshooting or in CI/CD pipelines, the exposure window is wider than typical.
What types of credentials are at risk?
Any authentication token embedded in the username slot of a repository or package URL is at risk—GitHub Personal Access Tokens, GitLab tokens, Bitbucket credentials, or any other token-based authentication. This is most common with private repository configurations.
If we rotate our tokens, do we need to patch Composer?
Rotating tokens limits blast radius if a token was already leaked, but it does not fix the underlying vulnerability. Patching Composer is still required to prevent future leaks. A comprehensive response includes both token rotation and Composer upgrade.
Does this affect Composer when used as a library in other applications?
Yes, if an application embeds and invokes Composer and passes the -vvv flag (or equivalent programmatic debug setting), the vulnerability applies. Patching Composer itself, regardless of deployment model, eliminates the risk.
This analysis is based on the CVE description and CVSS vector provided as of the publication date. Patch availability, affected versions, and exploit status may evolve; verify against official Composer security advisories and release notes before deployment. No actual exploit code or proof-of-concept is provided. Organizations should conduct internal risk assessments based on their use of Composer, logging practices, and credential management policies. This guidance is advisory and does not constitute professional security advice for your specific environment. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-46313MEDIUMmacOS Tahoe Logging Data Redaction Flaw
- CVE-2025-59868MEDIUMHCL Traveler for Microsoft Outlook Sensitive Data Exposure
- CVE-2026-0267MEDIUMPalo Alto GlobalProtect macOS Passcode Exposure Vulnerability
- CVE-2026-11819MEDIUMAnsible keyring_info Module Credential Disclosure Vulnerability
- CVE-2026-11820MEDIUMAnsible Nexmo Module Exposes API Credentials in Logs
- CVE-2026-12086MEDIUMIBM UrbanCode Deploy & DevOps Deploy Information Disclosure via Log Files
- CVE-2026-13750MEDIUMSnowflake CLI Plaintext Credential Leakage in Debug Logs
- CVE-2026-41184MEDIUMCalico ServiceAccount Token Exposure in CNI Logs