Skip to main content
MilfTravel
Dev news

Next.js Patches Critical RCE in next/og Image Generator

Code editor showing a security vulnerability highlight and patch update in a JavaScript project

Vercel shipped an out-of-band security release on 22 September 2026 to address a critical remote code execution (RCE) vulnerability in the next/og image generation API used across thousands of Next.js projects. Developers running affected versions should update immediately.

What happened

The vulnerability stems from improper sanitisation of SVG content inside Satori, the open-source OG-image rendering library that powers next/og's ImageResponse API. When user-controlled or externally sourced data is passed into an OG image template without escaping, an attacker can inject malicious SVG payloads that chain into arbitrary code execution on the Node.js server.

Vercel released the advisory alongside patch releases:

  • Next.js 16.3.6 — Active LTS, fully patched
  • Next.js 15.5.26 — Maintenance LTS hardening only (15.x itself is not RCE-vulnerable, but receives the upstream Satori fix as a precaution)

The advisory identifiers are GHSA-vcvr-r3jv-pc5j (Next.js) and GHSA-wx4j-mvgx-mqwp (Satori upstream).

Who is affected

Critical affects Next.js >=16.2.0 <16.3.6 projects that use ImageResponse in the Node.js runtime.

The Edge runtime variant is not affected — the SVG processing path is different there. Projects that generate OG images only in Edge functions can treat this as low risk, but upgrading is still recommended.

How to fix

Update your Next.js dependency in one command:

npm install next@16.3.6
# or
pnpm add next@16.3.6

After updating, redeploy your application. No configuration changes are required. If you cannot upgrade immediately, audit any ImageResponse usage for externally sourced or user-controlled strings and sanitise SVG input before passing it to the API.

Why an out-of-band release

Vercel chose to ship this fix outside the normal release cadence because of the severity rating. The team pre-published an advance notice to give teams time to prepare before the patch landed. The out-of-band pattern follows the approach used by the Node.js and React security teams for critical fixes — a reminder that popular open-source frameworks now treat security disclosures with the same discipline as commercial software.

Takeaway for frontend teams

If you run OG image generation with user-supplied text or remote data in a Node.js environment, this is a high-priority update. Check your package.json and lock files, run the upgrade, and review your CI pipeline to catch dependency advisories earlier — GitHub Dependabot and Socket.dev are good automated starting points.