Skip to content

Update dependency composer/composer to ^2.10.2 [SECURITY]#999

Open
renovate[bot] wants to merge 1 commit into
8.22.xfrom
renovate/packagist-composer-composer-vulnerability
Open

Update dependency composer/composer to ^2.10.2 [SECURITY]#999
renovate[bot] wants to merge 1 commit into
8.22.xfrom
renovate/packagist-composer-composer-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
composer/composer (source) ^2.9.8^2.10.2 age adoption passing confidence

Composer: Arbitrary file write outside vendor via malicious transitive package name

CVE-2026-59948 / GHSA-499r-g7pc-vmp9

More information

Details

Summary

A maliciously crafted package, published on an untrusted third party repository other than Packagist.org or Private Packagist, can cause Composer to write files outside the vendor/ directory and outside your project, with attacker-controlled content, during a normal install or update through using an invalid package name, which was not correctly validated by Composer.

This is an arbitrary file write that can be used to execute code outside the Composer project's context in which you expected the package code to execute (for example by writing shell startup files, SSH authorized_keys, or a cron entry). It is a supply-chain issue: it requires a malicious or compromised package to be present in the dependency graph, it is not otherwise remotely exploitable against a machine.

The fix makes Composer validate every package produced by dependency resolution before anything is written to composer.lock or installed, and abort with a security error if a package name is not a valid vendor/package name.

Am I affected?

You may be affected if you install packages from an untrusted third party repository, which does not sufficiently validate package names. Packagist.org and Private Packagist are safe, as they validate package names correctly.

Patched versions

Fixed in 2.2.29 and 2.10.2. Composer 1.x is also affected and you should move to a safe 2.x release.

Workarounds

Do not use untrusted package repositories. If you have to, mirror them through an internal repository like Private Packagist.

Severity

  • CVSS Score: 7.0 / 10 (High)
  • Vector String: CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Composer: URL-embedded HTTP-Basic username leaks to verbose logs (GitHub PAT exposure)

CVE-2026-59947 / GHSA-g6xq-892h-64w3

More information

Details

Summary

When Composer is run with -vvv (debug verbosity), it could print a credential that was embedded directly in a repository or package URL, but not as a password, to its debug output. Composer already masked the password portion of such URLs, but the username portion was shown in clear text. Because GitHub and several other services support placing an access token in the username position of a URL (for example https://[token]@​github.com/owner/repo), a token used that way could end up written to the verbose log in full.

This is an information disclosure issue. The credential is only ever exposed to whoever can already read Composer's debug output.

Am I affected?

You are potentially affected only if all of the following apply:

  • A credential is embedded inside a URL that Composer handles, e.g. in a repositories entry in composer.json, in a package dist/source URL - rather than being supplied through auth.json or the COMPOSER_AUTH environment variable.
  • The secret sits in the username slot of that URL (e.g. https://TOKEN@host/…). A normal username:password@host pair where the username is an ordinary account name did not expose the password, that was already masked.
  • Composer is run with -vvv (debug verbosity), and that output is retained or shared somewhere others can read it: public CI build logs, output pasted into an issue or chat, archived terminal sessions, and so on.

If you keep credentials in auth.json or environment variables, or you never run Composer at debug verbosity, you were not exposed.

The most realistic exposure is the documented pattern of embedding a GitHub Personal Access Token in a URL's username position on a machine (often CI) that captures verbose output.

Patched versions

The username is now masked the same way the password already was, so an embedded token no longer appears in verbose output (a short, non-secret prefix may be shown to aid debugging, but never the full value).

Fixed in Composer 2.10.2 and the 2.2.29.

Workarounds

There is no configuration setting that prevents outputting credentials while keeping normal behavior.

If you cannot upgrade right away, you can reduce exposure by:

  • Not running Composer with -vvv (debug verbosity) in environments where output is captured or shared.
  • Moving credentials out of URLs and into auth.json or COMPOSER_AUTH.
  • Scrubbing existing CI/build logs that may already contain a leaked token.

Severity

  • CVSS Score: 4.7 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Composer: Path traversal in package bin field lets dependencies chmod arbitrary host files

CVE-2026-59946 / GHSA-gjfg-22fp-rrxx

More information

Details

Summary

A Composer package declares its executables in the bin field of its composer.json. When Composer installs a package, it processes each bin entry and changes the file mode of the corresponding file so it is executable.

If a bin entry contains .. path segments, it can resolve to a path outside the package's own install directory. A malicious package can use this to make Composer run chmod against a file that already exists elsewhere on the machine. The resulting mode is world-readable and world-executable (0755 under the common umask of 022). This happens when the package is installed, e.g. during composer install, composer update, and composer require. Any dependency can trigger it, including a transitive dependency several levels deep.

The vulnerability changes file permissions only, and does not read, modify, or execute the contents of the target file, and it is not remote code execution. The impact is to confidentiality: a file with deliberately restrictive permissions, such as a private key at mode 0600, can be made readable by other users on the same host.

Am I affected?

We reviewed packagist.org data and found no evidence that any published package exploited this vulnerability. If you install packages only from packagist.org, you are not affected by any known exploitation.

You are potentially affected if all of the following are true:

  • Your Composer project depends, directly or transitively, on a package you do not fully trust.
  • A file you rely on for its restrictive permissions already exists at a path the Composer process can write to. Examples include SSH private keys, .env files, ~/.aws/credentials, and .netrc.

The most likely way to be affected is to add or update a dependency that is malicious or has been compromised, then run an install on a machine that holds sensitive, permission-restricted files.

Two points to note:

  • --no-scripts, --no-plugins, and an allow-plugins allow-list do not prevent this. The permission change happens during normal binary installation, outside the plugin and script trust model.
  • Impact scales with privilege: As a regular user, only files owned by that user can be affected, which typically means your own secrets becoming readable by other local users on a shared machine. As root (for example, a CI container with no non-root user, or sudo composer install), any file on the system can be affected, including system credential stores.
Patched versions

The fix makes Composer reject any package whose binary entry contains a .. path segment. During install/update the operation aborts before any file permission is changed, and the same check now also applies when a package is published to Packagist.org, so such packages are refused upstream.

Fixed in 2.2.29 (2.2 LTS line) and 2.10.2 (current 2.x line). Composer 1.x is end of life and will not be patched. 1.x users should upgrade to a patched 2.x release.

Workarounds

Upgrading to a patched release is the only complete fix. There is no configuration option that disables the vulnerable behavior.

Severity

  • CVSS Score: 6.1 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

composer/composer (composer/composer)

v2.10.2

Compare Source

  • Security: Validate package names (GHSA-499r-g7pc-vmp9)
    • Security: Validate package bin paths against path traversal (GHSA-gjfg-22fp-rrxx)
    • Security: Sanitize URL-embedded usernames/token in verbose output (GHSA-g6xq-892h-64w3)
    • Security: Only follow HTTP redirects from HTTP responses (#​12948)
    • Security: Prevent phar metadata unserialization on unsafe PHP versions (#​12946)
    • Security: Sanitize JSON parse errors in http responses to avoid leaking response body data (#​12959)
    • Added warning output in self-update command when using a soon-to-be EOL version (#​12920)
    • Added download retry when a GitHub codeload URL returns a 400 (#​12962)
    • Fixed audit command to output the audit result to stdout (#​12904)
    • Fixed backspace characters being output to non-decorated output (#​12925)
    • Fixed security advisory blocking causing issues with xdebug enabled (#​12935)
    • Fixed provider packages hiding suggestions for the package they provide themselves (#​12933)
    • Fixed security advisory blocking causing issues with xdebug enabled (#​12935)

v2.10.1

Compare Source

  • Security: Fixed shell escaping when opening an editor (#​12903)
    • Security: Verify backup phar signature before restoring it when using self-update --rollback (#​12918)
    • Fixed source-fallback also disabling fallbacks to dist install when source is the preferred install method (#​12888)
    • Fixed source -> dist package updates wiping the .git dir without checking for local changes first (#​12912)
    • Fixed GitHub token prompt happening multiple times on parallel auth failures (#​12913)
    • Fixed warnings from Composer repositories being printed twice in some cases (#​12907)

v2.10.0

Compare Source

  • BC Break / Security: Disabled automatic fallback to source checkout if dist/zip install fails, we have introduced a new source-fallback config option as a temporary way to restore the old behavior, but if you need this talk to us as we plan to remove it entirely in 2.11 (#​12885)
    • BC Break: Minor break for audit consumers, the exit code is now always 0 (success) or 1 if anything failed the audit (#​12881)
    • Security: Hardened output filtering of URLs to reduce chances of token leaks (#​12882, #​12886)
    • Security: Fixed handling of uppercase schemes in URL validation that might have allowed https requirement bypass (#​12884)
    • Fixed audit command returning a success code when the vendor dir was not present (#​12880)

Configuration

📅 Schedule: (in timezone UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

Read more about the use of Renovate Bot within ocramius/* projects.

| datasource | package           | from  | to     |
| ---------- | ----------------- | ----- | ------ |
| packagist  | composer/composer | 2.9.8 | 2.10.2 |
@renovate renovate Bot added the security label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants