Latest / Decrypted: The UK Cyber Briefing / The npm worm that beats code review, and the secure default that shipped too late
Transcript
- 0:03This is Decrypted. Sunday, the sixteenth of August.
- 0:06The npm worm that beats code review, and the secure default that shipped too late.
- 0:13On 4 August, Elastic Security Labs caught a self-propagating worm quietly rebuilding itself inside more than
- 0:22400 npm packages. Among them were keyv and flat-cache, caching libraries embedded deep in Node.
- 0:31js backends everywhere. Plenty of them are run by UK organisations.
- 0:36Microsoft named the strain ChainDrop.
- 0:40It's the latest variant of the Shai-Hulud worm family, which has been chewing through the JavaScript ecosyste
- 0:47m since last autumn.
- 0:51Keyv alone accounts for around 600 million downloads a month.
- 0:56The affected packages combined are pulled well over a billion times monthly.
- 1:01But that's not what makes this week's follow-up reporting worth a second look.
- 1:05It's the two tricks ChainDrop uses to stay invisible.
- 1:09It never touches the source code anyone actually reviews.
- 1:13And it never phones home to an address anyone can block.
- 1:17Next. The parcel nobody checked.
- 1:20ChainDrop starts the way these campaigns usually do.
- 1:24A maintainer's account gets compromised, in this case the person behind keyv, and the attacker publishes a ma
- 1:31licious release.
- 1:35Rather than editing the GitHub repository, where a maintainer or a downstream user might spot something mid-r
- 1:41eview, ChainDrop rewrites the tarball.
- 1:44That's the packaged archive npm actually ships to installing machines, and it gets rewritten after it leaves
- 1:51the repository. So you read the source on GitHub and it looks clean.
- 1:55Because the source isn't what runs.
- 1:58The tarball is.
- 2:04ned off. The paperwork checks out.
- 2:06The box doesn't.
- 2:16onfiguration. It can run via an npm preinstall hook.
- 2:20Or, in a nastier twist confirmed this week, simply when a developer opens an infected repository in V S Code
- 2:27or Claude Code. Then it uses any npm token with publish rights to reinfect the next package, and the next.
- 2:35For command and control, it doesn't use a domain a firewall can blocklist.
- 2:40It reads the current address from an Ethereum smart contract the attacker can update at will.
- 2:45So blocking yesterday's server does nothing to stop tomorrow's.
- 2:49And finally. The default that came too late.
- 2:52Here's the frustrating part, through a Secure by Design lens.
- 2:57The industry had already shipped the fix.
- 2:59npm 12, released in early July, made preinstall, install and postinstall scripts opt-in rather than automati
- 3:08c. That's precisely the mechanism ChainDrop relies on to run without a click.
- 3:12Had every pipeline touching keyv been on npm 12 with scripts left off, ChainDrop's initial execution path wou
- 3:20ld have been closed before it started.
- 3:22It wasn't. Pinned build images, cached C I runners and dependency files nobody wants to touch meant much of
- 3:31the ecosystem was still running old npm, months after the safer default existed.
- 3:36As ActiveState chief executive Abby Kearns put it, this is the first campaign to notice that gap and use it
- 3:43at scale. And it won't be the last.
- 3:46So what's the lesson for UK engineering teams?
- 3:49It isn't "review dependencies more carefully".
- 3:53ChainDrop is built precisely to survive that review.
- 3:56It's to treat toolchain versions, not just application dependencies, as something patched on a schedule.
- 4:03And check now whether your C I actually enforces script-blocking, rather than merely being capable of it.
- 4:09That was Decrypted. The written version and every source are linked in the show notes.
- 4:14Thanks for listening.