Critical Next.js and React vulnerabilities: which version to run now
Two critical remote code execution flaws hit Next.js in October, and the React one now has a CVE. Which versions fix them, and a patch routine for self-hosted apps.
If you run a Next.js app on your own server, check its version this week. On 14 October, Next.js fixed two critical vulnerabilities that let an attacker without a login run code on the server. On 10 November the React part of one of them got a CVE number, CVE-2026-126187, with a score of 9.5, so vulnerability scanners now flag it. And a second batch of Next.js fixes followed on 3 November.
What was fixed in October
The October security update released Next.js 16.4.1 and 15.5.28. It fixed three problems:
| Advisory | What it allows | Who is affected | Fixed in |
|---|---|---|---|
use cache with typed arrays (React: CVE-2026-126187) |
Code execution without a login | Next.js 16.0.0 to 16.4.0, App Router with Cache Components | 16.4.1 |
| Image Optimization with SVG (CVE-2026-96889) | Code execution without a login | Next.js 10.0.0 to 15.5.27 and 16.x up to 16.4.0, on glibc-based Linux | 15.5.28, 16.4.1 |
| Server Actions denial of service | Crafted requests block the server process | App Router apps with at least one Server Action | 15.5.28, 16.4.1 |
The first one is the flaw that now has a CVE. The root cause is in React itself: the
React advisory covers
react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack from
19.0.0 to 19.3.0, fixed in 19.0.9, 19.1.10, 19.2.9 and 19.3.1. React calls the vulnerable case
“extremely rare”: a response must carry multiple typed arrays and a value the attacker controls.
Next.js still tells everyone on 16.x to upgrade, “even if your application does not have similar
functions”, because there is no workaround.
The image flaw is the one more apps will have. It sits in an image library that Next.js uses
through sharp, and it affects almost every Next.js version from the last six years when the app
runs on a normal Linux server or a Debian-based Docker image. Alpine images use musl, not glibc.
The advisory’s workaround is to make sure your app uses sharp 0.35.5 or later.
Is anyone exploiting it?
Not as far as we know. CISA’s assessment in the CVE record says “exploitation: none” as of 13 November, and neither flaw is in CISA’s Known Exploited Vulnerabilities catalog.
That can change fast. Last year’s React Server Components flaw, known as React2Shell, was disclosed on 3 December 2025 and added to the CISA catalog two days later. CISA now lists it as used in ransomware campaigns. A CVE number makes a flaw easier to find for attackers and for scanners alike, so don’t wait for the first report of an attack.
The November release: cache leaks between users
The November security release
(16.4.5 and 15.5.29) fixed seven more issues. None allows code execution. Most of them affect
apps with Cache Components enabled, where a cached result for one user or tenant could be served
to another. The worst one, rated high, leaks data between tenants when the same use cache
function is called both directly and inside unstable_cache. If your app serves several customers
from one codebase and uses root parameters to separate them, take this one seriously.
Which version should you run?
- Next.js 16: 16.4.5 or later. That includes both the October and the November fixes.
- Next.js 15: 15.5.29 or later. Version 15 is in maintenance, and according to the support policy security releases continue until 31 January 2027. Plan the move to 16 before then.
- Next.js 14 and older: no longer supported, so there is no patched release. The image flaw
affects these versions too. Apply the
sharpworkaround now and plan an upgrade. - Other frameworks with React Server Components: update the
react-server-dom-*package to one of the fixed React versions above.
Check what you actually run, not what package.json says. In the project folder,
npm ls next sharp react-server-dom-webpack shows the installed versions. For a Docker
deployment, run the same command inside the running container, because an old image keeps its
old node_modules until you rebuild it.
What to do now
- Upgrade to 16.4.5 or 15.5.29, run your tests and deploy.
- Rebuild every image that contains a Next.js app, including internal tools and staging environments that nobody looks at.
- Check
sharpwithnpm ls sharp. It must be 0.35.5 or later. - Review Cache Components if you run a multi-tenant app: check which
use cachefunctions read a tenant or user value. - Look at your logs for unusual requests and crashes since mid-October if an app was exposed for weeks. Patching closes the hole, but doesn’t tell you whether someone used it.
A patch routine that keeps up
October and November each brought a Next.js security release, and both were announced a week in advance. That makes a routine easy to plan:
- Follow the Next.js blog or the security advisories on GitHub, and block an hour in the week of each announced release.
- Let Dependabot or Renovate open pull requests for
next,reactandsharp, and merge security updates within days, not at the end of the sprint. - Pin exact versions in the lockfile and rebuild images from scratch, so the fixed version really ends up in production.
- Keep one supported major version. Moving from 15 to 16 in January under time pressure is harder than doing it in December.
The same routine applies to the runtime underneath. Earlier this month we wrote about Node2Shell, a flaw in Node.js itself that also required rebuilt images.
How we approach this
Most of the web applications we build are internal tools and portals that run on the client’s own infrastructure. Those are exactly the apps that get built once and then left alone. We hand them over with pinned versions, automated update pull requests and a short checklist for the monthly update slot. In a private AI workspace, the web front end is also the gate to the organisation’s data, so a code execution flaw there is not a small problem. If you’re not sure which version your apps run or who is responsible for updating them, that’s a good first question to answer.
Sources
- Next.js Security Update for Upstream Vulnerabilities, Next.js, 14 October 2026
- Unauthenticated Remote Code Execution in React Server Components (GHSA-xqc2-xf4c-x3h3), React, 14 October 2026
- Unauthenticated Remote Code Execution in use cache functions returning typed arrays (GHSA-673q-mjm6-r5xr), Next.js, 14 October 2026
- Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used (GHSA-2464-fhr4-w9xw, CVE-2026-96889), Next.js, 14 October 2026
- CVE-2026-126187, NVD, published 10 November 2026
- November 2026 Security Release, Next.js, 3 November 2026
- Support Policy, Next.js
- Known Exploited Vulnerabilities Catalog, CISA
- Critical Security Vulnerability in React Server Components, React, 3 December 2025