Home
Tech·

83 Million Devs Just Got a Trojan From npm

Watch this as a video

I just published a video about how AI has sucked all the joy out of programming. Turns out it's sucking the safety out of it too.

Let's talk about Axios.

The Scale of the Problem

If you've done any frontend work — hitting APIs from a browser — you've almost certainly used Axios. It's dead simple, widely trusted, and pulls 101 million weekly downloads on npm. That's 101 million times a week this library gets dragged into someone's code.

Does it do anything you can't already do with the native fetch API that's been in browsers for a decade? Not really. But it's convenient, it's got some nice ergonomics around it, and people love it. I'm not here to relitigate Axios vs. fetch.

I'm here because on March 31st, two Axios versions — 1.14.1 and 0.30.4 — were published with an injected fake dependency called plain-crypto-js. A Trojan horse, shipped to roughly 83 million users.

What Actually Happened

The main Axios maintainer, Jason, appears to have had a long-lived npm publish token compromised. This is a supply chain attack, plain and simple.

Here's how it works: when you set up a CI/CD pipeline, you create an auth token so the pipeline can publish packages without you manually logging in every time. Makes total sense — you don't want to re-authenticate on every release. The problem is when that token never expires, nobody's auditing it, and someone gets their hands on it.

Once the attacker had that token, they could publish to npm on the maintainer's behalf. And that's exactly what they did.

The malicious dependency, plain-crypto-js, came bundled with a post-install script. Post-install scripts are a legitimate npm feature — they let packages run setup steps after installation, like compiling native bindings for your specific OS. But anything that can execute arbitrary code on your machine is exploitable. And it was.

npm Is the Biggest Weakness of the Internet

There's a Reddit take floating around calling this an "unpopular opinion," but honestly it's just correct.

Before npm, we treated adding dependencies as something selective, something we had to study and choose very carefully. Now I install a popular library and it comes with 300 other unwanted dependencies, some of which don't even seem to make any sense for the tool I'm downloading.

This is the core issue. You install Axios — that's not the only thing landing on your machine. Axios has dependencies, those dependencies have dependencies, and somewhere in that tree, a compromised package called plain-crypto-js quietly showed up and ran code on your system.

Every package you install nowadays seems to pull in another 50. The attack surface is enormous.

The AI Angle

AI makes this worse in two directions. It's easier than ever to generate more code than we're comfortable reviewing. And it's easier to kick off an agent to find vulnerabilities, discover exploits, and craft these kinds of attacks.

This isn't going to stop. It's going to get more frequent.

What To Do Right Now

Check your projects. If you're on Axios 1.14.1 or 0.30.4, you're on a compromised version. Both have been pulled from npm and the GitHub releases.

Here's the irony: the security best practice is "always update everything" because new versions patch zero-days and fix bugs. In this case, the newest version was the attack. So "update" here actually means downgrade back to the last safe release.

Stay safe out there. Audit your dependencies. And maybe think twice about that next npm install.