Lesson 13 of 14 · 13m
Adding a Dependency Is Adding a Maintainer
Scorecard, deps.dev, cooldowns, and a pull-through proxy turn trust decisions from laptop folklore into a gate.
Adding a package is adding people
npm install left-pad doesn't add eleven lines of code. It adds a maintainer — their account security, their release cadence, their judgment about what to merge — plus every transitive maintainer below them. npm ls on a modest project lists hundreds of packages; each is a publish token somewhere. The vetting question isn't "is this code good" but "would I let these people run arbitrary code on my build machine?" — because you are.
What to look at before you add it
npm view <pkg>— first publish date, release cadence, maintainer identity. A dep on a six-week-old package owned by an anonymous account is a different decision than a decade-old package with three named maintainers.npm view <pkg> scripts— lifecycle hooks are the first thing to check. A parsing library with apostinstallneeds a reason.npm view <pkg> timeandnpm ls <pkg>— release history, and what it drags in transitively.npm explain <pkg>later tells you why it's in your tree at all.- deps.dev — Google's Open Source Insights: advisories, versions, license, dependency graph in one page.
- OpenSSF Scorecard —
scorecard --repo=github.com/org/reposcores the project: branch protection, maintained status, signed releases, dangerous workflows, token permissions, dependency pinning. A low score doesn't mean malicious; it means nobody's watching. - The diff on upgrade —
npm diff --diff=pkg@1.2.3 --diff=pkg@1.2.4. Version bumps that addscripts, new binaries, or a maintainer change deserve an actual read, not a merge.
event-stream cleared every casual bar: two million weekly downloads, years of maintenance, a real maintainer. The check that would have caught it — flatmap-stream was a brand-new dep with an opaque payload — required looking at the transitive diff. The tools above are how you look without making it a day job.
The chokepoint: one registry, your rules
The scalable version of vetting isn't heroics per package — it's architecture. Run a private pull-through registry — Verdaccio, Artifactory, Nexus, devpi — as the only index clients can reach:
.npmrcmaps scopes:@acme:registry=https://registry.acme.example/npm/— internal names never touch the public namespace (dependency confusion dies here).- The proxy caches what you use and can quarantine: new packages wait for approval or a cooldown window before they'll resolve.
- CI egress rules deny
registry.npmjs.organdpypi.orgdirectly — an install that can't reach public indexes can't be confused into pulling from them. - Owned-name exclusions at the proxy:
acme-*never proxies upstream, period.
On cooldown: most malicious releases die within days once detected. Renovate's minimumReleaseAge, Dependabot's cooldown config, and pnpm's minimumReleaseAge setting all implement "don't install releases younger than N days" — point it at days, exempt critical security fixes, and let the ecosystem's immune system work before your pipeline samples the pathogen.
The wrong mental model
"Enterprise registries are for caching and uptime." They're a trust boundary — the difference between vetting as a bottleneck and vetting as a gate. Without a chokepoint, every laptop and CI job is its own policy. With one, the policy lives in exactly one place.
And "popular = vetted" remains wrong. Popularity predicts download volume; it says nothing about the next release. You vet the maintainer graph and the update diffs continuously — or you let a proxy enforce it and spot-check the exceptions.
Practice
Adopt deps behind the private registry only, with Scorecard/deps.dev review for anything security-adjacent or script-bearing, cooldown on non-security updates, and diff review on upgrades that change scripts, ownership, or native bindings. Fewer dependencies is the honest endgame — every dep declined is a maintainer you'll never have to trust.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Buying Time: Package Managers Are Adding Delay as a Security Control
Composer 2.11 shipped a cooldown that refuses to install a version until it has aged. vlt now holds npm publishes until their dependencies actually exist, because 22% of new npm versions land broken. And Ruby Central's reviewers threw out 90% of what an AI scanner flagged.
Your npm Install Just Ran Someone Else's Code: Why Dependency Security Has to Start Before CI
A pull request checkout, a poisoned GitHub Actions cache, and an OIDC token pulled straight out of runner memory. That's how 84 malicious versions of TanStack's packages hit npm in six minutes.
CVE-2025-62718: Critical Axios SSRF Vulnerability Explained
A critical SSRF flaw in Axios was used in a North Korean supply chain attack. Here's what it does and how to patch it today.
What is Supply Chain Security? Dependencies, SBOMs, and the Attack That Hit 2.6 Billion npm Downloads
Your application is only as secure as every package it depends on. In September 2025, attackers compromised 27 npm packages with 2.6 billion weekly downloads by phishing one maintainer.