Lock file is committed and current
Why it matters
Without a committed lock file, every npm install — on your machine, in CI, and at deploy time — is a fresh resolution against whatever versions are current on the registry at that moment. A transitive dependency can silently update between your local install and the production deploy, introducing a behavioral change or a newly-published vulnerability without any visible diff. SLSA L2 requires that the build process be reproducible from a pinned source; a missing lock file breaks that invariant. CWE-829 (Inclusion of Functionality from Untrusted Control Sphere) applies because the install is pulling code from a source you haven't reviewed at that exact version. Lock files are the minimum viable proof that what you shipped is what you tested.
Severity rationale
High because a missing lock file means your production environment can silently install different code than what was tested, turning any npm publish into a potential silent update to your running application.
Remediation
Generate and commit the lock file immediately. Remove it from .gitignore if present — there is no valid reason to exclude a lock file from an application repository.
npm install
git add package-lock.json
git commit -m "chore: add package lock file"
For monorepos or workspaces, commit the root lock file. For pnpm or yarn, commit pnpm-lock.yaml or yarn.lock respectively. CI should run npm ci (not npm install) to enforce the lock file on every build.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Dependency & Supply Chain Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-829 — Inclusion of Functionality from Untrusted Control Sphere
- slsa:1.0 · L2 — Hosted build platform with signed provenance
- ssdf:800-218 · PS.1 — Protect All Forms of Code from Unauthorized Access and Tampering
- soc2:2017 · CC8.1 — Change management
- soc2:2017 · CC7.1 — Detection and monitoring of configuration changes and vulnerabilities
- soc2:2017 · CC6.8 — Prevention and detection of unauthorized or malicious software
Taxons
History
- 2026-04-18·v1.0.0·Initial import from dependency-supply-chain·automated
- 2026-04-20·v1.1.0·Add Phase 6.0 detect-bash snippet for deterministic lockfile presence check·by cakleinman
- 2026-07-06·v1.1.1·Add SOC 2 TSC mapping (CC8.1, CC7.1, CC6.8) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2