← All writing

2 min readSecurityNext.jsDependencies

The patch that needed a patch

In December 2025 Next.js shipped security fixes three times in nine days, and one of them was incomplete. What our dashboard upgrade taught me about reading advisories and lockfiles.

Our merchant dashboard runs on Next.js with the App Router. In December 2025 it went through three security releases in a little over a week. The one GitHub flagged for us looked routine. Bump next from 15.5.7 to 15.5.8. The interesting part was why 15.5.8 wasn’t actually the answer.

The timeline

  • Early December: a critical remote code execution flaw in React Server Components (CVE-2025-66478 for Next.js). Patched in 15.5.7 for our release line. We were already on it.
  • 11 December: two more advisories. CVE-2025-55184, a crafted request that could hang the server (denial of service). And CVE-2025-55183, which could expose the compiled source of Server Functions. Patches went out the same day.
  • Hours later: the denial-of-service fix turned out to be incomplete. It got its own CVE, CVE-2025-67779, and new releases. For 15.5 that meant 15.5.9. Anyone who upgraded in that first window had to upgrade again.

What our fix actually installed

The Dependabot alert suggested ^15.5.8, and that’s what went into package.json. But the caret (^) means “this version or any later compatible one”, and by the time the lockfile was regenerated, npm resolved it to 15.5.9. That was the version with the complete fix.

So the manifest said one version, and the app ran another, better one. That was luck, not a plan. Had the lockfile been generated a few hours earlier, we’d have shipped the incomplete patch while believing we were done.

What I learned

  • The lockfile is the truth. package.json says what you’ll accept. package-lock.json says what you’ll run. After a security bump, check the resolved version (npm ls next) against the advisory’s fixed versions.
  • Read the advisory, not just the alert. The alert says “upgrade to X”. The advisory says which versions are affected, which are fixed, and sometimes, “if you upgraded during this window, upgrade again”.
  • Security releases cluster. One serious bug in a component draws researchers to it. After a big fix, expect follow-ups for a week or two, and check again before you call it closed.
  • Know which features you use. The source-exposure bug only mattered for apps using Server Actions. Knowing your own surface area turns “are we affected?” from a guess into a quick search.
↑↓ move↵ openesc close