Upgrade Next.js to 16.4.1 or later

Critical Next.js RCE in 'use cache' functions affects 16.0.0 to 16.4.0 · Security incident · GitHub advisory · vercel · Oct 14, 2026

What happened

The Next.js team published a critical advisory (GHSA-673q-mjm6-r5xr, CVSS 9.5) on 14 Oct. Apps on Next.js 16.0.0 to 16.4.0 that use the App Router with Cache Components can allow unauthenticated remote code execution if they have a use cache function that returns multiple typed arrays. The fix is 16.4.1. The advisory lists no workaround and says to upgrade even if you don't believe you have such a function.

How to prevent it

Most AI app builders generate Next.js apps, so watch for framework advisories and update dependencies as soon as a critical fix lands. Turn on Dependabot or a similar alert for your repo.

Fix prompt for your own AI tool

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

My app was built with an AI tool and uses Next.js. A critical remote code execution advisory (GHSA-673q-mjm6-r5xr, 14 Oct 2026) affects Next.js 16.0.0 to 16.4.0 for apps using the App Router with Cache Components and a use cache function that returns typed arrays. 1) Check which Next.js version my project uses in package.json and the lock file. 2) If it is between 16.0.0 and 16.4.0, show me how to upgrade to 16.4.1 or later and test the build. The advisory says there is no workaround and to upgrade even if I don't think I use such a function. 3) Search my code for use cache functions so I understand my exposure. 4) Check that my host redeploys with the new version and that no old preview deployments stay public. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.

Why this keeps happening: leaked secrets & api keys

Secret keys placed in front-end code, mobile bundles or public repositories can be found by automated scanners and abused, often running up large bills on AI or cloud accounts before anyone notices.

A quick checklist before you ship

More on this: every leaked secrets & api keys story and our related guide.

Tools involved

Next.js stories, Vercel stories

Related stories

Source: original post on GitHub advisory ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime. Weekly, every Friday.