Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Composer 2.11.3: the danger of running a vendor directory you received

Table of contents · 7 items

When taking over a Laravel system or WordPress site built by another company, you may start by running composer install in the project directory you received to get it working. If the files you received include the vendor directory, that action itself can be dangerous. Composer 2.11.3 and 2.2.33, released on November 24, fix a weakness in exactly this scenario. According to the advisory, it is not limited to composer install; even read-only commands such as composer show and composer validate are affected.

Composer itself is installed separately on developer machines, CI images and servers, apart from the dependency packages managed in the project's composer.lock. Updating the project's dependencies does not change the version of Composer itself. In this article, we lay out the fixes in the two November updates (2.11.2 and 2.2.32 on November 10, and 2.11.3 and 2.2.33 on November 24) based on the CHANGELOG of composer/composer, the fix commits and the advisories (GHSA) published in the repository, and summarize the affected scenarios and how to check.

Four releases in November

Composer updates the current 2.11 series and the 2.2 long-term support (LTS) series for older PHP in parallel. The release times recorded on Packagist are as follows.

ReleaseReleased (Packagist, UTC)Security items in the CHANGELOG
2.11.3November 24, 2026, 9:143 items (code execution via vendor, display of package descriptions, credentials in error output)
2.2.33November 24, 2026, 9:113 items (same as above)
2.11.2November 10, 2026, 9:097 items (command execution from composer.lock, zip extraction destination, credential send destination, etc.)
2.2.32November 10, 2026, 9:094 items (zip extraction destination, credential send destination, etc.)

For 2.11.2 and 2.2.32, the date in the CHANGELOG heading is November 11. However, the Packagist release time, GitHub Releases and the advisory publication in the repository are all November 10 (UTC), so this article uses November 10. The 2.11 series requires PHP 7.2.5 or later in composer.json. Environments that run Composer on older PHP will need to use the 2.2 series.

The advisories (GHSA) were published in the composer/composer repository a few minutes after each release (9:13 on November 10 and 9:19 on November 24, UTC). In terms of severity, GHSA-374h-4mh9-7rpm from November 24 is High. Of the November 10 advisories, GHSA-jhfp-4ppm-crmm and GHSA-w6hj-6587-3jh5 are High, and GHSA-x82q-x274-r6pq is Medium. On the other hand, as of November 26, the four November advisories had not yet appeared in the GitHub Advisory Database (github.com/advisories) or in Packagist's advisory list, and no CVE numbers had been assigned.

November 24 fix: code execution via a prepared vendor directory

The first item for 2.11.3 and 2.2.33 is as follows.

Security: Fixed arbitrary code execution when running Composer in a directory whose composer.json and vendor directory were prepared by an attacker, a bypass of the CVE-2024-24821 fix (GHSA-374h-4mh9-7rpm)

Conditions stated in the advisory

The GHSA-374h-4mh9-7rpm advisory says you are affected when all three of the following conditions are met.

  • Your Composer version is 2.2.23 to 2.2.32, or 2.7.0 to 2.11.2
  • You run it in a project where someone else can modify or has prepared composer.json and the vendor directory. Examples given include untrusted checkouts, pull requests built in CI, and directories shared with other users
  • You run it without either --no-plugins or --no-scripts

The advisory also says: “Any Composer command that loads the project is enough, including read-only ones such as composer list, validate, show or outdated.” On the other hand, it explains that it cannot be exploited remotely or through package installation. It assumes the attacker can prepare the contents of composer.json and vendor in the project being run.

The original 2024 weakness

CVE-2024-24821 (GHSA-7c6p-848j-wh5h, severity High) is a weakness disclosed in February 2024. The advisory explained that because running Composer loads files from the working directory, running it in a directory containing crafted files could execute code, and it listed the following three scenarios as especially dangerous.

  • Running Composer with sudo
  • Pipelines that run Composer on untrusted projects
  • Shared environments where multiple developers each operate on the same project with Composer

With the fix at that time (2.7.0 and 2.2.23), Composer began checking with a regular expression, before loading vendor/composer/installed.php, that its contents are only an array listing versions.

The loophole fixed this time

Looking at the November 24 fix commit (baba7f7), there was a loophole in the processing after the check. Composer replaces __DIR__ in the installed.php that passed the check with the vendor directory path string before executing it. Because this replacement does not distinguish whether it is inside a string, crafting the vendor directory name made it possible to rewrite the code after it had passed the check.

The added test is an example that includes {${phpversion()}} in the vendor directory name and plants => __DIR__ . ' inside the installed.php string. After the fix, the code is checked again after the replacement and is not loaded if it fails. Because the vendor directory location can be set with config.vendor-dir in composer.json, the CHANGELOG says it applies when “both composer.json and vendor were prepared.”

Diagram of Composer's November fixes, showing where crafted content in externally supplied files could lead to what outcome. The combination of vendor-dir in composer.json and vendor/composer/installed.php leads to code execution (severity High), fixed in 2.11.3 and 2.2.33; transport-options in composer.lock and installed.json leads to command execution (High), fixed in 2.11.2; symbolic links inside a zip lead to writes outside the extraction destination (High), fixed in 2.11.2 and 2.2.32; and a mirror on another host written in the lock leads to sending credentials (Medium), fixed in 2.11.2 and 2.2.32

How --no-plugins and --no-scripts help

As the advisory's conditions above indicate, runs with --no-plugins or --no-scripts are not affected by this issue. In the 2.11.3 and 2.2.33 source (Factory.php) as well, installed.php is loaded only when both plugins and scripts are enabled (the comment reads “load existing Composer\InstalledVersions instance if available and scripts/plugins are allowed, as they might need it”). We have not actually verified this behavior for this article.

However, these two options only prevent the November 24 issue. For GHSA-jhfp-4ppm-crmm from November 10, discussed later, the advisory says “--no-scripts and --no-plugins do not prevent it.”

The 2024 advisory also gave the following steps for running in an untrusted directory.

rm vendor/composer/installed.php vendor/composer/InstalledVersions.php
composer install --no-scripts --no-plugins

The other two issues from the same day

  • Package descriptions, support links, license names and similar fields were being interpreted as console formatting markup. Invalid formatting tags could cause show, licenses and audit, and even install and update, to fail (#13292 and #13293)
  • In environments where curl is unavailable, credentials embedded in repository URLs appeared in download error messages (#13266 and #13267)

November 10 fix: values coming from composer.lock and installed.json

The fixes in 2.11.2 and 2.2.32 concentrate on places where Composer trusted too much the contents of files arriving from outside the project, such as composer.lock, vendor/composer/installed.json and downloaded zip files.

CHANGELOG item (summary)2.11.22.2.32
Arbitrary command execution from prevent_url_access_callable in composer.lock or installed.json (GHSA-jhfp-4ppm-crmm, High)FixNot affected (per the advisory)
Writes outside the extraction destination via symbolic links in a zip, during extraction that falls back from unzip to ZipArchive (GHSA-w6hj-6587-3jh5, High)FixFix
Repository credentials sent to a mirror on another host written in composer.lock or installed.json (GHSA-x82q-x274-r6pq, Medium)FixFix
Authorization and Cookie headers resent on redirects to a different originFixFix
Non-authentication settings loaded from the project's auth.json or COMPOSER_AUTHFixFix

In addition, 2.11.2 includes a fix for the IP deny check happening after the request was sent (#13255) and an update to the bundled symfony/filesystem (GHSA-6prc-h956-hxjq).

In the diff of the first commit (f4f8ca8), prevent_url_access_callable and prevent_ip_access_callable are now removed from transport-options in the package information. The comment reads “these options are invoked as callables while downloading, so they must never be taken from externally provided package data such as the lock or installed.json”. The download process also throws an exception if either of these two is not Closure.

The three advisories describe the conditions for being affected as follows.

  • GHSA-jhfp-4ppm-crmm: Applies to 2.10.0 to 2.11.1 when composer install or update is run against a composer.lock or installed.json whose contents an attacker can change. 2.2 LTS and versions earlier than 2.10.0 are not affected. Example paths include pull requests that change only composer.lock, templates that include a lock, a compromised dependency update bot, and a poisoned CI cache. The advisory says the most realistic case is CI that checks out a branch and runs composer install without anyone reviewing the lock changes
  • GHSA-w6hj-6587-3jh5: Applies to 1.0.0 to 2.11.1 when packages are installed from a repository or mirror where an attacker can supply zip files, in an environment that has both the unzip command and PHP's zip extension. The advisory says typical usage that installs only Packagist.org archives is not a realistic path
  • GHSA-x82q-x274-r6pq: Applies only to 2.11.0, 2.11.1 and 2.2.31, when HTTP headers containing credentials are written directly in the repository configuration and an attacker can change composer.lock or installed.json

Behavior that changes with the update

The auth.json fix affects compatibility. According to the commit (02b85f1) description, the project's auth.json and the COMPOSER_AUTH environment variable are meant for credentials, and other settings are now ignored with a warning (except for the *-domains setting). config.home in the project's composer.json is also ignored, and you are directed to use the COMPOSER_HOME environment variable instead. If your CI puts non-authentication settings in COMPOSER_AUTH, check whether warnings appear after the update.

Likely affected scenarios (compiled by the editorial team from the advisories)

Based on the examples in the November advisories and the 2024 advisory, the following scenarios are worth checking first.

  1. Running a handed-over project as received. This is when you receive an archive or repository containing vendor from a previous agency or a client and run composer install or similar commands in that directory. Running it before checking the contents counts as the “untrusted checkout” cited in the November 24 advisory
  2. Processing pull request branches in CI. This is a pipeline that runs Composer directly on the branch in a repository where composer.json and composer.lock can be changed by pull requests. Both the November 24 advisory and the November 10 GHSA-jhfp advisory cite it as an example
  3. Using sudo composer on a shared server. The 2024 advisory listed this usage as high risk, and the impact widens when directories that other users can modify are involved

On the other hand, if only your own staff can modify project files and you do not commit vendor but rebuild it every time, the entry points for the November 24 issue are limited. However, the GHSA-jhfp advisory also lists paths where composer.lock is rewritten via dependency update bots or CI caches. It is safest to update Composer itself, including the November 10 release.

Steps to check (editorial suggestion)

  1. Check the Composer version in each environment. Run composer --version on developer machines, CI images (Docker images and setup steps that include composer) and production and staging servers, and confirm the version is 2.11.3 or later (2.2.33 or later for the 2.2 series). Because Composer itself is not listed in the project's composer.lock, we believe it does not show up in the results of composer audit (editorial reading)
  2. Update. Update a PHAR-installed Composer with composer self-update. To pin to the 2.2 series in environments older than PHP 7.2.5, use composer self-update --2.2 (confirmed in the option list in the official documentation and in the source). The official documentation says self-update may not be available for Composer installed with an OS package manager. In that case, check the version of the OS package
  3. Inspect received projects first. In directories you are not sure you can trust, delete vendor/composer/installed.php and InstalledVersions.php, then reinstall dependencies with --no-scripts --no-plugins. Also check config in composer.json (such as vendor-dir) and transport-options in composer.lock. Because these two options do not prevent GHSA-jhfp, upgrade Composer in steps 1 and 2 before running it
  4. Check CI warnings. On the first run after the update, check for warnings that auth.json or COMPOSER_AUTH settings were ignored

Scope of verification

On November 26, 2026, we reviewed composer/composer's CHANGELOG.md (main and 2.2 branches), the tags 2.11.2, 2.11.3, 2.2.32 and 2.2.33, the diffs and tests of the fix commits (baba7f7, f4f8ca8, 648d769, 0b8179f, 02b85f1, 672eb25 and df59f6b), Factory.php and FilesystemRepository.php in 2.11.3 and 2.2.33, the official documentation (doc/03-cli.md), Packagist's release timestamps and advisory list (API), and GHSA-7c6p-848j-wh5h (CVE-2024-24821) in github/advisory-database (desk research). On the same day, we checked the publication dates, severities, affected versions and conditions of the four advisories in the composer/composer repository (GHSA-374h, GHSA-jhfp, GHSA-w6hj and GHSA-x82q) via the GitHub API, and the release date of each version in the changelog on getcomposer.org. The four advisories are not yet listed in the GitHub Advisory Database and have no CVE numbers. We have not verified behavior by actually running Composer, reproduced each issue, or checked the versions in the official Docker images.

We covered updates for critical weaknesses in PHP itself in our article on PHP's unauthenticated RCE, an advisory for a Laravel admin panel component in our Filament Curator article, and WordPress's November update in our WordPress 7.1.5 article.

For reviews of PHP systems you have taken over or for planning updates including CI, please contact us via Development, AI and automation consultation.

References

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email