Critical NEXT.JS Flaw Allows Remote Code Execution Via Weaponized SVG File

Blog WriterCybersecurity News - Original News Source is cybersecuritynews.com


A critical Next.js vulnerability, tracked as CVE-2026-94545, affects the Node.js ImageResponse implementation in the next/og package and could allow remote code execution by exploiting malicious SVG content during image generation.

The issue affects Next.js versions 16.2.0 through versions before 16.3.6. Developers are urged to upgrade to Next.js 16.3.6, which contains the security fix.

The vulnerability exists in the Node.js ImageResponse implementation used to dynamically create Open Graph images, social-media preview images, and other server-generated graphics.

The underlying image-rendering component contains an upstream security flaw that can be triggered when an application places attacker-controlled data into SVG elements, attributes, or styles.

An attacker may exploit the issue when a vulnerable application accepts input from a URL parameter, form field, API request, or another untrusted source and embeds that value directly inside an SVG image.

For example, an application could retrieve a value parameter from an incoming request and render it inside an SVG <title> element while creating an image through ImageResponse.

NEXT.JS Remote Code Execution Flaw

In this type of deployment, a threat actor could send specially crafted SVG-related input that reaches the vulnerable rendering process. Successful exploitation may result in remote code execution on the server handling the image-generation request.

The GitHub advisory ( GHSA-vcvr-r3jv-pc5j ) assigns the vulnerability a Critical severity rating under CVSS v4. The attack can be performed remotely over the network, requires no authentication, and requires no user interaction.

Although the attack requirements are low, the potential impact is severe because exploitation could affect the confidentiality, integrity, and availability of both the vulnerable system and connected systems.

A compromised Next.js image-generation environment could expose sensitive server-side data, allow modification of hosted content, disrupt services, or give attackers an initial foothold for further attacks.

The actual impact will depend on how the Next.js application is hosted, its permissions, and whether the image-generation process can access secrets, cloud credentials, internal services, or deployment infrastructure.

Not every Next.js deployment is vulnerable. Applications using the Edge implementation of ImageResponse are not affected, according to the advisory.

Applications that use the Node.js ImageResponse feature but never place attacker-controlled values in SVG content, attributes, or CSS styles are also not affected.

Organizations should immediately review endpoints that generate images through next/og, particularly Open Graph image routes that use query-string parameters. Developers should identify any untrusted values rendered inside SVG markup, and upgrade affected installations to version 16.3.6.

Where immediate patching is not possible, developers should stop passing user-controlled input into SVG content, attributes, and styles processed by the Node.js ImageResponse implementation.

Input validation alone should not be treated as a permanent fix, since complex SVG parsing and rendering behavior can create unexpected attack paths.

The vulnerability was reported by security researchers RaghavMaheshwari124 and rafabd1. Next.js users should treat this issue as a priority patch because internet-facing image-generation endpoints can be easy for attackers to discover and probe. The advisory identifies the affected package as next and lists version 16.3.6 as the patched release.

Cut every SOC alert investigation by 21 min. Power your SOC with instant IOC context for immediate response: Integrate TI Lookup in your SOC

The post Critical NEXT.JS Flaw Allows Remote Code Execution Via Weaponized SVG File appeared first on Cyber Security News.