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

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.