All Stories
npmsystem-compromised

How an AI-hallucinated npm package almost took down our production API

by devghost_99May 29, 2026

The Setup

It was 2am on a Friday. Our startup was two weeks from launch and I was frantically asking ChatGPT how to add rate limiting to our Express API.

The AI confidently suggested npm install express-rate-limiter-pro with a complete code example. It looked perfect.

What Happened

I installed it, the tests passed, I pushed to main. By Saturday morning, our database credentials had been exfiltrated. Our Postgres password was changed. We were locked out of production.

The Discovery

A colleague Googled express-rate-limiter-pro — zero results on npm. The package the AI suggested did not exist as a legitimate library. Someone had registered it knowing AIs would recommend it.

The install script ran a curl command to an external server before doing anything else.

The Aftermath

We spent 72 hours rotating every credential. We lost two enterprise pilot customers who found out during our security audit.

Lesson Learned

Always verify that a package actually exists and has real downloads before installing it.

Now we run DevHorrors scanner on every package.json before merging PRs.

Involved package: express-rate-limiter-proCheck in scanner →
Was this story helpful?