nextjs.vnTiếng Việt

All advisories

Remote code execution in next/og ImageResponse

Critical CVSS 9.5 · Published 2026-09-30 · GHSA-vcvr-r3jv-pc5j

Original title: Next.js: Remote Code Execution in next/og ImageResponse

What happens

The Node.js ImageResponse implementation in next/og inherits an upstream vulnerability (satori). If an application passes attacker-controlled values into SVG content, attributes or styles while generating an image, an attacker can run code on the server.

Who is affected

  • Routes that build images with ImageResponse from next/og on the Node.js runtime and put request values (query, body, headers) into the SVG.
  • Not affected: the Edge ImageResponse implementation, or apps that put no attacker-controlled values into the SVG.

Affected and fixed versions

AffectedFixed in
>= 16.2.0, < 16.3.616.3.6

What to do

  • Upgrade Next.js to the fixed version in the table below.
  • If you cannot upgrade yet: do not pass attacker-controlled values into SVG content, attributes or styles rendered by the Node.js ImageResponse.

Check yourself

  • Find the uses: grep -rn "next/og" app src pages.
  • For each route: does it have export const runtime = "edge", and which SVG values come from the request?

Sources

Rewritten from the original advisory; versions from the GitHub Advisory Database (CC-BY-4.0), updated 2026-10-29. Where they differ, the original advisory wins.