← All guides

Is My Next.js Version Vulnerable? React2Shell and the 2026 Next.js Security Patches Explained (Which Version to Upgrade To)

Updated 2026-11-26

Short answer: as of November 26, 2026, a Next.js app is on a patched release if it runs Next.js 16.4.5 or later (16.4.6 is the current latest) or 15.5.29 or later on the 15.x maintenance line. Anything older that uses the App Router is exposed to at least one known critical or high severity issue, including React2Shell (CVE-2025-55182 / CVE-2025-66478, remote code execution, CVSS 10.0) and the October 2026 remote code execution fixes. Check the version in node_modules/next/package.json, upgrade with npm install [email protected] (or [email protected]), redeploy, and rotate secrets if an unpatched App Router app was online after early December 2025.

v0, Cursor and Replit projects are often Next.js App Router apps, and many of them were generated once and never upgraded. The template still works, so nobody notices that the framework underneath has had several serious advisories. This guide walks through what happened, who is affected, and the exact upgrade.

Timeline of the advisories that matter

December 3, 2025: React2Shell. A flaw in how React Server Components (RSC) deserialize requests allowed unauthenticated remote code execution. React tracked it as CVE-2025-55182 and Next.js as CVE-2025-66478, rated CVSS 10.0. It affected Next.js 15.x, 16.x and 14.3 canaries using the App Router. Public exploits appeared within days and attacks were seen in the wild. First fixes: 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7 and 16.0.7.

December 11, 2025: follow-up RSC bugs. Researchers studying the patch found a denial of service (CVE-2025-55184, completed as CVE-2025-67779) and a source code exposure issue (CVE-2025-55183) where a crafted request could make a Server Function return the compiled code of other Server Functions. That second one matters if you hardcoded secrets in server code. Fixed in 14.2.35, 15.0.7, 15.1.11, 15.2.8, 15.3.8, 15.4.10, 15.5.9 and 16.0.10.

October 14, 2026: two more critical RCEs. Next.js 16.4.1 and 15.5.28 fixed:

November 3, 2026: cache and header issues. Next.js 16.4.5 and 15.5.29 fixed several high and medium issues, mostly around Cache Components (use cache results leaking across tenants or users), an x-middleware-set-cookie header in Edge routes that exposed cookie values to same-origin JavaScript, and an SVG check bypass in image optimization.

Important detail: the 2026 releases only shipped for the 16.4 (Active LTS) and 15.5 (Maintenance LTS) lines. If you are on 14.x, or 15.0 to 15.4, or 16.0 to 16.3, there is no patch release in your line for the October and November fixes. You need to move to 15.5.29 or 16.4.5 and newer.

Am I affected?

Work through these in order:

  1. Do you use Next.js at all? Lovable and Bolt projects are usually Vite plus React single page apps. Those have no React Server Components on a server, so the RSC issues do not apply (your risk is more likely in Supabase RLS and exposed keys). v0 projects are almost always Next.js App Router.
  2. App Router or Pages Router? An app/ directory means App Router. The RSC bugs (React2Shell, the December 2025 follow-ups, the use cache RCE, the Server Action DoS) affect the App Router. Pages Router only apps were not affected by those, though the image optimization issue and others still apply, so upgrade anyway.
  3. Static export? If next.config has output: "export" and you host plain files, there is no Next.js server to attack. Server side issues do not apply.
  4. Which version is actually deployed? Your package.json might say ^15.1.0 while the lockfile pins something else. Check what is installed:
npm ls next
# or
node -p "require('next/package.json').version"

If the result is below 16.4.5 on the 16 line, or below 15.5.29 on the 15 line, you are behind.

How to upgrade

For most apps on Next.js 15 or 16, upgrading to the newest 16.4 release is the cleanest path:

npm install [email protected] react@latest react-dom@latest
npm run build

If a jump to 16 breaks too much right now, stay on the maintenance line:

npm install [email protected]

Then:

There is no configuration flag, WAF rule or middleware change that replaces upgrading. Hosting platform firewall rules helped during the React2Shell rollout, but Next.js was explicit that upgrading is required.

Keep it patched automatically

The reason so many AI-built apps are still on old versions is that nothing tells the owner. Fix that once:

# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
    groups:
      nextjs:
        patterns: ["next", "react", "react-dom", "eslint-config-next"]

Also turn on Dependabot security alerts in the repo settings, and run npm audit --omit=dev before each launch. Watch the Next.js blog, which now announces security releases about a week ahead.

If you ran an unpatched version in production

React2Shell had working public exploits and was exploited at scale. If an App Router app on an affected version was reachable from the internet after early December 2025, assume the server environment may have been read:

  1. Upgrade and redeploy first.
  2. Rotate every secret the server could read: Supabase service role key, database URL, Stripe secret and webhook secrets, OpenAI and other AI keys, auth secrets. Our guide on rotating leaked Supabase, OpenAI and Stripe keys covers the order and the gotchas.
  3. Review host logs for unexpected POST requests with Next-Action headers or odd RSC payloads, new outbound connections, and unexpected processes or files on self hosted servers.
  4. Check provider dashboards (Stripe, OpenAI, Supabase) for usage you do not recognize.
  5. Move any secrets hardcoded in source into environment variables, since the source exposure bug could reveal inlined values.

Related Next.js issues worth checking

Older apps often carry other known problems. The Next.js middleware auth bypass (CVE-2025-29927) let attackers skip middleware entirely on versions before 15.2.3 and 14.2.25, which is why auth should also be checked inside each route and action. See Next.js Server Actions security and securing Next.js API routes for that second layer.

Get an automated check

Upgrading Next.js closes framework bugs, but most problems in AI-built apps live in the app code itself. PreflightPR checks for leaked keys, missing Supabase RLS, unauthenticated routes and Server Actions, and unsigned Stripe webhooks. Run a free scan on a public repo for a launch score and a prioritized fix list, or install the PreflightPR GitHub App to check every pull request before it merges. It's an automated best-effort review, so still confirm your deployed Next.js version with the commands above.

Check your repo in about a minute

Paste a public GitHub URL and get a free launch score.

Run a free scan

More guides