Critical Next.js ImageResponse Flaw Enables Server-Side Code Execution via Crafted SVG
A critical vulnerability in Next.js's ImageResponse feature allows attackers to execute server-side code by crafting malicious SVG input, Vercel has released version 14.1.1 to address the issue.

A critical security vulnerability has been discovered in Next.js, a popular React framework, that could allow attackers to execute arbitrary code on a server. The flaw resides within the ImageResponse feature, which is designed to generate social preview images such as Open Graph images. Vercel, the developer of Next.js, has acknowledged the severity of the issue and released a patch to mitigate the risk.
The vulnerability, tracked as CVE-2026-94545, affects versions 16.2.0 through 16.3.5 of Next.js when utilizing the Node.js runtime, which is the default configuration. Vercel has assigned a critical severity rating to this flaw, with a CVSS score of 9.5. Notably, the Edge runtime version of ImageResponse is not impacted, nor are versions prior to Next.js 16.
The root cause of the vulnerability lies in how the ImageResponse feature incorporates user-controlled data into generated SVG content. When an application embeds values that an attacker can influence, such as text extracted directly from a request URL, into the SVG structure, it can lead to a security compromise. The ImageResponse feature relies on the Satori library to convert image layouts into SVG code before rendering the final image.
According to Vercel's advisory, affected applications are those that "pass attacker-controlled values into SVG content, attributes, or styles during image generation." An example provided illustrates how a value taken from a request URL and inserted into an SVG title element could be exploited. Developers can identify instances of the ImageResponse feature by looking for imports of next/og, commonly found in route handlers or opengraph-image files.
As of the latest reports, there have been no public disclosures of active exploitation or publicly available exploit code for this vulnerability. However, the critical nature of the flaw and its potential for remote code execution necessitate prompt action from developers.
Vercel has addressed the vulnerability by releasing Next.js version 16.3.6. This version includes the necessary fixes to prevent the exploitation of the ImageResponse feature. Developers are strongly advised to update their Next.js installations to this patched version by running npm install [email protected]. For those using older versions, such as 16.2, migrating to 16.3.6 is the recommended course of action, as no specific fix was released for the 16.2 line.
For organizations unable to upgrade immediately, Vercel suggests a workaround: avoid incorporating any attacker-controlled values into the SVG content, attributes, or styles processed by the Node.js ImageResponse. While the Edge runtime is unaffected, the Next.js documentation indicates that the Edge runtime is deprecated, making a full upgrade the most sustainable solution.
The underlying issue was also detailed in an advisory from Satori, the library used by Next.js for SVG generation. Satori rated the CVE as moderate (5.3), emphasizing that the impact is contingent on the specific implementation and usage of the SVG output. Developers using Satori directly are advised to update to version 0.33.5.