Next.js 16.4.1 Fixes Two 9.5 RCE Bugs. A 15.5.28 Upgrade May Not Be Enough
There's an uncomfortable habit in web security: you patch the framework, the scanner goes green, and you go to lunch. With this Next.js release, that habit could leave you exposed. On October 14, the Next.js team shippe
There's an uncomfortable habit in web security: you patch the framework, the scanner goes green, and you go to lunch. With this Next.js release, that habit could leave you exposed.
On October 14, the Next.js team shipped an out-of-band update fixing two critical remote code execution flaws and one high-severity denial of service bug. The fixed releases are Next.js 16.4.1 and 15.5.28. Singapore's Cyber Security Agency put out its own alert on October 20 telling organizations to patch immediately, and the details have been picking up attention all week. I'll tell you what's affected, why one of the fixes is easy to get wrong and what I'd run today.
The three flaws in plain terms
The Hacker News laid the three issues out in a table, and it's the clearest summary I've seen.
| Issue | Affected versions | Fixed in | Who is exposed |
|---|---|---|---|
| Code execution through use cache (GHSA-673q-mjm6-r5xr) | 16.0.0 through 16.4.0 | 16.4.1 | App Router apps with Cache Components where a use cache function returns more than one typed array |
| Code execution through SVG images (CVE-2026-96889, GHSA-2464-fhr4-w9xw) | 10.0.0 through 15.5.27, and 16.0.0 through 16.4.0 | 16.4.1, or 15.5.28 with sharp 0.35.5 or later | Apps that pass attacker-supplied SVG files to sharp on glibc-based Linux |
| Denial of service through Server Actions (GHSA-p3m5-59mp-jv5r) | 13.0.0 through 15.5.27, and 16.0.0 through 16.4.0 | 15.5.28, 16.4.1 | App Router apps with at least one Server Action |
Vercel rated both code execution flaws critical, each with a CVSS score of 9.5. The Server Actions bug is rated high, and Cybersecurity News reports it at 8.2.
Flaw one: use cache and React Server Components
The first bug lives in React Server Components, in the three packages react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack, versions 19.0.0 through 19.3.0. React describes it as affecting "extremely rare cases where responses transport multiple typed arrays and an attacker-controlled value."
In a Next.js app, the trigger is a use cache function that returns more than one typed array. So only version 16 apps that turn on Cache Components can be hit. Vercel still says to upgrade even if your app has no such function. There is no workaround. Upgrading is the only fix.
Flaw two: SVG files and librsvg
The second bug is a memory flaw in librsvg, the library that renders SVG images, which Next.js reaches through the bundled sharp package. Code execution is possible when Next.js runs on glibc-based Linux. By default, Next.js doesn't optimize SVG files. Serving them through the image optimizer requires turning on a setting called dangerouslyAllowSVG. The same library also renders images for next/og, the feature that builds social preview images, when it runs on the Node.js runtime.
This is the third time since August that image processing in Next.js has produced a code execution flaw, per The Hacker News. An AVIF bug in libheif came first in August, and a next/og flaw followed in September. The researcher who reported the librsvg bug, Rafael B. Dias, says it is the weakness behind September's next/og issue.
There's a disagreement on severity worth knowing about. Red Hat scored the librsvg bug 7.8 and said exploitation needs user interaction, such as opening a malicious file. Vercel rated the Next.js exposure 9.5 and reachable over the network. Both can be true: a desktop app opening a file is different from a server processing an upload.
Flaw three: Server Actions
Crafted requests can push one server process to full CPU use so it stops handling other requests. Apps on the Pages Router, or without Server Actions, aren't affected.
The trap: upgrading to 15.5.28 may not fix the SVG bug
Here's the part I want you to remember. Next.js did not change its own image code this time. Version 16.4.1 fixes the image flaw by raising the bundled sharp to 0.35.5, which carries a patched librsvg 2.63.2.
On version 16, that works automatically, because 16.4.1 requires sharp 0.35.5. On version 15, it may not. The Hacker News reports that 15.5.28 still accepts the older, affected sharp 0.34.x, and upgrading over an existing install can leave that version in place. Your lockfile decides, not the Next.js version number.
Another wrinkle: the use cache and Server Actions advisories had no CVE as of October 15, according to The Hacker News. Tools that depend on the same advisory feed that npm audit uses may not warn you about them. The image flaw does show up, through sharp's own advisory. If you rely only on automated scanners, go and check by hand.
Expand
Next.js logo from Wikimedia Commons
Image: Vercel via Wikimedia Commons, CC BY-SA 4.0
What I'd run today
- Find your version. Run npm ls next. If you're on 16.0.0 to 16.4.0, plan the jump to 16.4.1. If you're on 15.x up to 15.5.27, go to 15.5.28.
- Upgrade, rebuild and redeploy. A package.json change that never reaches production protects nobody.
- Check sharp. Run npm ls sharp. If it shows anything older than 0.35.5, update it. This is the step that catches the 15.5.28 trap.
- See if the risky features are on. Search your code for dangerouslyAllowSVG, for use cache and for use server. Those tell you which of the three flaws can reach you.
- If you can't upgrade yet, the image flaw has an interim option: make sure sharp is 0.35.5 or later, or block SVG rendering in sharp with sharp.block({ operation: ["VipsForeignLoadSvg"] }), as the sharp advisory describes. The use cache and Server Actions flaws have no workaround.
If you're on 16.3 or earlier, note that Vercel's announcement lists only 16.4.1 and 15.5.28 as fixed lines, according to one analysis. There is no patched 16.3 release, so reaching the fix means a minor upgrade, with whatever React and Turbopack changes come with it. Test it in staging, not on a Friday afternoon.
Is anyone exploiting this?
As of October 15, The Hacker News said there were no public reports that any of the three flaws had been used in attacks. Don't read that as permission to wait. A working exploit for the earlier September next/og flaw, built for one specific server setup, has since been published, and sharp's maintainer warns the outcome can be code execution or only a crash depending on the Node.js build, because official Node.js binaries aren't hardened against this kind of memory attack.
This is also not the same as React2Shell, the maximum-severity flaw disclosed in December 2025 that attackers exploited at scale. The React Server Components issue here is far narrower. But narrow isn't harmless, especially for an app that returns typed arrays from cached functions.
The hosting platform matters too. Netlify said its platform doesn't run the image optimizer code path and that the flaws have limited impact on its setup, though it still recommends upgrading. If you self-host on glibc Linux with SVG optimization on, you're the case that worries me most.
What to take from this
I keep seeing the same pattern: the dangerous code isn't in the framework you chose, it's in a library two levels down that nobody on your team has heard of. sharp, librsvg, libheif. Your lockfile is the real source of truth for that, and reading it for a few minutes after an advisory is worth more than a nightly scan.
If you're new to the framework, my guide to building Next.js apps that hold up in production covers the habits that make days like this less painful, including pinning and staged upgrades.
Expand
A person typing on a laptop in the dark, a stock photo for security
Frequently Asked Questions
Which Next.js versions are safe?
16.4.1 and 15.5.28 contain the fixes. On 15.5.28, also confirm sharp is 0.35.5 or newer.
Do I have to turn on SVG optimization to be affected by the image flaw?
Serving SVGs through the optimizer requires dangerouslyAllowSVG, but the same library also renders images for next/og on the Node.js runtime, so check that too.
Is there a workaround for the use cache flaw?
No. Only upgrading to 16.4.1 closes it, and Vercel says to upgrade even if your app has no function returning multiple typed arrays.
Are these flaws being exploited?
As of October 15, The Hacker News reported no public attack reports. Patch anyway.
Originally published on Mango Developer.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.
