Package Integrity
Package integrity refers to the assurance that a software package has not been tampered with, corrupted, or altered from the version its author originally published. In practice, this typically involves verifying cryptographic hashes or digital signatures associated with the package to confirm that what a developer or system downloads is exactly what was intended to be distributed. Strong package integrity controls help protect against supply chain attacks where malicious code could be injected into otherwise trusted software components.
In the context of application security and software supply chains, package integrity encompasses the set of controls, verification mechanisms, and processes used to ensure that a software artifact (library, module, container image, or other distributable unit) has not been modified between its creation by an authorized publisher and its consumption by a downstream system or developer. Core mechanisms typically include cryptographic hash verification (e.g., SHA-256 digests published alongside artifacts), digital signature validation (e.g., GPG signatures, Sigstore-based attestations), and provenance metadata that links an artifact back to a specific build environment and source commit. Package integrity verification may be performed by package managers at install time, by CI/CD pipelines during build processes, or by policy engines in deployment workflows. Limitations include the fact that integrity checks confirm only that the artifact matches what the registry or publisher attests to; they do not detect malicious code that was present in the original source, nor do they guard against compromised maintainer accounts unless combined with additional controls such as multi-factor authentication or build provenance verification. False negatives can occur when registries do not enforce or provide signature verification by default, allowing tampered packages to pass undetected. False positives are relatively uncommon in hash-based checks but may arise in signature verification scenarios involving expired keys, misconfigured trust roots, or key rotation events.
Why it matters
Package integrity is a foundational control in software supply chain security because modern applications are assembled from dozens or hundreds of third-party dependencies, each representing a potential point of compromise. If an attacker can modify a package between its publication and its consumption, whether by tampering with a registry, performing a man-in-the-middle attack on a download, or compromising a build artifact, they can inject malicious code that propagates silently into every downstream system that installs that package. Without robust integrity verification, organizations have no reliable way to distinguish a legitimate artifact from one that has been subtly altered.
The consequences of weak package integrity controls have been demonstrated in real-world incidents. In the 2020 SolarWinds (Sunburst) attack, adversaries injected malicious code into a legitimate software build process, resulting in trojanized updates distributed to thousands of organizations. While that attack also involved build-system compromise beyond simple artifact tampering, it highlighted how supply chain trust assumptions can be exploited when integrity and provenance controls are insufficient. Attacks targeting package registries directly, such as dependency confusion and typosquatting campaigns, further underscore the need for integrity verification at every stage of artifact consumption.
For organizations subject to regulatory or compliance frameworks, package integrity verification is increasingly expected as a baseline control. Ensuring that every consumed artifact matches the cryptographic digest or signature published by its author is a necessary (though not sufficient) step toward a defensible software supply chain. It is important to recognize, however, that integrity checks alone confirm only that the artifact matches what the publisher attests to. They do not detect malicious code present in the original source, nor do they protect against compromised maintainer accounts unless combined with additional controls such as build provenance verification and multi-factor authentication.
Who it's relevant to
Inside Package Integrity
Common questions
Answers to the questions practitioners most commonly ask about Package Integrity.