Next.js RCE Vulnerability: Upgrade to 16.4.1 or 15.5.28
No7 Engineering Team
Growth Architecture Unit

Update, 3 November 2026, 19:45 UTC: Next.js rates the unstable_cache flaw High in its release post
The Next.js team has now published its November 2026 Security Release post. It lists the same seven issues and the same fixed versions, 16.4.5 (Active LTS) and 15.5.29 (Maintenance LTS), but rates one of them higher than the GitHub advisory: cross-tenant cache disclosure when a use cache function is also called through unstable_cache (GHSA-mfr8-8qww-v76h) is marked High severity in the post, while the advisory itself still says medium. The post says that where root parameters separate tenants, the leaked result can contain another tenant's data. The other six remain Medium. The post also narrows two issues: the Edge cookie leak needs attacker-controlled JavaScript on the same origin and did not reproduce in Node.js Route Handlers or with cookies().set(), and the SVG bypass needs a native image backend that can decode SVG.
Update, 3 November 2026, 18:55 UTC: Next.js 16.4.5 and 15.5.29 fix seven medium vulnerabilities
The scheduled release announced on 27 October shipped today. According to the v16.4.5 release notes, Next.js 16.4.5 fixes all seven advisories. The v15.5.29 release notes list the three that also affect 15.x. All seven are rated moderate (medium) severity:
- CVE-2026-119346 (GHSA-f3mh-rxg3-f5g2): cookies set through
NextResponseon Edge runtime routes are repeated in an internalx-middleware-set-cookieresponse header, so HttpOnly cookies such as session tokens become readable by JavaScript on the same origin. Affects 15.x and 16.x. - CVE-2026-119347 (GHSA-7qx7-33qx-rqx2): on self-hosted deployments the image optimiser (
/_next/image) can be made to process an attacker-supplied SVG even withdangerouslyAllowSVG: false, the default. Affects 15.x and 16.x. - CVE-2026-119348 (GHSA-pc58-hwjq-p385): self-hosted apps that return a fetched upstream response unchanged, behind an HTTP/1.1 reverse proxy that allows pipelined responses, can mix up responses between clients. Affects 15.x and 16.x.
- CVE-2026-119349 (GHSA-rhh4-g77r-r9qj):
use cachefunctions that take binary arguments such asUint8ArrayorBlobcan produce the same cache key for different arguments, which can share cached results across users. Affects 16.x. - CVE-2026-119350 (GHSA-vvgp-ww4w-46vf): self-hosted apps on
next startbuilt withcacheComponents: trueand without Partial Prefetching can have a shared fallback shell poisoned by one unauthenticated GET request. Affects 16.4.0 and later. The advisory's workaround ispartialPrefetching: trueinnext.config. - CVE-2026-119351 (GHSA-vc7v-qv4w-wrv8): with Cache Components, an outer
use cachefunction can be stored under a key that leaves out a root param read by an inner one, so content for one root param value is served for another. Affects 16.2.0 and later. - CVE-2026-119790 (GHSA-mfr8-8qww-v76h): a
use cachefunction that reads a root param and is called both directly and throughunstable_cache()can leak cached data across root param values during a cold process start. Affects 16.3.0 and later.
Upgrade to 16.4.5, or to 15.5.29 on the 15.x line. The 16.4.1 and 15.5.28 releases still fix the 14 October RCE and denial of service flaws covered below, but they do not include these seven fixes.
Update, 28 October 2026, 15:15 UTC: Next.js schedules a November security release
On 27 October the Next.js team announced a scheduled security release for Tuesday 3 November 2026. It will address seven medium-severity vulnerabilities in Next.js, and the full advisories, with impact, affected versions and upgrade instructions, will be published alongside the release. The 14 October fixes in this post still apply: stay on 16.4.1 or 15.5.28 or later now, then plan to upgrade again once the 3 November patches are available.
A Next.js RCE vulnerability is a flaw that lets an attacker run their own code on the server that runs your Next.js app. On 14 October 2026 the Next.js team published an out-of-band security update that fixes two critical unauthenticated remote code execution vulnerabilities and one high-severity denial of service. The fixes ship in Next.js 16.4.1 (Active LTS) and 15.5.28 (Maintenance LTS). If you run a headless storefront or any other Next.js app, upgrade now.
Next.js vulnerabilities fixed on 14 October 2026
The three issues, with the affected and fixed versions from each GitHub advisory:
| Issue | Advisory | Severity | Affected versions | Fixed in |
|---|---|---|---|---|
Unauthenticated remote code execution in use cache functions returning typed arrays | GHSA-673q-mjm6-r5xr | Critical | 16.0.0 to 16.4.0 | 16.4.1 |
| Unauthenticated remote code execution in the Image Optimization API when SVG files are used | CVE-2026-96889 (GHSA-2464-fhr4-w9xw) | Critical | 10.0.0 to 15.5.27, and 16.x above 16.0.0 up to 16.4.0 | 15.5.28, 16.4.1 |
| Denial of service in App Router using Server Actions | GHSA-p3m5-59mp-jv5r | High | 13.0.0 to 15.5.27, and 16.0.0 to 16.4.0 | 15.5.28, 16.4.1 |
The use cache and Server Actions issues have related upstream advisories in React, GHSA-xqc2-xf4c-x3h3 and GHSA-h3gv-c5rc-p453, which the Next.js team links from its announcement.
Is my Next.js app affected?
use cacheremote code execution: affects apps using the App Router with Cache Components when ause cachefunction returns multiple typed arrays. In the Next.js docs,use cacheis a Cache Components feature that you turn on with thecacheComponentsoption innext.config. The advisory gives no workaround and tells you to upgrade even if your app has no such function.- Image Optimization remote code execution: a memory-related bug in an upstream library used for Image Optimization can lead to remote code execution when Next.js runs on glibc-based Linux. The advisory's workaround is to make sure the
sharppackage Next.js uses is 0.35.5 or later. Upgrading Next.js makes package managers pull in a fixedsharp. - Server Actions denial of service: crafted requests to an App Router app with at least one Server Action can drive CPU usage up and block further requests in the same process. Apps using the Pages Router, or not using Server Actions, are not vulnerable.
The Image Optimization advisory covers every release from 10.0.0 up to 15.5.27, so apps still on Next.js 14 or older are in range. The advisory lists fixes only on the 15.5 and 16.4 lines. On an older line, move to 15.5.28 or 16.4.1, or apply the sharp workaround until you can. Next.js 13 and 14 App Router apps with Server Actions are also in range of the denial of service advisory, which has no workaround besides upgrading.
How to patch Next.js
- Check the installed versions. Run
npm ls next sharp(or the equivalent for your package manager) in every app and build image. - Upgrade Next.js. Run
npm install next@16.4.1on the 16.4 line ornpm install next@15.5.28on the 15.5 line. The npmlatesttag now points to 16.4.3, which is later than the fixed release. - Confirm
sharp. After installing, check that the resolvedsharpis 0.35.5 or later. If you cannot upgrade Next.js straight away, pinsharpto 0.35.5 or later as the advisory's interim workaround for the Image Optimization flaw. - Rebuild and redeploy. Commit the lockfile, rebuild every container and redeploy. A running server keeps the old code until it restarts.
- Test the paths that changed. Check pages that use
next/image, cached functions and Server Actions, such as cart and checkout forms, before you close the ticket.
Timeline
- 30 September 2026: the Next.js September security release. Two fixes were held back from it because of upstream dependency delays.
- 8 October 2026: the Next.js team pre-announced an out-of-band update for 14 October covering two critical and one high-severity issue.
- 14 October 2026: npm records 15.5.28 at 17:36 UTC and 16.4.1 at 17:43 UTC; the three GitHub advisories were published between 17:46 and 17:47 UTC.
What to do next
List every Next.js app you run, including preview and staging deployments, and move each one to 16.4.1 or 15.5.28 or later today. If the same stack runs Node.js or PHP, the Node.js Brotli RCE fix and the PHP2Shell vulnerabilities need the same treatment. Our ecommerce supply chain security checklist covers dependency pinning and patch routines. If you want a headless storefront upgraded and tested for you, our headless Shopify development team can scope it.
Related guide: Is my Next.js version vulnerable? How to check and fix.
Frequently Asked Questions
The questions buyers and engineers ask us most about this topic.
Which Next.js versions fix the October 2026 RCE vulnerabilities?
Next.js 16.4.1 and 15.5.28, released on 14 October 2026. The use cache remote code execution flaw affects 16.0.0 to 16.4.0, and the Image Optimization remote code execution flaw affects releases from 10.0.0 up to 15.5.27 and from above 16.0.0 up to 16.4.0.
Is there a workaround for the Next.js Image Optimization RCE?
Yes. The advisory for CVE-2026-96889 says to make sure the sharp package used by Next.js is 0.35.5 or later. Upgrading Next.js to a patched version pulls in a fixed sharp automatically. The flaw affects Next.js running on glibc-based Linux.
Is there a workaround for the use cache RCE in Next.js?
No. The advisory says there is no known workaround for affected applications and that you should upgrade to 16.4.1 immediately, even if your app has no use cache function returning typed arrays.
Are Next.js apps using the Pages Router affected by the Server Actions denial of service?
No. The advisory says apps using the Pages Router, or not using Server Actions, are not vulnerable. App Router apps with at least one Server Action should upgrade to 16.4.1 or 15.5.28.
I am on Next.js 14. Is there a patch?
The Image Optimization advisory covers every release from 10.0.0 up to 15.5.27 and lists fixes only in 15.5.28 and 16.4.1. Move to one of those, or pin sharp to 0.35.5 or later as an interim workaround. Next.js 13 and 14 App Router apps with Server Actions are also in range of the denial of service advisory, which has no workaround besides upgrading.