Skip to main content

Two Critical Next.js RCE Flaws and How to Patch Your App

8 min read
Patch my Next.js app

We upgrade your app to a fixed Next.js release and check that React's fix is included.

Two critical remote code execution bugs and a Server Actions DoS are fixed in Next.js 16.4.1 and 15.5.28, along with React's own fix for the typed array bug. Who is affected, and which checks to run first.

On 14 October Vercel published three security advisories for Next.js. Two are rated critical for remote code execution, and one is rated high for denial of service. All three are fixed in Next.js 16.4.1, and two of them also in 15.5.28. The current releases are 16.4.5 and 15.5.29, which carry the same fixes.

What caught teams out was how quiet it stayed. For eight days none of the three was in the GitHub Advisory Database, which is what npm audit, Dependabot and the OSV-based scanners read, so a project on a vulnerable version got a clean report from all of them. React's matching advisory is still missing from that database today.

Updated November 9, 2026, with React's own advisory for the typed array bug, the public proof of concept, a way to confirm that a Next.js build carries the fix, and the current releases.

The Three Advisories at a Glance

AdvisorySeverityConditionFixed in
GHSA-2464-fhr4-w9xw (CVE-2026-96889)Critical, 9.5An SVG through Image Optimization on glibc Linux15.5.28, 16.4.1
GHSA-673q-mjm6-r5xrCritical, 9.5A use cache function returning typed arrays16.4.1
GHSA-p3m5-59mp-jv5rHigh, 8.2At least one Server Action15.5.28, 16.4.1

Severity is Vercel's CVSS 4.0 score. None of the three needs a login, and each is reachable by anyone who can send a request to the application, as long as its condition holds.

Image Optimization and the SVG Library Underneath

The bug behind the first advisory sits in a library Next.js uses to optimize images. Vercel describes it as a memory bug that can lead to remote code execution when Next.js runs on glibc-based Linux.

The CVE attached to it tells you which library. CVE-2026-96889 was published by Red Hat on 23 September and describes a use-after-free in librsvg, the SVG renderer, triggered by an SVG document whose nested XML inclusions declare the same entity twice. Next.js reaches librsvg through sharp, which bundles libvips, which uses librsvg for SVG input.

It affects every release from 10.0.0 to 15.5.27 and the 16 line up to 16.4.0. That chain also explains the workaround Vercel gives. Make sure the sharp your Next.js uses is 0.35.5 or later. sharp 0.35.5 came out on 27 September, and the libvips build it bundles carries librsvg 2.63.2, up from 2.62.91 in the build before it.

A fresh install picks up a fixed sharp by itself, and the patched Next.js releases make sure package managers do. The case to watch is the one that looks safest, an older lockfile installed with npm ci, which keeps whatever sharp it recorded. Check it directly.

npm ls sharp

Debian and Ubuntu based images such as node:22-slim use glibc. Alpine images use musl. Going by the advisory's wording, an Alpine based container is outside the code execution path. Upgrade anyway, since the same release fixes the other two.

use cache Functions That Return Typed Arrays

The second critical advisory is about the App Router with Cache Components. An application is vulnerable when it has a use cache function that returns multiple typed arrays, values such as Uint8Array or Float32Array, and the advisory says this can lead to remote code execution.

The affected range starts at 16.0.0, so the 15 line is not part of this one. Few applications will have such a function, and Vercel still asks everyone on an affected version to upgrade immediately, because there is no workaround.

Finding out takes one search.

grep -rn --include='*.ts' --include='*.tsx' --include='*.js' "use cache" app src lib 2>/dev/null

Then look at what each match returns. How these cache layers fit together is covered in our piece on Next.js caching layers.

React's Advisory for the Same Bug

The typed array bug is not specific to Next.js. React fixed it at the source on the same day and published GHSA-xqc2-xf4c-x3h3 for the three packages that implement Server Components for frameworks and bundlers, react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack. React rates it critical at 9.5 and describes the trigger the same way, a response that carries multiple typed arrays together with a value an attacker controls. An app whose React code never runs on a server is outside it.

Every affected line has a fixed release, all published to npm on 14 October.

AffectedFixed in
19.0.0 to 19.0.819.0.9
19.1.0 to 19.1.919.1.10
19.2.0 to 19.2.819.2.9
19.3.019.3.1

The same releases fix a second React advisory from that day, GHSA-h3gv-c5rc-p453, a denial of service in Server Functions rated high at 8.2.

Two things make the React advisory worth a fresh look. On 8 November a proof of concept with a ready Docker lab was published on GitHub, naming both the React and the Next.js advisory, so reproducing the bug no longer takes any research. And it still has no CVE, which keeps it out of tools that only follow CVEs. We found no report of exploitation in the wild as of 9 November, and the time to patch is before that changes.

Where these packages are ordinary dependencies, the usual command finds them.

npm ls react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack

That covers any framework or bundler plugin that lists one of them as a dependency. A tool that ships its own copy, as Next.js does, needs the check below.

Why the Version Number Will Not Tell You

Next.js does not install these packages. It bundles its own build of React inside next/dist/compiled, so npm ls finds nothing in a Next.js app, and React's fix reached Next.js users through 16.4.1 and 15.5.28.

That bundled build kept its version string through the fix. We compared the bundled server files across releases. Next.js 16.4.0 and 16.4.1 both report React 19.3.0-canary-278794d7-20261002, and 15.5.27 and 15.5.28 both report 19.2.0-canary-0bdb9206-20250818, yet only the later release in each pair contains the patched code. A scanner or SBOM tool that reads the bundled React version sees no difference between a vulnerable build and a fixed one.

So the Next.js version is the signal to trust. To confirm it on disk, search the bundled server files for the error message the fix added.

grep -l "Cannot transport a detached buffer" \
  node_modules/next/dist/compiled/react-server-dom-*/cjs/*server*.production.js

On a fixed release it lists the server files, and on 16.4.0 or 15.5.27 it prints nothing. We ran it against our own site, which is on 16.4.5, and it lists them there.

Server Actions Can Be Made to Burn CPU

The third advisory is rated high, one step below the other two, and it is the one most applications are actually exposed to. Crafted requests aimed at an App Router application with at least one Server Action can push CPU usage high enough that the process stops handling anything else.

Server Actions are everywhere in App Router code. Any form that posts to an action function counts, and so does any file that starts with 'use server'. The Pages Router is not affected, and neither is an App Router application without Server Actions.

This search lists the files that define them.

grep -rln --include='*.ts' --include='*.tsx' "use server" app src 2>/dev/null

This range starts at 13.0.0, further back than the other two. The advisory lists two fixed releases, 15.5.28 and 16.4.1, and none on the 13 or 14 lines, so an application still on either of those has to move to 15.5.28 or later. Vercel states that no workaround exists besides upgrading.

Why npm audit Stayed Quiet

GitHub keeps two kinds of advisory. A repository advisory is published by a project's maintainers on their own repository, and these three were published on vercel/next.js. The GitHub Advisory Database is the global list, and a repository advisory reaches it only after GitHub's own team reviews it.

npm audit gets its data from the npm registry, which serves the reviewed global database. Dependabot alerts are raised from reviewed advisories as well, and OSV.dev imports the same set. Until that review happens, the usual tools have nothing to report. On 16 October the global database and OSV.dev both returned not found for all three IDs, and npm audit on a lockfile pinned to Next.js 16.3.8 listed no Next.js advisory at all.

GitHub reviewed the three on 22 October, and npm audit has listed them since. React's GHSA-xqc2-xf4c-x3h3 has not made the same trip. On 9 November the global database and OSV.dev still returned not found for it, and npm's advisory service had nothing for react-server-dom-webpack 19.2.8, a vulnerable version.

The repository advisories can be read directly, without waiting for the review. React publishes its own on react/react.

gh api "repos/vercel/next.js/security-advisories?per_page=10&sort=published&direction=desc" \
  --jq '.[] | [.ghsa_id, .severity, .published_at[0:10], .summary] | @tsv'
gh api "repos/react/react/security-advisories?per_page=10&sort=published&direction=desc" \
  --jq '.[] | [.ghsa_id, .severity, .published_at[0:10], .summary] | @tsv'

This gap is why our own nightly vulnerability scan reads the repository advisories of every production dependency next to the usual lockfile scanners, and reports the ones GitHub has not reviewed yet. These three showed up there while osv-scanner and npm audit on the same lockfile stayed quiet.

Checking and Fixing Your App

The fix is the upgrade, and on the 16 line it is one command.

npm install next@16.4.5 eslint-config-next@16.4.5

On the 15 line, install next@15.5.29. Both also carry the fixes from the November Next.js security release. Then confirm what actually resolved, because a caret range in package.json says nothing about what the lockfile holds.

npm ls next sharp

Rebuild the image without cached layers and ship it through your normal deploy. A minor Next.js release can change behaviour, so it deserves the same path to production as any other change, and editing the version on a running server skips that. If something does break after the deploy, the way back is in rolling back a Next.js deploy without downtime.

Here is a short list for the next hour.

  • Read the Next.js version each app runs from the lockfile or npm ls next, never from package.json.
  • Search for use server and use cache to see which advisories apply.
  • Run npm ls sharp on anything that optimizes images.
  • Upgrade to 16.4.1 or later, or to 15.5.28 on the 15 line.
  • Outside Next.js, run npm ls for the three react-server-dom packages and move to a fixed React release.
  • Add your framework's repository advisories, and React's, to whatever you monitor, so the next one does not wait for a review.

If you run several Next.js applications and want them patched and kept that way, that is part of our security and compliance work, and Kubernetes for Next.js covers the build and rollout side.

Sources: GHSA-2464-fhr4-w9xw, GHSA-673q-mjm6-r5xr, GHSA-p3m5-59mp-jv5r, React GHSA-xqc2-xf4c-x3h3, React GHSA-h3gv-c5rc-p453, CVE-2026-96889 on CVE.org, sharp-libvips v1.3.4 release notes

Frequently asked questions

Which Next.js versions fix the three security advisories from October 2026?

Next.js 16.4.1 fixes all three advisories Vercel published on 14 October 2026, and 15.5.28 fixes the two that affect the 15 line. Both releases also carry React's fix for GHSA-xqc2-xf4c-x3h3 in the copy of React that Next.js bundles. As of 9 November 2026 the newest releases were 16.4.5 and 15.5.29, which include the same fixes. On the 16 line, upgrade with npm install next@16.4.5 eslint-config-next@16.4.5, then confirm what resolved with npm ls next sharp, since a caret range in package.json says nothing about what the lockfile holds.

What is CVE-2026-96889 and how does it reach Next.js?

CVE-2026-96889 is a use-after-free in librsvg, the SVG renderer, triggered by an SVG document whose nested XML inclusions declare the same entity twice. Red Hat published it on 23 September 2026. Next.js reaches librsvg through sharp, which bundles libvips, which uses librsvg for SVG input. Vercel's advisory GHSA-2464-fhr4-w9xw rates the resulting Image Optimization bug critical with a CVSS 4.0 score of 9.5 and says it can lead to remote code execution on glibc-based Linux, so an Alpine container, which uses musl, is outside the code execution path going by the advisory's wording.

What is the React advisory GHSA-xqc2-xf4c-x3h3?

GHSA-xqc2-xf4c-x3h3 is React's advisory for an unauthenticated remote code execution bug in React Server Components, published on 14 October 2026 with a CVSS 4.0 score of 9.5. It covers react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack from 19.0.0 to 19.0.8, 19.1.0 to 19.1.9, 19.2.0 to 19.2.8 and 19.3.0, with fixes in 19.0.9, 19.1.10, 19.2.9 and 19.3.1. React says it arises only when a response carries multiple typed arrays together with an attacker-controlled value, the same condition behind the Next.js advisory GHSA-673q-mjm6-r5xr. It has no CVE, and a public proof of concept appeared on GitHub on 8 November 2026.

How do I check whether my Next.js app uses a fixed version of sharp?

Run npm ls sharp in the project. Vercel's workaround for GHSA-2464-fhr4-w9xw is sharp 0.35.5 or later, released on 27 September, whose bundled libvips carries librsvg 2.63.2, up from 2.62.91 in the previous build. A fresh install picks up a fixed sharp by itself, and the patched Next.js releases make sure package managers do. The risky case is an older lockfile installed with npm ci, which keeps whatever sharp version it recorded.

Is Next.js 15 affected by GHSA-673q-mjm6-r5xr?

No, GHSA-673q-mjm6-r5xr only affects the 16 line, starting at 16.0.0, and is fixed in 16.4.1. An App Router application with Cache Components is vulnerable when a use cache function returns multiple typed arrays, such as Uint8Array or Float32Array, which can lead to remote code execution. Vercel rates it critical with a CVSS 4.0 score of 9.5 and gives no workaround. Next.js 15.5.28 still patches the same code in its bundled copy of React, so the 15 line belongs on 15.5.28 or later too.

Which Next.js apps are affected by the Server Actions DoS GHSA-p3m5-59mp-jv5r, and how are they patched?

Any App Router application with at least one Server Action is exposed on releases going back to 13.0.0, where crafted requests can push CPU usage high enough that the process stops handling anything else. A form that posts to an action function counts, and so does any file starting with 'use server', while the Pages Router is not affected. Vercel rates it high, with a CVSS 4.0 score of 8.2, and lists two fixed releases, 15.5.28 and 16.4.1, with none on the 13 or 14 lines. An app on 13 or 14 has to move to 15.5.28 or later, since no workaround exists besides upgrading.

How can I tell whether a Next.js build carries React's fix for GHSA-xqc2-xf4c-x3h3?

Go by the Next.js version, because the React build that Next.js bundles reports the same version string before and after the fix. Next.js 16.4.0 and 16.4.1 both bundle React 19.3.0-canary-278794d7-20261002, and 15.5.27 and 15.5.28 both bundle 19.2.0-canary-0bdb9206-20250818, yet only 16.4.1 and 15.5.28 contain the patched server code. npm ls react-server-dom-webpack finds nothing in a Next.js app, since the package lives inside next/dist/compiled. Searching the bundled server files for the error message Cannot transport a detached buffer confirms the fix on disk.

Why did npm audit not report the October 2026 Next.js advisories?

npm audit, Dependabot and OSV.dev all draw on the reviewed GitHub Advisory Database, and the three Next.js advisories were published as repository advisories on vercel/next.js, which reach the global database only after GitHub's own team reviews them. GitHub reviewed them on 22 October 2026, eight days after publication, and npm audit has reported them since. React's GHSA-xqc2-xf4c-x3h3 was still missing from the global database and from OSV.dev on 9 November 2026, so a project that installs react-server-dom-webpack 19.2.8 directly still gets a clean npm audit.

Read how we handle it in Cybersecurity.