Skip to content

Still on Next.js 14? There is no patch for October's RCE flaws

Update/ 14 min read

October's RCE fixes shipped in 16.4.1 and 15.5.28, with nothing for Next.js 14. What affects you, how to check the sharp Next loads, and a tested upgrade plan.

  • Next.js
  • Migration
  • Security
In this article (9)
  1. What happened on October 14: two critical remote code execution flaws
  2. RCE 1: use cache with Cache Components
  3. RCE 2: sharp on glibc-based Linux
  4. Patched versions: 16.4.1 and 15.5.28
  5. Still on Next.js 14: a step-by-step migration plan to 15
  6. While you migrate: sharp 0.35.5 or later
  7. Common mistakes
  8. Frequently asked questions
  9. Checklist

Next.js 14 got no patch for the RCE vulnerabilities disclosed on October 14, 2026. The fixes shipped in 16.4.1 and 15.5.28. Of the two RCEs, 14.x is exposed to the image optimization one that runs through sharp, not the use cache one. The way out is upgrading to 15, with sharp 0.35.5 or later in the meantime.

This post covers what Next.js published, the version ranges in each advisory, how to check which sharp your app actually loads (with real npm output), and a step-by-step upgrade plan based on the official guide that we ran on a test app. Tomorrow, November 3, the scheduled November security release lands too: see the Next.js November 2026 security release.

What happened on October 14: two critical remote code execution flaws

On October 8, Next.js announced an out-of-band security update for three vulnerabilities in upstream dependencies: two Critical and one High. On October 14 it shipped the security update for upstream vulnerabilities, including two fixes postponed from the September release. The post is direct: updates are available in v16.4.1 (Active LTS) and v15.5.28 (Maintenance LTS). No 14.x is mentioned.

On October 20, Singapore's Cyber Security Agency echoed it in alert AL-2026-148, listing two affected ranges: 16.x before 16.4.1, and 10.x through 15.x before 15.5.28. Its advice: update to the latest versions immediately.

AdvisorySeverity (CVSS 4.0)Affected versionsFixed in
RCE in use cache functions returning typed arrays (GHSA-673q-mjm6-r5xr)Critical, 9.5>= 16.0.0, <= 16.4.016.4.1
RCE in the Image Optimization API with SVG (CVE-2026-96889 / GHSA-2464-fhr4-w9xw)Critical, 9.5>= 10.0.0, <= 15.5.27 and >= 16.0.0, <= 16.4.015.5.28 and 16.4.1
DoS in App Router with Server Actions (GHSA-p3m5-59mp-jv5r)High, 8.2>= 13.0.0, <= 15.5.27 and >= 16.0.0, <= 16.4.015.5.28 and 16.4.1
librsvg inside sharp (GHSA-wq5f-xc86-pv6w)High, 8.9sharp < 0.35.5sharp 0.35.5

The DoS advisory in the Next.js repository lists no CVE; the GitHub Advisory Database assigns it CVE-2026-94482. It hits apps that use the App Router with at least one Server Action. Pages Router apps, and apps without Server Actions, are not vulnerable, and there is no workaround besides upgrading.

which versions each October advisory affectslineRCE use cacheRCE imageDoS actionspatched16.xActive LTS≤ 16.4.0≤ 16.4.0≤ 16.4.016.4.115.xMaintenance LTSno≤ 15.5.27≤ 15.5.2715.5.2814.xunsupportednoallallnone13.xunsupportednoallallnone≤ = affected up to and including · no = outside the advisory rangelines 14 and 13: affected, with no patched releaseranges from GHSA-673q, GHSA-2464 and GHSA-p3m5 · Next.js, Oct 14, 2026

Scroll the figure sideways to see all of it

So what about 14? The Next.js support policy lists it as Unsupported, along with 13. The policy leaves a door open ("in rare circumstances" they patch versions outside LTS), but not this time: the latest 14.x on npm is 14.2.35, from December 11, 2025, and none of the October advisories names a patched 14.x. The Reel's claim holds.

RCE 1: use cache with Cache Components

The first RCE lives in apps that use the App Router with Cache Components. Per GHSA-673q-mjm6-r5xr, a use cache function that returns multiple typed arrays can lead to unauthenticated remote code execution. It has a sibling advisory in React, GHSA-xqc2-xf4c-x3h3. There is no known workaround, and Next.js asks you to upgrade right away even if your app has no functions like that.

The affected range is only >= 16.0.0, <= 16.4.0. On 14 or 15, this one does not apply. On 16, move to 16.4.1 or later.

RCE 2: sharp on glibc-based Linux

The second RCE is the one that matters on 14. GHSA-2464-fhr4-w9xw describes a memory bug in an upstream library used for Image Optimization that can lead to remote code execution when Next.js runs on glibc-based Linux. Its workaround: make sure the sharp Next.js uses is 0.35.5 or later.

sharp's own advisory, GHSA-wq5f-xc86-pv6w, fills in the details: the bug is in librsvg, and sharp 0.35.5 ships librsvg 2.63.2 with the fix. For code that calls sharp directly, it also offers blocking the SVG decoder with sharp.block({ operation: ["VipsForeignLoadSvg"] }), and recommends a node binary compiled as a Position Independent Executable, noting that the official Node.js binaries are not built that way.

What changes from one major to the next is where sharp comes from. We checked the npm registry:

$ npm view next@14.2.35 optionalDependencies.sharp dependencies.sharp
$ npm view next@15.5.28 optionalDependencies.sharp
^0.34.3 || ^0.35.5
$ npm view next@16.4.1 optionalDependencies.sharp
^0.35.5
  1. 14.2.35 prints nothing: it declares sharp neither as a dependency nor as an optional one. On 14, sharp is only there if your project installed it, as the sharp missing in production page recommends for next start (and requires with output: "standalone"). Without sharp, 14 falls back to squoosh.
  2. 15.5.28 ships sharp as an optional dependency and accepts ^0.34.3 || ^0.35.5. A 0.34.x satisfies that range, and per sharp's advisory everything before 0.35.5 is affected.
  3. 16.4.1 requires ^0.35.5, so a vulnerable sharp no longer fits.

One note for 14 without sharp: the advisory covers every version from 10.0.0 through 15.5.27 and makes no exception for apps running on squoosh. Do not treat that as protection; the advisory does not say it is.

Patched versions: 16.4.1 and 15.5.28

On 15 or 16, the fix is one command. These come straight from the Next.js post:

npm install next@15.5.28  # for 15.5
npm install next@16.4.1   # for 16.4
  1. The first line takes 15 to 15.5.28, the patched Maintenance LTS release. It is also the latest 15.x on npm today.
  2. The second takes 16 to 16.4.1. Any later 16.4.x is patched too; as of November 2, the latest on npm is 16.4.4.

After upgrading, check sharp. The advisory says upgrading Next.js makes package managers provide a fixed sharp, and on a fresh install that is what we saw: next@15.5.28 from scratch resolved sharp@0.35.5. But if your lockfile already pinned a 0.34.x, the ^0.34.3 || ^0.35.5 range lets it stay. We tested a project on 15.5.20 (npm 11.11.1, lockfile only):

$ npm install next@15.5.28 --package-lock-only
$ npm ls sharp --package-lock-only
`-- next@15.5.28
  `-- sharp@0.34.5
$ npm update sharp --package-lock-only
$ npm ls sharp --package-lock-only
`-- next@15.5.28
  `-- sharp@0.35.5
  1. npm install next@15.5.28 upgrades Next. --package-lock-only only rewrites the lockfile; drop it in your project.
  2. npm ls sharp shows Next on 15.5.28 and sharp still on 0.34.5: npm keeps the locked version because it satisfies the range.
  3. npm update sharp moves it to the highest version the range allows, 0.35.5.
  4. The second check confirms it. We dropped the summary line that npm install and npm update print, and the first line of each npm ls, which is the local project path.

pnpm 12.16.1 behaved the same way: pnpm add next@15.5.28 left sharp on 0.34.5 until we added an override. The practical rule: the app is not fixed until you see 0.35.5 in the tree.

Still on Next.js 14: a step-by-step migration plan to 15

This plan follows the official guide to upgrading to version 15 and the codemods documentation. We ran it on a test App Router app on Next 14.2.35 and React 18.3.1.

Step 1: run the codemod, targeting 15

The guide suggests npx @next/codemod@canary upgrade latest, but latest on npm is 16.4.4 today, so from 14 you would jump two majors at once. The codemods docs accept an exact target, so aim at 15:

npx @next/codemod@canary upgrade 15
  1. @next/codemod@canary is the newest CLI, as the guide recommends, and upgrade 15 pins the target. In our run it printed "Upgrading your project to Next.js 15.5.28...".

It moved next to 15.5.28 and react and react-dom from 18.3.1 to 19.3.1, then applied the recommended codemods: next-request-geo-ip, next-async-request-api, app-dir-runtime-config-experimental-edge, next-experimental-turbo-to-turbopack and next-lint-to-eslint-cli. It pulled the React 19 recipe from app.codemod.com. Without an interactive terminal it accepts every default, the same as --yes. This is what it changed in app/p/[slug]/page.js:

-export function generateMetadata({ params }) {
+export async function generateMetadata(props) {
+  const params = await props.params;
   return { title: params.slug };
 }

-export default function Page({ params }) {
-  const theme = cookies().get("theme")?.value ?? "light";
+export default async function Page(props) {
+  const params = await props.params;
+  const theme = (await cookies()).get("theme")?.value ?? "light";
  1. generateMetadata becomes async and awaits props.params, which is a promise on 15.
  2. The page becomes async too and awaits params before reading slug.
  3. cookies() is now asynchronous, so the codemod wraps it as (await cookies()).

Step 2: React 19

The guide sets React 19 as the minimum for react and react-dom. useFormState is deprecated in favor of useActionState, and TypeScript projects should bump @types/react and @types/react-dom. Per the Next.js 15 release post, the Pages Router can stay on React 18. If another package rejects React 19, the guide has a recovery checklist that uses --skip-react-upgrade.

Step 3: async request APIs

cookies, headers, draftMode, params and searchParams become asynchronous. When the codemod cannot migrate something, it leaves an @next-codemod-error comment or an UnsafeUnwrapped cast. The guide says to resolve them rather than treat them as done, and the build errors until you remove them. If you are reworking those components, check the client boundary while you are there: where to put use client in Next.js.

Step 4: what stops being cached

On 15, fetch requests are no longer cached by default (opt back in with cache: 'force-cache'), GET Route Handlers are not cached either (opt in with export const dynamic = 'force-static'), and the Client Router Cache stops reusing page segments on navigation (restore it with staleTimes). None of this breaks the build, but it can raise load on your backend, so measure it.

Step 5: renames and removals

@next/font becomes next/font; serverComponentsExternalPackages becomes serverExternalPackages; bundlePagesExternals becomes bundlePagesRouterDependencies; runtime = 'experimental-edge' becomes 'edge'. The geo and ip properties on NextRequest are gone, and so is automatic Speed Insights instrumentation.

Step 6: verify, then deploy

Run next build, your tests, and the review checklist at the end of the guide. In our test the build passed, and next start served the page with the cookie and /_next/image with 200 image/webp. After deploying, run npm ls sharp again on the server, or in the image your CI builds.

from 14 to 16 in two hops, with a stop at 15Next 1414.2.35unsupportedNext 1515.5.28Maintenance LTSNext 1616.4.4Active LTSstep 1 · 14 to 15npx @next/codemod@canary upgrade 15react and react-dom 19 (App Router)await cookies(), headers(), paramsfetch and GET are no longer cachedsharp: optional dependency of nextstep 2 · 15 to 16npx @next/codemod@canary upgrade 16Node.js 20.9+ and TypeScript 5.1+cookies() and params: async onlymiddleware.ts becomes proxy.tsTurbopack by default in build15 is a stop, not the destination15.x gets security releases through Jan 31, 2027 (support policy)

Scroll the figure sideways to see all of it

15 is a stop, not the destination. The support policy extended its maintenance window, and security releases for 15 continue through January 31, 2027. The next hop is the version 16 upgrade guide: Node.js 20.9 or later, TypeScript 5.1, async-only access to cookies() and params, middleware renamed to proxy, and Turbopack by default. When we ran upgrade 16 without an interactive terminal, the codemod reached 16.4.4 but added export const instant = false to every page and layout, and the build failed with "Route segment config "instant" requires `nextConfig.cacheComponents` to be enabled." We removed those lines, since the app does not use Cache Components, and the build passed.

While you migrate: sharp 0.35.5 or later

If the upgrade will take a while, apply the advisory's workaround: make sure the sharp Next loads is 0.35.5 or later. On 14 there are two cases.

Your app installed sharp itself. It is a direct dependency, so upgrade it with npm install sharp@^0.35.5. An override does not work here: per the npm overrides documentation, you cannot override a direct dependency unless the specs match, and npm answered npm error code EOVERRIDE with "Override for sharp@0.34.5 conflicts with direct dependency".

sharp comes in through another package. We tested with @xenova/transformers, which pulls sharp 0.32.6. npm places it at node_modules/sharp, exactly where Next 14 looks for it. That is where an override in the root package.json belongs:

{
  "overrides": {
    "sharp": "^0.35.5"
  }
}
  1. npm only reads overrides from the project's root package.json.
  2. "sharp": "^0.35.5" forces that minimum across the whole tree. After npm install, npm ls sharp showed @xenova/transformers@2.17.2 with sharp@0.35.5.
Package managerWhereWhat to writeTested
npmroot package.json"overrides": { "sharp": "^0.35.5" }Yes, npm 11.11.1
pnpmpnpm-workspace.yamloverrides: with sharp: ^0.35.5 under itYes, pnpm 12.16.1
Yarnroot package.json"resolutions": { "sharp": "^0.35.5" }No: Yarn is not installed here

For pnpm, the current docs say settings in the pnpm field of package.json are no longer read; on pnpm 10.2.0, "pnpm": { "overrides": ... } still worked for us. The Yarn syntax comes from its resolutions docs.

Watch your Node version: sharp 0.35.5 declares node >=20.9.0, while Next 14.2.35 accepts 18.17.0 and up. On Node 22.22.3, a Next 14.2.35 app with sharp 0.35.5 built and served /_next/image without the missing-sharp warning, which did show up once we removed sharp.

To see which sharp Next actually loads, ask Node from the next package's point of view:

npm ls sharp
node -p "const s = require(require.resolve('sharp', { paths: [require.resolve('next')] })); s.versions.sharp + ' librsvg ' + s.versions.rsvg"
  1. npm ls sharp tells you who brings sharp in and at which version. (empty) on 14 means nobody installed it.
  2. The node -p line resolves sharp the way the next package does and loads it. It printed 0.35.5 librsvg 2.63.2 with npm, in Git Bash and in PowerShell, and with pnpm.
  3. Skip require('sharp/package.json'): on 0.35.5 it throws ERR_PACKAGE_PATH_NOT_EXPORTED. And under pnpm, require('sharp') from the project root fails when sharp is not a direct dependency, which is why the line resolves it from next.
what npm ls sharp printed in four test projectsprojectnpm ls sharpwhat to donext@14.2.35 alone(empty)Next 14 ships no sharpnext@14 + sharp 0.34.5sharp@0.34.5npm i sharp@^0.35.5next 15.5.20 to 15.5.28sharp@0.34.5npm update sharpnext@15.5.28 freshsharp@0.35.5nothing: already 0.35.5the version Next loads, from noderequire.resolve('sharp', { paths: [require.resolve('next')] })0.35.5 librsvg 2.63.2what counts is the sharp Next loadsreal output, npm 11.11.1 · require('sharp/package.json') throws on 0.35.5

Scroll the figure sideways to see all of it

That covers the image RCE, but it is not a full fix. On 14 the DoS stays open if you use the App Router with Server Actions, and the next vulnerability will not get a 14.x release either.

Common mistakes

  • Assuming 15.5.28 always brings sharp 0.35.5. On a fresh install it does. With a lockfile that already had 0.34.5, both npm and pnpm kept it. Check npm ls sharp.
  • Running upgrade latest from 14. latest is 16.4.4 today. To go one major at a time, write upgrade 15.
  • Putting an override on a direct dependency. npm answers EOVERRIDE. If sharp is in your dependencies, bump it there.
  • Thinking you are safe because sharp is not in the tree. The advisory covers all of 14 and makes no exception for the squoosh path.
  • Turning off image optimization as the fix. No advisory lists that as a mitigation. The published fixes are upgrading Next or using sharp 0.35.5 or later.
  • Reading the version with require('sharp/package.json'). It throws on 0.35.5. Use versions.sharp.
  • Accepting every version 16 codemod without reading the diff. In our test, export const instant = false broke the build of an app that does not use Cache Components.
  • Treating 15 as the finish line. Its security releases end on January 31, 2027.

Frequently asked questions

Is my Next.js 14 app exposed to both RCEs?

No. Going by the advisory ranges, the use cache RCE only affects 16.0.0 through 16.4.0. Version 14 falls inside the range of the image optimization RCE (CVE-2026-96889) and of the Server Actions DoS, and neither has a patched 14.x.

Can I just bump sharp and stay on 14?

For the image RCE, that is the workaround the Next.js advisory gives. It does nothing for the DoS if you use the App Router with Server Actions, and 14 is unsupported, so whatever comes next will not be patched either. Treat it as time to finish the upgrade.

Can I jump straight from 14 to 16?

The codemod allows it, since it accepts any target version. Our recommendation is to go one major at a time: each official guide lists its own breaking changes, and when something fails you know which hop caused it. Once you are on 15, 16 needs Node.js 20.9 or later.

How do I know which sharp version Next uses?

Run npm ls sharp and the node -p line above from the project root, in the same image or server where Next runs. If you see 0.35.5 or later with librsvg 2.63.2, that part is covered.

Checklist

  • You know which line you are on: npm ls next.
  • On 16: 16.4.1 or later. On 15: 15.5.28.
  • On 14: you have a dated plan to reach 15, then 16.
  • npm ls sharp shows 0.35.5 or later, whatever line you are on.
  • The node -p check prints the version Next loads, with librsvg 2.63.2.
  • The updated lockfile is committed and your CI installs from it.
  • Every @next-codemod-error comment and UnsafeUnwrapped cast is resolved.
  • next build, your tests and a request to /_next/image pass before you deploy.

A security upgrade is a good moment to check the rest of the app: if it exposes configuration to the browser, review which NEXT_PUBLIC variables must never hold secrets. The scheduled November 3 release has its own list: the Next.js November 2026 security release. And sharp 0.35.5 needs Node 20.9 or later; for the runtime, read how to update Node in Docker after the October security releases.

Saw this on Instagram? Comment RCE on the Reel and I'll send you the guide.

Written by

Luis Morales

Luis Morales

Frontend and Shopify developer, EcomLabs

@luismoralesdev on Instagram

Published November 2, 2026 · updated November 3, 2026

← Blog