How Packagist and Drupal Protect PHP Dependencies
Recent software supply chain attacks have prompted Packagist to change how published PHP package versions are managed and investigated, according to an implementation report published on 24 November 2026. During an attack on 30 April 2026, the code associated with version 5.0.2 of intercom/intercom-php was replaced without changing its version number. Projects requiring that exact version received malicious code during subsequent dependency updates.
The incident exposes a problem relevant to every Drupal application that relies on third-party PHP dependencies. Selecting a specific software version, verifying the contents of a downloaded package and establishing whether its publisher was authorised are separate security challenges. Recent developments across Packagist, Composer and Drupal's package infrastructure address different parts of this problem.
When Version Numbers Stopped Being Reliable
Until June 2026, Packagist allowed the Git commit associated with an existing stable package version to change when its corresponding release tag changed. Maintainers could use this behaviour to correct release mistakes, but attackers with compromised repository access could also exploit it. Similar attacks affected packages maintained by the Laravel Lang project on 22 May 2026.
Packagist responded by introducing immutable stable-version references. Once a stable version is published, its associated Git commit cannot be replaced through retagging. Development versions continue to track changes to their respective branches.
The change matters beyond preventing attacks. Vulnerability databases, dependency scanners and organisational approval policies frequently identify software by version number. Their findings become less reliable when different code can circulate under the same version identifier.
What Composer Actually Verifies
Drupal projects typically declare dependency requirements in composer.json and record the resolved dependencies in composer.lock. According to Composer's documentation, committing the lock file to version control allows development and production environments to install consistent dependency versions.
Specifying an exact version in composer.json is not equivalent to installing from an existing lock file. During dependency resolution, Composer consults repository metadata to determine the reference associated with the requested version. A lock file that already contains the original commit reference provides a different level of protection against changes to that metadata.
However, a fixed source reference does not automatically establish the integrity of a downloaded archive. Packagist currently distributes package metadata rather than hosting the artifacts themselves. More than 99% of its package download URLs point to archives generated by GitHub, according to Packagist's 12 November 2026 artifact integrity roadmap.
Composer already supports SHA-1 checksum verification when the expected checksum is supplied. Most Packagist packages lack such checksums because dynamically generated archives are not guaranteed to remain byte-identical, even when their source files are unchanged. The limitation makes it difficult to verify whether an artifact retained in an organisation's internal package mirror matches the originally distributed file.
Making Package Changes Visible
Packagist's transparency log helped its operators and external security researchers reconstruct the April and May attacks. It records changes involving package ownership, release references, deletions and maintainer accounts. Packagist has also introduced controls for freezing accounts and packages during security investigations.
The log is accessible to signed-in users, although recorded changes to two-factor authentication settings are not yet publicly visible. An API for external monitoring and mechanisms for independently detecting alterations to the log remain under development. Its records currently reside within Packagist's own database, limiting independent verification if that infrastructure is compromised.
The transparency log and organisation management projects received funding from the Sovereign Tech Agency's Sovereign Tech Fund through the PHP Foundation. The funding period ended in September 2026, but development continues. Organisational membership infrastructure is operational, while the ability for organisations to own packages remains unimplemented.
How Drupal Protects Its Software Supply Chain
Drupal applications can draw dependencies from both Packagist.org and Drupal.org's own Composer package repository. These repositories operate different distribution infrastructures, making their respective security guarantees important to applications that depend on both.
Drupal.org publishes cryptographic checksums alongside its downloadable release archives. The Drupal 11.4.14 release page, published on 25 November 2026, provides MD5, SHA-1 and SHA-256 checksums for its ZIP and compressed TAR files. These allow downloaded archives to be compared against published expected values.
The presence of these checksums does not establish that every Composer installation verifies them. Downloadable Drupal releases and individual Composer packages are not necessarily identical artifacts. Verification depends on the package metadata, distribution files and installation mechanisms involved.
Drupal has also adopted The Update Framework (TUF), which uses signed metadata to secure software distribution. Drupal's experimental Package Manager module requires PHP-TUF and its Composer integration plugin to be installed and configured. Its requirements include TUF protection for the Drupal.org Composer repository.
The Drupal Association maintains packagist-signed.drupalcode.org, a partial mirror of Packagist.org that generates TUF signing metadata for supported packages. These protections are not automatically available to every Drupal installation. Packagist identifies repository compromise as a separate security problem outside the scope of its current artifact integrity project.
Another complementary protection is Composer 2.11's optional dependency cooldown policy. As previously reported by The DropTimes, Drupal.org now provides publication timestamps for more than 16,600 projects, supporting the policy. Cooldowns delay the selection of newly published versions during dependency resolution, giving security teams additional time to detect malicious releases, but do not withhold packages during ordinary installation from an existing lock file.
The different mechanisms address distinct stages of software distribution. Their capabilities and limitations can be compared as follows:
| Security Mechanism | What It Establishes | What It Cannot Guarantee |
|---|---|---|
| Composer lock file | Consistent dependency selection | Independent verification of every downloaded artifact |
| Version immutability | A fixed relationship between a stable version and its source commit | Immutability of downloaded archives |
| Artifact checksum | Whether a file matches a trusted expected hash | Safety of the underlying code |
| Transparency log | A record of security-related package and maintainer activity | Prevention of malicious releases or independent detection of tampering in the current implementation |
| Dependency cooldown | Additional time for detection before dependency selection | Detection of every malicious package |
| The Update Framework (TUF) | Authenticity and freshness of signed metadata and integrity of covered targets | Safety of legitimately authorised software |
| Build provenance attestation | Verifiable information about an artifact's origin and production process | Absence of vulnerabilities or malicious code |
What Packagist Is Building Next
With separate funding from Alpha-Omega, Packagist plans to retain permanent copies of release artifacts and publish their checksums. Existing Composer versions will be able to verify the supplied SHA-1 checksums, while future releases will add SHA-256 verification. Subsequent development will introduce Sigstore signatures and build provenance attestations.
Packagist also plans to introduce restricted, expiring API tokens and Trusted Publishing. Authorised continuous integration workflows will be able to obtain short-lived publishing credentials, reducing dependence on permanently stored secrets. Artifact uploads and Trusted Publishing are planned capabilities rather than features currently available to maintainers.
The project could also benefit repositories beyond Packagist.org. Its developers intend to document the metadata formats and Composer changes publicly so that other PHP package repositories can adopt compatible verification mechanisms. Any adoption by Drupal.org would require separate implementation decisions.
What Drupal Teams Can Do Today
Drupal teams can reduce existing risks by committing Composer lock files, reviewing dependency changes and running composer audit to identify known vulnerabilities and other reported dependency risks. Reviews should examine changes to source references and distribution URLs alongside version numbers. Organisations running internal package mirrors can also retain cryptographic hashes of approved artefacts for later comparison.
Maintaining the package manager itself is equally important. Composer 2.11.3, released on 24 November 2026, addresses security issues including arbitrary code execution when Composer operates within an attacker-prepared project directory. Repository signing, dependency cooldowns and additional verification mechanisms should complement timely security updates rather than replace them.
Even an artifact carrying valid checksums, signatures and provenance attestations can contain malicious code if the publishing process itself is compromised. These mechanisms establish different aspects of authenticity and integrity, but they cannot replace source code review, vulnerability detection or maintainer account security.
For Drupal applications assembled from multiple repositories, the remaining challenge is consistent verification across the entire dependency chain. Packagist's immutability rules strengthen the relationship between version numbers and source revisions, while Drupal's repository protections secure other parts of software distribution. A reproducible dependency selection remains essential, but establishing trust in the resulting application requires evidence about the software actually delivered.
References
-
Transparency log & first stage of organizations (24 November 2026)
-
Artifact integrity for Packagist and Composer (12 November 2026)
