
Cloud Vulnerability DB
A community-led vulnerabilities database
When a Composer repository is configured with inline HTTP headers (the options.http.header setting of a composer type repository), Composer copied those headers into composer.lock for every package downloaded from that repository. Such headers usually carry an API token or another credential, and composer.lock is usually committed to version control, so the credential could end up stored in places it was never meant to be.
This is an information disclosure issue. It cannot be triggered by a malicious package or a remote party. Whether a credential was actually exposed depends on who can read the lock file.
You are exposed if all of the following are true:
composer type repository with options.http.header set (the "inline custom headers" authentication method).composer.json, typically in your global config.json (for example via composer config --global), so the project itself does not otherwise contain the credential.composer.lock is shared with people or systems that should not have the credential, for example by committing it to a repository, publishing it as a build artifact or attaching it to a bug report.
If the inline header is defined in the project's composer.json, it is also copied into composer.lock, but the credential is already in the committed composer.json, so the lock file adds no new exposure.
You are not affected if your credentials are stored in auth.json or the COMPOSER_AUTH environment variable (http-basic, bearer, custom-headers, github-oauth and similar). Those were never written to composer.lock.
The most likely way to be affected: a developer machine or CI worker has a private repository with a token header in its global config.json, runs composer update, and the resulting composer.lock is committed.Composer no longer writes repository HTTP headers into composer.lock. When installing from a lock file, headers are taken from the currently configured repositories instead, so header based authentication keeps working.
Fixed in Composer 2.11.0 and 2.2.31 (LTS).
Existing lock files keep any headers they already contain until they are rewritten. After upgrading, run composer update --lock (or any update) to rewrite the lock file without them.
Upgrading is the fix. Until you can upgrade:
auth.json instead of an inline header, for example as bearer, http-basic, or custom-headers on Composer versions that support it.composer.lock for header entries under transport-options before committing or sharing it.Search your repositories' history for composer.lock files containing header entries under transport-options. If a credential appears in a lock file that was shared, revoke and rotate it. Removing it from the latest commit does not remove it from the history.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."