TL;DR: Recent NPM attacks exploit predictable gaps in version ranges, lockfile trust, cooldown timing, and package provenance, according to ArmorCode, and show how exact pinning, npm ci, release-age controls, and install-script review reduce exposure. The lesson is that dependency governance, not just scanning, now determines whether poisoned packages reach production.
Editorial analysis by NHI Mgmt Group, based on content published by ArmorCode: “Defending Against NPM Supply Chain Attacks: A Practical Guide”.
Key questions
Q: What breaks when version pinning is the only defence against NPM supply chain attacks?
A: Version pinning limits automatic upgrades, but it does not stop poisoned lockfiles, malicious install scripts or compromised publisher accounts from introducing trusted-looking code.
Q: Why do lockfiles and npm ci still fail after a dependency compromise?
A: They fail when the lockfile itself becomes the attacker’s target.
Q: How do teams know whether a vulnerable dependency is actually risky?
A: Teams should test whether the vulnerable function is reachable from real application flows.
Practitioner guidance
- Enforce exact version pinning for production dependencies Remove caret-based ranges from production package.json files where feasible and reserve looser ranges for non-production dependencies only.
- Require npm ci in CI/CD pipelines Block builds that use npm install in production workflows so the pipeline installs exactly what the reviewed lockfile specifies.
- Review every lockfile delta before merge Treat package-lock.json changes as security-relevant and inspect unexpected version jumps, new packages and dependency tree expansion.
Bottom line: NPM supply chain attacks succeed when teams trust dependency resolution, lockfiles and install-time execution as if they were the same control.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Dependency governance is now a build-time trust problem, not just a vulnerability-management problem. Version pinning, lockfiles and scanners each control only one part of the path from package publish to package execution. The attacker looks for the gap between those controls, which is why governance over resolution, provenance and install-time behavior has become the decisive layer. Practitioners should treat dependency trust as an access-control issue.
A few things that frame the scale:
- The blast radius of the Salesloft-Drift OAuth supply chain attack was 10 times greater than earlier incidents in which attackers breached Salesforce directly.
A question worth separating out:
Q: Should organisations prefer provenance verification or release-age controls for NPM risk?
A: They should use both because they address different failure points. Release-age controls reduce exposure to freshly weaponised packages, while provenance checks help confirm that the artifact came through a trusted publishing path. One filters timing, the other filters origin, and neither is sufficient alone.
👉 Read our full editorial: NPM supply chain attacks expose the limits of version pinning