Advertisement

Critical Next.js ImageResponse Flaw Can Lead to Server Code Execution via Crafted SVG Input

Summary: A new security vulnerability in Next.js could allow attackers to run code on a server via ImageResponse, the feature that generates Open Graph and other social preview images, Vercel said. The risk applies when an app puts values an attacker controls, such as text read from the request URL, into the image. Vercel, which develops Next.js, fixed the flaw on September 22 in version

A critical vulnerability in Next.js could allow attackers to execute code on vulnerable servers by injecting specially crafted content into dynamically generated images.

The flaw, tracked as CVE-2026-94545, affects theImageResponsefunctionality used by Next.js applications to dynamically create Open Graph images and other visual content. Vercel has rated the vulnerability critical with a CVSS score of 9.5 and released Next.js 16.3.6 to address the issue.

The vulnerability becomes exploitable when an application passes attacker-controlled values into SVG content, attributes, or styles while generating an image through the Node.js version ofImageResponse.

Advertisement
The Problem Starts With Dynamic Images

Next.js includesImageResponsethrough thenext/ogpackage, allowing developers to generate images dynamically using familiar web technologies.

A website might, for example, generate a social media preview image containing the title of an article, a username, or information taken from a URL.

Internally, Next.js relies on Satori, another Vercel-developed library, to transform the image layout into SVG before producing the final PNG.

The vulnerability originates in Satori.

Certain attacker-controlled values were not properly escaped before being inserted into the generated SVG. A specially crafted value could therefore be interpreted as SVG markup rather than harmless text.

In Next.js applications, Vercel says this behavior can interact with vulnerabilities in other dependencies and ultimately result in server-side code execution. The company has not publicly identified the additional libraries involved in that exploitation chain.

Which Next.js Applications Are Vulnerable?

The vulnerability affects Next.js versions 16.2.0 through 16.3.5 whenImageResponseruns using the Node.js runtime.

That distinction is important because Node.js is currently the default runtime for Next.js.

The Edge implementation ofImageResponseis not affected. Next.js 15 is also not vulnerable to this specific issue, although version 15.5.26 received additional security hardening related tonext/og.

Not every application running an affected Next.js version is automatically exploitable.

The dangerous scenario occurs when attacker-controlled information is passed into SVG content, attributes, or styles during image generation.

Developers should therefore search their applications for imports ofImageResponsefromnext/og, particularly inside route handlers andopengraph-imagefiles.

Patching Requires Moving to Next.js 16.3.6

Vercel fixed the vulnerability on September 22 with the release of Next.js 16.3.6.

At the time the vulnerability was disclosed, this was the only patched release available for affected Next.js 16 installations. Applications running the 16.2 branch therefore need to move to 16.3.6 rather than waiting for a patched 16.2 release.

Developers using Satori directly should update to Satori 0.33.5.

Interestingly, the severity differs depending on where the vulnerable component is used. Satori’s own advisory rates CVE-2026-94545 as moderate, with a CVSS score of 5.3, because the impact depends heavily on how its generated SVG is processed.

Inside Next.js, however, the vulnerability can become considerably more dangerous because the generated content interacts with other server-side components.

Security Tools May Not Detect the Problem Yet

The disclosure also highlights a potential problem with relying exclusively on automated dependency scanners.

When The Hacker News tested an installation of vulnerable Next.js 16.3.5 on September 23,npm auditdid not report the vulnerability.

The advisory was also not yet available in the GitHub Advisory Database, and a public CVE record for CVE-2026-94545 had not been published at the time of the report.

That means some development teams could run normal dependency checks and receive no warning even though their application is using an affected version.

Another complication is that Satori is bundled within Next.js. Developers may therefore not see it listed as an independent dependency in their lockfiles.

Checking the installed Next.js version directly is the more reliable approach.

No Known Exploitation So Far

As of September 23, there were no public reports of attackers exploiting CVE-2026-94545, and no public proof-of-concept exploit had been released.

However, affected versions have been available since Next.js 16.2 was released on March 18, creating a potentially significant exposure window.

Vercel has also not provided a method for determining whether a vulnerableImageResponseroute was previously exploited.

If immediate upgrading is impossible, the recommended workaround is to ensure that attacker-controlled values never reach SVG content, attributes, or styles processed by the Node.jsImageResponseimplementation.

The advisory does not recommend migrating applications to the unaffected Edge implementation, which is notable because Next.js currently considers the Edge runtime deprecated.

A Small Rendering Bug With Server-Level Consequences

CVE-2026-94545 illustrates how vulnerabilities deep inside modern web development frameworks can have consequences far beyond the component where they originate.

At the Satori level, the problem is essentially improper escaping during SVG generation. Within the larger Next.js environment, however, that output can pass through additional libraries and potentially become a path to server-side code execution.

For development and security teams, the immediate priority is straightforward: identify applications running Next.js 16.2.0 through 16.3.5, determine whether they useImageResponse, and upgrade to Next.js 16.3.6.

The absence of known exploitation should not reduce the urgency. With a critical severity rating and server-side code execution potentially available when vulnerable image-generation routes process attacker-controlled data, exposed applications should be patched before attackers have time to turn the disclosure into working exploits.

Advertisement

Key facts

  • A critical vulnerability has been identified in Next.js
  • The flaw resides in the ImageResponse feature
  • Attackers can leverage crafted SVG input to execute code on servers
  • The vulnerability is exploitable when attacker-controlled values are placed into images
  • Vercel, the developer of Next.js, has released a fix for the flaw
  • The fix was applied in version [version number missing]

Why it matters

This vulnerability impacts developers relying on Next.js for generating social preview images, a common feature for web applications. Attackers could exploit this to compromise server infrastructure, leading to potential data breaches or service disruptions if applications dynamically generate images using user-controlled data without proper sanitization.