Lesson 4 of 14 · 14m
The Maintainer Is the Attack Surface
event-stream to node-ipc: accounts get phished, handed off, expired, and turned — re-derive trust on every update.
Every package is a person with a password
event-stream was downloaded two million times a week in 2018 — a flat, boring streams utility maintained by Dominic Tarr for years. When a user named right9ctrl offered to take over maintenance, Tarr handed him npm publish rights. In September 2018 the new maintainer shipped event-stream@3.3.6, which added a dependency: flatmap-stream@0.1.1. That dependency's minified source contained an encrypted payload that decrypted at runtime only inside the build tree of Copay, BitPay's bitcoin wallet — where it stole private keys and sent them to a server. It was caught in November when a user traced a deprecation warning to the injected dependency and filed a GitHub issue. Nothing about the attack needed a vulnerability in code. It needed trust, and trust transferred with the account. Two million weekly downloads turned out to be a measure of exposure, not of safety.
How accounts actually fall
The takeover methods repeat because they work:
- Credential reuse. The October 2021
coa/rc/ua-parser-jshijacks ran through maintainer npm accounts without 2FA — stolen or reused passwords, straight publish rights. - Token theft.
eslint-scope@3.7.2(July 2018) shipped apostinstallthat mailed the victim's~/.npmrcauth token to a pastebin — then used stolen tokens to publisheslint-config-eslint@5.0.2. - Expired infrastructure. PyPI's
ctxand Packagist'sphpassfell in May 2022 when the original authors' email domains lapsed; the attacker registered the domain, issued a password reset, owned the accounts. - The maintainer themselves.
node-ipc(March 2022) shippedpeacenotwarin versions 10.1.1/10.1.2 — code that overwrote files on machines geolocated to Russia/Belarus.vue-clidepended on it transitively. And in January 2022, Marak Squires deliberately broke his owncolors(infinite garbage loop) andfaker(6.6.6, emptied) packages in protest, breaking thousands of builds. Insider sabotage doesn't need an attacker at all.
The wrong mental model
"Popular packages with real maintainers are safe." Popularity measures download volume, and the trust you're actually extending is to whoever can publish the next version — an account, possibly an account that changed hands last Tuesday. Stars are not a control. Neither is history: event-stream had eight years of honest maintenance before 3.3.6.
The ecosystem has started to price this in. npm began requiring 2FA for high-impact packages in May 2022. PyPI rolled out mandatory 2FA — first for the top 1% of projects in August 2022, then for every publisher through 2023–2024. Trusted Publishing (PyPI's OIDC-based token-less publish from GitHub Actions, GA in 2023) removes the stored-API-token attack entirely.
What to do with that
- Watch ownership, not just versions.
npm owner ls <pkg>— when the owner list changes, treat the next release like a new package. Some teams diffnpm view <pkg> timerelease metadata per bump for exactly this; tooling like Socket and Snyk flag maintainer changes as a first-class signal. - Cool down. Most poisoned releases get pulled within days. Renovate's
minimumReleaseAge, Dependabot'scooldownoption, and pnpm'sminimumReleaseAgesetting all exist to let the ecosystem find a bad release before your pipeline installs it. Set it to days, not hours, and exempt security fixes deliberately rather than never cooling down. - Diff the update.
npm diff --diff=pkg@1.2.3 --diff=pkg@1.2.4shows what you're actually about to run. For bumps that touchscripts, add binaries, or balloon in size, read it. - Prefer tokenless publishing upstream. A package published via OIDC trusted publishing can't ship from a stolen password — there is no password.
You don't audit a maintainer once at adoption. You re-derive trust on every update, because what updates is the account's current occupant — not the package's history.
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.