Skip to content
Heist/ feed
CriticalFix available

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

Type: advisorySource: OSV1 source record

## Impact The Node.js `ImageResponse` implementation from `next/og` is affected by an upstream vulnerability. This can lead to remote code execution. Affected applications pass attacker-controlled values into SVG content, attributes, or styles during image generation: ```tsx import { ImageResponse } from 'next/og' export async function GET(request: Request) { const value = new URL(request.url).searchParams.get('value') ?? '' return new ImageResponse( {value} ) } ``` Applications using the Edge `ImageResponse` implementation, or applications that do not pass attacker-controlled values into SVG content, attributes, or styles, are not affected. ## Workaround If upgrading is not immediately possible, do not pass attacker-controlled values into SVG content, attributes, or styles rendered by the Node.js `ImageResponse` implementation from `next/og`.

Announced Source revision 1
Original source ↗

GHSA-vcvr-r3jv-pc5j

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:GHSA-vcvr-r3jv-pc5j

next

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
Fixed versions
16.3.6

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "16.2.0"
          },
          {
            "fixed": "16.3.6"
          }
        ]
      }
    ],
    "package": {
      "name": "next",
      "purl": "pkg:npm/next",
      "ecosystem": "npm"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-vcvr-r3jv-pc5j/GHSA-vcvr-r3jv-pc5j.json"
    }
  }
]

Publisher severity

critical

Source reference: /database_specific/severity

Event
#58680 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement