Back to articles
engineering

Is waiting 3 days for npm updates too much? I wanted numbers, not a feeling

By Daniel Chavez

Today I was fixing the security warnings across all eight of my repos and five of the fixes couldn't go in, because every project I build waits 3 days before it installs a new npm version, and those fixes were only a day or two old. So I asked myself if 3 days is too much, a commercial web app I worked on used 1 day, and to be honest my first answer was a guess.

I think a decision like this needs numbers and not assumptions, so I went and got them.

What did I check?

Every npm compromise I could find from 2018 to today, 48 of them, from event-stream to the Shai-Hulud worms to axios and TanStack this year. For each one I looked up when the bad version was published on the npm registry, when someone noticed, and when it stopped being installable, with a source for every time.

What did the numbers say?

30 of the 41 with a known end were gone within a day, most of the recent ones in 2 to 9 hours, so 1 day would have protected me from most of them. But 4 lasted between 1 and 3 days, and three of those started between Friday night and Sunday, when nobody's looking, and I don't want my builds to depend on someone being online on a Saturday.

Past 3 days it's a different kind of attack, ones that sat quietly for weeks or months on purpose, so going to 7 days barely helps and keeps every real fix out for a whole week. I already learned that one, WarpKit used to wait 7 days and that would have kept a TanStack Start security fix out for a week in October, so I lowered it to 3.

So what did I decide?

I'm keeping 3 days, and now I know why. When a fix really can't wait, I check that it was published from the project's own CI and install just that once with the gate lowered on the command line, so the setting itself never changes.

The whole table with every attack and its sources is on warpkit.dev, since the gate ships with WarpKit and anyone using it gets the same protection.