ZENITHZenith Labs
ADVISORY · 2026-08-19

A lockfile is not integrity: dependency provenance as a control

A pinned lockfile stops unplanned upgrades but says nothing about whether the package inside your build is the one its author published. That is the difference between reproducibility and integrity.

Medium Z-2402

Two things that get conflated

Reproducibility means the build always uses the same versions. Integrity means those versions match what the author actually published. A lockfile gives you the first, not the second. The common infection path in a package ecosystem is not a vulnerability in code — it is the moment of publication. An attacker takes over an account or registers a name two characters off a popular package, publishes a version with a postinstall script, and waits for the first npm install in CI.

What helps, in order of usefulness

  • Pinned hashes, not just versions. package-lock.json with integrity, or pnpm hashes; npm ci instead of npm install.
  • No lifecycle scripts in CI. --ignore-scripts by default; allow scripts only where necessary and reviewed.
  • Provenance and signatures. Verify package provenance (e.g. npm audit signatures, SLSA attestations) where the ecosystem offers it — as a requirement, not a formality.
  • An SBOM per build. Without a component list you cannot answer "are we affected" inside an hour, which is the only deadline that matters.
  • A single registry or proxy for all dependencies, with manual promotion of new packages.

The practical bar

If your CI can install a package you first saw five minutes ago, you do not have supply-chain control — you have hope. Make new packages wait for human promotion; let existing ones update automatically.

Recommendation. Enable integrity verification and disable lifecycle scripts in CI; route new packages through a shared proxy registry with manual promotion.