← Back to blog

Critical Next.js Flaw Exposes Servers to Remote Code Execution

A newly patched vulnerability in Next.js ImageResponse allows attackers to execute server-side code through malicious SVG inputs. Developers using dynamic image generation should update immediately.

TL;DR

  • Vercel fixed a critical RCE flaw in Next.js ImageResponse component
  • Attackers could exploit SVG rendering to run arbitrary server code
  • Risk occurs when apps inject user-controlled data into image generation
  • Patch released in version update on September 22, 2026
  • All Next.js deployments using ImageResponse should upgrade immediately

A severe security vulnerability has been discovered and patched in Next.js, the popular React framework developed by Vercel. The flaw resides in the ImageResponse feature, which dynamically generates social media preview images including Open Graph cards. When applications incorporate user-supplied data into these images, attackers can leverage crafted SVG inputs to execute arbitrary code on the server.

Vercel addressed the vulnerability with an urgent patch released on September 22, 2026. Organizations running Next.js applications that utilize dynamic image generation capabilities are strongly advised to update their deployments immediately to prevent potential server compromise.

Vulnerability Details

  • The flaw affects Next.js ImageResponse component used for generating dynamic preview images
  • Attack vector involves malicious SVG input processing during image rendering
  • Successful exploitation grants attackers remote code execution privileges on the server
  • Primary risk factor is injection of untrusted data like URL parameters into image content
  • Vulnerability patched in official update released September 22, 2026

Impact and Mitigation

  • Applications using ImageResponse with user-controlled text inputs are at highest risk
  • Organizations should immediately upgrade to the latest Next.js version
  • Developers should audit code for dynamic image generation with external data
  • Consider implementing additional input sanitization for all user-supplied image content
  • Monitor server logs for suspicious SVG processing or unexpected code execution patterns

Sources

Sources

Security email updates

One digest email when we publish new security articles (TL;DR plus links to read more). Unsubscribe anytime from the message footer. See our Privacy Policy.

Critical Next.js Flaw Exposes Servers to Remote Code Execution — Agent Breach Blog | Agent Breach