A package manifest can allow a range of dependency versions. A lockfile records a particular resolved dependency tree. That record helps a team explain why a build used one package version rather than another, including packages introduced indirectly by other dependencies.

For security review, the lockfile is evidence about selection. It is not an independent assessment of the selected code, its maintainer, or the scripts that may run during installation.

Understand the install command's behavior

npm documents that npm ci installs from an existing lockfile and fails when the dependency manifest and lockfile disagree, rather than updating the lockfile to reconcile them. It also removes an existing node_modules directory before installing. The npm ci documentation describes these operational differences.

A clean release install should use the dependency state from the reviewed revision. Check alternate release jobs too. A job that resolves fresh versions during deployment may produce different dependencies from the normal pipeline.

Review the dependency change as a graph

A direct dependency update can introduce or replace transitive packages. The relevant review includes those changes, their source registries, and any new installation behavior. A small manifest edit can produce a larger effective software change.

Review tools can summarize changed package names and versions, but the team still needs an acceptance process. Distinguish routine patch updates, packages with new install scripts, registry changes, and dependencies that become part of the production runtime. These categories can require different evidence without treating every update as equally risky.

Integrity checks have a defined scope

A recorded digest can help detect that downloaded package bytes differ from the expected artifact. It does not establish that the expected artifact was safe in the first place. Similarly, a vulnerability scan only reports what its data and analysis can identify at that time.

The build environment remains relevant. Toolchain versions, operating-system packages, platform-specific dependencies, and external downloads can affect the output even when the application lockfile is unchanged. Record these inputs when reproducibility is part of the release requirement.

Exercise a dependency update before release

In a controlled branch, update a representative dependency and inspect the lockfile diff, package contents, installation output, and application tests. Confirm that CI rejects a deliberately mismatched manifest and lockfile. Check whether developers and release jobs use compatible package-manager settings.

Keep the lockfile revision with the application revision and test results. When an advisory arrives, use that record to identify affected deployments. Verify that the release actually used the lockfile before relying on it for that lookup.

Sources

OWASP: Vulnerable Dependency Management. The release pipeline is illustrative.

Back to the blogExplore Ceron