Package dependencies locked to specific versions
Why it matters
Without a committed lock file, dependency resolution is non-deterministic — npm install on different machines or at different times may pull different transitive dependency versions. CWE-1357 (Reliance on Insufficiently Trustworthy Component) and OWASP A06 (Vulnerable and Outdated Components) both flag unpinned dependencies. SLSA L2 and SSDF PW.4 require reproducible builds with verified dependency integrity. A supply-chain attack can introduce a malicious version of a widely-used package; without a lock file, your CI might silently install the compromised version the day it is published.
Severity rationale
Low because unlocked dependencies primarily create supply-chain risk during installation rather than runtime, but they open a window for silent malicious version substitution on every install.
Remediation
Commit the lock file and switch CI from npm install to npm ci:
# Verify the lock file is not gitignored
grep 'package-lock' .gitignore # Should return nothing
# Commit the lock file
git add package-lock.json
git commit -m 'Add package-lock.json'
In your CI pipeline (/.github/workflows/ci.yml):
- name: Install dependencies
run: npm ci # Installs exactly from lock file; fails if out of sync
npm ci is faster than npm install on CI because it skips the dependency resolution step.
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 Security Hardening 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
- owasp:2021 · A06 — Vulnerable and Outdated Components
- slsa:1.0 · L2 — Hosted build platform; all dependencies versioned
- ssdf:800-218 · PW.4 — Reuse Existing, Well-Secured Software
- soc2:2017 · CC7.1 — Detection and monitoring of configuration changes and vulnerabilities
Taxons
History
- 2026-04-18·v1.0.0·Initial import from security-hardening·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC7.1) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2