Critical Next.js Flaw Lets Attackers Run Code via Image Previews
Vercel has disclosed a critical security flaw in Next.js affecting the ImageResponse feature, which generates Open Graph and social preview images. The vulnerability, tracked as CVE-2026-94545, carries a severe CVSS score of 9.5 and affects Next.js versions 16.2.0 through 16.3.5 when ImageResponse runs on the default Node.js runtime. The risk arises when applications insert attacker-controlled values, such as text taken from a request URL, into generated images, potentially allowing remote code execution on the server.
The flaw stems from how ImageResponse uses Vercel's Satori library to convert image layouts into SVG code before producing a final image file. Apps that pass user-supplied data into SVG content, attributes, or styles are at risk. Developers can check exposure by searching for ImageResponse imported from next/og, commonly found in route handlers and opengraph-image files. As of the report, no public exploit code or real-world attacks had been observed, and the flaw was not yet listed in the GitHub Advisory Database.
Vercel has released a fix in Next.js version 16.3.6, and businesses running the 16.2 line must upgrade directly to this version since no patched 16.2 release exists. Next.js 15.5.26 adds additional hardening for the 15.5 line, though version 15 itself is not affected. If immediate upgrading isn't possible, developers should avoid placing any attacker-controlled data into SVG content used by ImageResponse.