Composer's lock file and vendor/ can run code
Most of us treat composer install as a boring, safe step, and most of us run it in CI on whatever a pull request hands us. Two Composer releases in November are a good reason to reconsider that habit. Composer 2.11.2 and 2.11.3 (plus the 2.2 LTS releases 2.2.32 and 2.2.33) fixed advisories where the attack surface was not a malicious package at all, but the files sitting next to your code: composer.lock, vendor/composer/installed.json and the vendor directory itself.
The lock file that runs a command (2.11.2)
On November 10 the Composer team published GHSA-jhfp-4ppm-crmm, rated High (CVSS 8.8). A crafted composer.lock or installed.json could carry a transport-options.prevent_url_access_callable value that Composer would execute as a system command while resolving downloads during install or update. No malicious package is involved, and the command runs before any checksum check. Affected versions are 2.10.0 through 2.11.1; 2.11.2 ignores those callback options when they come from the lock or installed file.
The detail I keep coming back to: the advisory says --no-scripts and --no-plugins do not prevent it. The realistic scenario it names is automated CI that runs composer install on unreviewed lock changes, such as a PR that edits only composer.lock. Reviewers skim lock diffs, if they look at them at all.
Symlinked zips and credentials sent to the wrong host
The same 2.11.2 release (and 2.2.32) fixed GHSA-w6hj-6587-3jh5, also High: a malicious zip archive with symlinked entries could make Composer write a file outside the package directory, via the unzip to ZipArchive fallback. The advisory notes that Packagist-only installs are not a realistic vector; self-hosted repositories, mirrors and attacker-controlled dist URLs are. There is no workaround other than upgrading.
It also fixed GHSA-x82q-x274-r6pq (Moderate): repository HTTP credentials could be sent to attacker-controlled dist mirrors named in lock or installed files. Per the release notes, non-auth config coming from a project's auth.json or COMPOSER_AUTH is now ignored with a warning, which is the kind of behaviour change that can surprise a CI pipeline after an upgrade.
The vendor directory bypass (2.11.3)
On November 24, GHSA-374h-4mh9-7rpm landed (High, 8.8). It bypasses the fix for CVE-2024-24821: running Composer in a directory whose composer.json and vendor directory were prepared by an attacker can execute commands as the current user. Even read-only commands like composer list, validate, show or outdated trigger it. Affected: 2.2.23 up to 2.2.33 (exclusive) and 2.7.0 up to 2.11.3 (exclusive). It is not remotely exploitable by itself, and per the advisory running with --no-plugins and --no-scripts removes the exposure.
What I changed
First, I checked what I was actually running:
composer --version
composer self-update
# then, in a throwaway shell, confirm the build image too:
docker run --rm composer:2 composer --version
Second, I looked for the Composer I did not install myself. Craft ships a bundled composer.phar; its 5.12.2 release notes say it was updated to 2.11.2, which covers the November 10 fixes but not the November 24 one, so I would not assume the bundled copy is current. Third, in CI I stopped treating lock-file changes as harmless: untrusted PRs that touch composer.lock get a manual review before any job runs composer install with real credentials.
None of these are remote, drive-by bugs, and the Packagist-only install path is the least exposed. But they all share a lesson: the files Composer reads before it installs anything are an input, and in a shared CI runner or an untrusted checkout, that input deserves the same suspicion as a dependency. Upgrade to 2.11.3 (or 2.2.33 on the LTS line), and pin the version in your build images so the next fix does not depend on someone remembering to run self-update.