# Package managers have an integrity problem

DevFeed: [Package managers have an integrity problem](<https://devfeed.tech/articles/package-managers-have-an-integrity-problem-87158.md>)

Original publisher: [Read original article](<https://blog.trailofbits.com/2026/10/14/package-managers-have-an-integrity-problem/>)

Author: "Keegan Ryan"

Published: 2026-10-14T11:00:00Z

Content type: article

Language: en

Sources: [The Trail of Bits Blog](<https://devfeed.tech/sources/the-trail-of-bits-blog-2.md>), [Trail of Bits](<https://devfeed.tech/sources/the-trail-of-bits-blog.md>)

Topics: [software artifact signing](<https://devfeed.tech/topics/software-artifact-signing.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [sigstore policy controller](<https://devfeed.tech/topics/sigstore-policy-controller.md>), [npm-workspaces](<https://devfeed.tech/topics/npm-workspaces.md>), [Conan](<https://devfeed.tech/topics/conan.md>), [pnpm](<https://devfeed.tech/topics/pnpm.md>), [Yarn](<https://devfeed.tech/topics/yarn.md>)

Tags: [cryptography](<https://devfeed.tech/tags/cryptography.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [ecosystem-security](<https://devfeed.tech/tags/ecosystem-security.md>), [hash](<https://devfeed.tech/tags/hash.md>), [integrity](<https://devfeed.tech/tags/integrity.md>), [security](<https://devfeed.tech/tags/security.md>), [supply-chain](<https://devfeed.tech/tags/supply-chain.md>)

## AI overview

A test of 25 popular source-code package managers found uneven protection against malicious package repositories. Fewer than half checked lockfile hashes for tampering by default, and only two verified every downloaded package. The article examines how lockfiles, signatures, and transparency logs affect package integrity, and proposes recording signer identity in lockfiles as one possible design.

## Source excerpt

I tested 25 of the most popular package managers to check whether they detect a compromised package repository injecting malicious code into legitimate packages. This code integrity problem could be solved using cryptographic hashes or signatures, but many package managers are still vulnerable to this threat. Of the 25 package managers reviewed1, fewer than half used lockfiles that checked for tampering by default, and only two verified the integrity of every package they downloaded. Supply-chain attacks caused by developer compromise are a common story, but imagine what happens if ongoing mitigation attempts, including work by Trail of Bits2, are successful. If developers of popular packages are no longer the easiest targets, attackers will shift their focus to the next weakest link in the system: the package repositories that serve the code. The cryptographic answers to this problem are more subtle than they appear, and many implementations fall short due to deliberate design choices, resource prioritization, or the complexity of developer-friendly solutions. One natural answer is to include a cryptographic hash of a package's contents in a lockfile and compare hashes after downloading the package. This automatic verification was the default behavior in about half of the package managers I tested, but others required extra configuration to include or verify these hashes, used hashes in a cryptographically insecure way, or lacked hashes entirely. This is summarized in the following table. Verifies integrity Go, vcpkg Verifies if lockfile is present Bun, Bundler, Cargo, npm, pnpm, Poetry, SwiftPM, uv, Yarn Verifies with lockfile + extra steps Conda, Gradle, Pip, NuGet, Pub Does not verify with lockfile or N/A CocoaPods, Composer, Conan, cpanminus, Gem, Maven, PowerShellGet, PSResourceGet, R Table 1: Lockfile-based security of a package manager fetching dependencies from a malicious repository, categorized by how much work it takes a developer to achieve integrity. E