NEWS

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

CVE-2026-94545 (CVSS 9.5) lets attacker-controlled input reach unescaped SVG output in Next.js ImageResponse, enabling RCE. Patched in 16.3.6.

Dylan H.

News Desk

September 23, 2026
3 min read
Critical Next.js ImageResponse Flaw Can Lead to Server Code Execution via Crafted SVG Input

Root Cause: Unescaped Values Reaching SVG Output

Vercel disclosed a critical vulnerability in Next.js's ImageResponse feature — the API behind next/og, used to generate Open Graph images and other social preview cards. Tracked as CVE-2026-94545 (GHSA-vcvr-r3jv-pc5j), the flaw carries a CVSS score of 9.5 and affects Next.js 16.2.0 through 16.3.5 when ImageResponse runs on the Node.js runtime — the default runtime Next.js uses.

The underlying bug lives in Satori, the library Next.js uses to convert JSX into SVG for ImageResponse. Per Satori's own advisory, certain values reached its SVG output without being properly escaped, meaning a specially crafted value could be interpreted as SVG markup rather than plain text. In a Next.js application, values reaching that unescaped output could trigger vulnerabilities in other dependent libraries — which Vercel has not named — resulting in code execution on the server.


Vulnerability Summary

FieldDetails
CVE IDCVE-2026-94545 / GHSA-vcvr-r3jv-pc5j
CVSS Score9.5 (Critical) in Next.js; 5.3 (Moderate) rated directly against Satori
AffectedNext.js 16.2.0 – 16.3.5, ImageResponse on the Node.js runtime
Not AffectedEdge ImageResponse implementation; Next.js 15 (RCE does not apply)
Fixed InNext.js 16.3.6 (Active LTS); Next.js 15.5.26 (hardening only, not vulnerable to the RCE)
Root Cause LibrarySatori — fixed in v0.33.5

What Triggers It

The vulnerability requires an application to pass attacker-controlled values into SVG content, attributes, or styles during image generation via ImageResponse — for example, reading a value from a request URL query parameter and rendering it directly inside the generated <svg>. Applications that:

  • Use the Edge ImageResponse implementation, or
  • Never pass attacker-controlled values into the SVG output

...are not affected.

Netlify confirmed the same scoping for its customers: sites are only affected if they use ImageResponse and the generated image incorporates untrusted input such as request text or a request-supplied image URL.


Detection Caveat

Vercel's advisory does not provide a way to determine whether an affected route was exploited before the patch shipped. If your application used a vulnerable ImageResponse configuration with attacker-controlled input, treat prior exploitation as unconfirmable rather than ruled out, and prioritize the upgrade regardless of whether you've observed suspicious activity.


Remediation

  1. Upgrade immediately: npm install next@16.3.6 (or next@15.5.26 for the Maintenance LTS branch, which received hardening even though it isn't vulnerable to the RCE itself).
  2. If you use Satori directly (outside of Next.js), upgrade to v0.33.5.
  3. Audit every ImageResponse usage in your codebase for attacker-controlled input — query parameters, request body values, or externally supplied text/images — flowing into the generated SVG.
  4. Where possible, sanitize or allowlist any dynamic values before they reach ImageResponse, independent of the framework-level patch.
  5. Confirm your deployment target (Vercel, Netlify, or self-hosted) has applied the corresponding platform-level fix.

Sources