Critical RCE Holes in Next.js Patched in Urgent Security Fix

Next.js has released an out-of-band security update (on October 14, 2026) to address two high-severity remote code execution (RCE) vulnerabilities—plus a serious denial-of-service (DoS) issue—in its web framework. The fixes apply to its Active and Maintenance LTS branches, versions 16.4.1 and 15.5.28.

The Vulnerabilities at a Glance

The first RCE flaw stems from React Server Components under Next.js’s “use cache” feature. If the cache function returns more than one typed array, an attacker can execute code on the server. This affects Next.js 16.0.0 through 16.4.0, but only if Cache Components are enabled. Even if you don’t use that specific function, upgrading is advised.

The second RCE weakness is found in the SVG processing chain. Next.js uses the sharp package bundled with librsvg to render SVG images. On Linux servers built against glibc, passing user-supplied SVG files to sharp while the dangerouslyAllowSVG option is enabled—or via features like next/og that generate preview images—can lead to arbitrary code execution. A memory bug in librsvg (now addressed in version 0.35.5 or higher of sharp) is the root cause.

The third issue is a DoS vulnerability impacting applications using the App Router with Server Actions defined. Malicious requests can overload a server process, tying up CPU and preventing it from serving other requests. Pages Router apps or those without Server Actions are unaffected.

Impact, Exposure & Mitigation

Both RCE flaws received a 9.5 severity rating. The SVG‐librsvg issue also has a published CVE, CVE-2026-96889. It’s not new: this marks the third time in recent months that image optimization via sharp has produced exploitable bugs in Next.js—previous RCEs came via AVIF image handling and through next/og with malformed text in SVGs.

To protect applications, upgrade Next.js to version 16.4.1 if you’re on v16, or 15.5.28 if you’re on v15. Then rebuild and redeploy. Ensure that sharp is at least version 0.35.5. If you’re on v15, an old sharp version might persist after upgrade—check via npm ls sharp and manually update if needed. For the SVG flaw, you can temporarily disable SVG processing in sharp using sharp.block({ operation: ["VipsForeignLoadSvg"] }). However, the first two flaws have no fallback—only upgrading fixes them.

Some platforms—Netlify, for example—say their configurations are not vulnerable to the image-processing paths affected in these flaws, though they still recommend updating. As of October 15, no known exploits targeting these new vulnerabilities have been reported.

Broader Context: Repeated Image-Processing Issues

This isn’t the first time image handling has caused trouble. In August, an AVIF handling bug via libheif under sharp allowed RCE. In September, a flaw in next/og let user inputs alter generated SVGs. The current patch escapes adding major new functionality: Next.js 16.4.1 retains the same image optimizer as 16.4.0; the fix is raising sharp to a version that bundles a safe librsvg.

React ecosystems are no stranger to serious vulnerabilities: earlier this year, a flaw nicknamed “React2Shell” exposed high-security risks across major packages. The current “use cache” issue shares some overlap in dependent packages but is far narrower; it only hits in rare setups involving multiple typed arrays and user-controlled values.

Upgrade now, rebuild, and deploy. If that’s not possible immediately, patching sharp or disabling SVG support offers a partial shelter. But only the full upgrade fully closes all the doors.

Analysis: This round of critical patches underlines a recurring weak spot in modern web frameworks: image processing. Libraries like sharp are central to many build pipelines, preview generation, and optimizers—but also carry deep risk when vulnerabilities in their dependencies surface. The fact that these RCEs are network-reachable, and often hidden unless you inspect your image paths, makes them stealthy and dangerous. Going forward, maintainers should scrutinize transitive dependencies like librsvg and build more restrictive defaults around features like SVG rendering and cache management. For developers, the lesson is clear: patch urgently, audit image tools, and treat dependencies not as utility, but as potential threat vectors.