Published on

TIL: a pnpm override fixes a pinned transitive Dependabot alert

TIL: a pnpm override fixes a pinned transitive Dependabot alert
Authors
On this page

Dependabot flagged engine.io below 6.6.10, a denial-of-service issue. Funny thing is, I never installed it. It came in through socket.io, and only as a dev dependency.

The obvious fix that did nothing

I tested the one you'd try too:

pnpm update engine.io@6.6.10 -r

Nothing moved. socket.io pins engine.io at 6.6.9, so pnpm kept it right there. That's the trap with transitive dependencies: the parent decides, not you.

The one-line fix

An override in package.json wins the argument. I added it next to the ones I already had:

"pnpm": {
  "overrides": {
    "engine.io@>=6.6.0 <6.6.10": ">=6.6.10"
  }
}

Then reinstall without the frozen lockfile so it can rewrite itself:

pnpm install --no-frozen-lockfile
pnpm why engine.io
Before and after: socket.io pinned engine.io at 6.6.9; with the pnpm override, pnpm why shows engine.io 6.6.11 under socket.io and the alert closes.

pnpm why showed engine.io 6.6.11 under socket.io. The build passed, and GitHub marked the alert fixed with zero open.

The lesson

Check pnpm why before you trust that the alert is gone. The lockfile is the proof, not the green badge.