Lockfile committed to repo
Why it matters
A missing lockfile means npm install resolves dependency versions at install time rather than pinning them. Two developers on the same project — or the same developer on two machines — can get different dependency trees. CWE-1357 and SLSA L1 both identify non-deterministic builds as a supply-chain risk: a transitive dependency can silently introduce a breaking change or a security regression between developer and CI, making bugs impossible to reproduce. SSDF SP 800-218 PW.4.1 requires reproducible builds as a baseline software security practice.
Severity rationale
High because non-deterministic installs make bugs non-reproducible between environments and open the door to transitive dependency drift introducing security vulnerabilities undetected.
Remediation
Run your package manager's install command to generate the lockfile, then commit it and keep it committed. Remove the lockfile from .gitignore if it appears there.
npm install # generates package-lock.json
git add package-lock.json
git commit -m "chore: add lockfile for reproducible installs"
In CI, always use npm ci instead of npm install — npm ci installs exactly from the lockfile and errors if it diverges from package.json. For Yarn or pnpm, use --frozen-lockfile.
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 Code Quality Essentials Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-1357 — Reliance on Insufficiently Trustworthy Component
- slsa:1.0 · L1 — SLSA Level 1 — Provenance: build scripts checked in
- ssdf:800-218 · PW.4.1 — Reuse existing, well-secured software where feasible
- soc2:2017 · CC6.8 — Prevention and detection of unauthorized or malicious software
- soc2:2017 · CC7.1 — Detection and monitoring of configuration changes and vulnerabilities
Taxons
History
- 2026-04-18·v1.0.0·Initial import from code-quality-essentials·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.8, CC7.1) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2