Next.js needs its fourth security fix in six weeks, and the newest holes pile up in one caching feature

On November 3, Next.js shipped seven security fixes in versions 16.4.5 and 15.5.29. Four sit in a speed-up feature called Cache Components, and three only hit sites that run their own servers.

Listen to this story
3:56

On November 3 the Next.js team shipped its November security release, fixing seven problems in versions 16.4.5 and 15.5.29. Next.js is the free toolkit for building websites that Jon's site is built on. The team had warned on October 27 that seven medium-severity fixes were coming. A day before the release, 16.4.4 shipped bug fixes only, and its notes said the security fixes would follow.

This is the fourth Next.js security release in six weeks. A critical hole in its next/og image tool was fixed on September 22, a batch of seven followed on September 30, and an unscheduled update on October 14 closed two critical holes that could let an attacker run code on a server. One of those sat in use cache, a line that tells Next.js to save a function's answer and reuse it.

That caching feature is the theme again. Four of the seven new problems live in use cache and Cache Components, the setting that turns it on. In each, a saved answer meant for one visitor, account or language can be handed to another: binary arguments that share one cache key, nested cached functions that drop a route setting, a race when use cache runs inside the older unstable_cache, and a shared page shell that one request can poison.

The other three are narrower. Edge routes, a lighter kind of server code, copied cookies into a header that page scripts can read, even cookies marked HttpOnly, which means hidden from scripts. The image resizer could be tricked into opening an SVG file with SVGs switched off. And apps that pass along another server's reply unchanged could mix up replies between visitors behind certain proxies. Those last two, and the page-shell bug, name self-hosted setups: sites that run their own servers instead of using a host like Vercel.

Jon's agents checked his site the same day. It runs 16.4.2, inside the affected range of all seven. But the fleet read the site's code and found no use cache, no Cache Components and no Edge routes, and the site runs on Vercel. It does resize pictures, only from its own media bucket and with SVGs off. So none of the seven reach the site as it is built today, and the move to 16.4.5 is routine upkeep, not an emergency.

How to use it

  1. Check the installed version: npm ls next. Every 16 release before 16.4.5 and every 15 release before 15.5.29 is in range of at least one of these.
  2. Upgrade: npm install next@16.4.5, or npm install next@15.5.29 on 15.5. It costs nothing.
  3. To see which fixes matter, search the code for use cache, cacheComponents and runtime = 'edge'. No hits means the four cache bugs and the cookie bug do not apply.
  4. If the upgrade has to wait: partialPrefetching: true in the config blocks the page-shell bug, and never calling a use cache function from inside unstable_cache avoids the race.
  5. Or hand it to a coding agent: Next.js 16.4 added npx next@canary upgrade --agent=latest, which plans the upgrade and the checks after it.

The catch: from 16.3 or older, the fix arrives with a whole minor release of other changes, so run the full tests before it ships.

What nobody knows yet

  • Whether anyone has used these holes against real sites. The advisories do not say.
  • How serious the unstable_cache race is. GitHub lists it as medium, while the team's own post calls it high.
  • Whether the cookie bug behaves differently on Vercel. Its advisory names no host.

What to watch

  • Next.js 16.5 is in testing as a canary, an early preview build. The November post calls 16.4 "Active LTS", short for long-term support, and 15.5 "Maintenance LTS". Until now, fixes landed only on the newest 16 minor and on 15.5. When 16.5 ships, watch whether 16.4 keeps getting fixes or apps must jump again.
  • The next scheduled release. The last two came five weeks apart, on September 30 and November 3, and the November one got seven days' notice on the security page.

Sources

Comments

No comments yet.

Sign in to comment. You'll come back to this story.