Next.js Ships Out-of-Band Patch for Two Critical RCE Flaws in Caching and SVG Processing
Next.js released an out-of-band security update on October 14 that fixes two critical flaws allowing unauthenticated remote code execution, along with a high-severity denial-of-service flaw. One code-execution flaw is in React Server Components, and the other in librsvg, the open-source library Next.js uses through the sharp package to handle SVG images. The fixes are in
On October 14, Next.js released an out-of-band security update to address two critical vulnerabilities that could allow unauthenticated remote code execution. The patch also resolves a high-severity denial-of-service issue. The fixes are incorporated into the current Active and Maintenance long-term support (LTS) releases of Next.js 16.4.1 and 15.5.28.
Two code-execution flaws were found, one in React Server Components and the other in the open-source library librsvg, which Next.js uses through the sharp package to handle SVG images. Both flaws were rated critical by Vercel, the company behind Next.js, with a CVSS score of 9.5.
The React Server Components flaw is present in the React feature that runs user-interface components on the server. It affects specific versions of three packages: react-server-dom-webpack, react-server-dom-parcel, and react-server-dom-turbopack. The flaw can be triggered by a use cache function that returns more than one typed array, which is a rare case. Vercel recommends upgrading even if your app does not have such a function.
The second flaw lies in the librsvg library that renders SVG images, which Next.js reaches through the sharp package. This memory bug is exploitable on glibc-based Linux systems when Next.js runs on it. By default, Next.js does not optimize SVG files, but serving them through the image optimizer requires enabling a setting called dangerouslyAllowSVG. The third flaw is a denial-of-service issue that can cause a server process to use full CPU capacity and stop handling other requests in App Router apps with Server Actions.
App owners should upgrade to Next.js 16.4.1 or 15.5.28, depending on their current version, and then rebuild and redeploy their applications. The image flaw has an interim option if you cannot upgrade Next.js right away: ensure that sharp is version 0.35.5 or later, or block SVG rendering in sharp using the sharp.block() method.
Rewritten by urgent.news; may contain errors — check the original.
Source: thehackernews.com