# Next.js remote code execution in next/og ImageResponse

Source: https://junglewise.ai/threats/next-js-remote-code-execution-in-next-og-imageresponse-a62f1779  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-30. Updated: 2026-09-30  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 4 · Published 2026-09-30

Next.js is a popular web framework used to build server-rendered React applications. The next/og library provides image generation capabilities via the ImageResponse component. When attacker-controlled values are passed into SVG content during image generation on Node.js backends, an upstream vulnerability in the SVG rendering library allows remote code execution, potentially giving attackers full control of the server.

Technologies: [next (npm)](https://junglewise.ai/threats/technologies/npm-next), [Vercel Next.js](https://junglewise.ai/threats/technologies/next-js). Vendors: [npm](https://junglewise.ai/threats/vendors/npm), [Vercel](https://junglewise.ai/threats/vendors/vercel).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Medium severity, with a CVSS score of 4, published 30 September 2026.

**Which products and versions are affected?** next (npm) SEMVER:introduced=16.2.0,fixed=16.3.6; Vercel Next.js 16.2.0 to 16.3.5.

**Is there a fix for This vulnerability?** Yes. next (npm): upgrade to 16.3.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network.

**Am I affected?** Check whether you run next (npm) or Vercel Next.js at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- next (npm): upgrade to 16.3.6 or later

  ```sh
  npm install next@16.3.6
  ```


## Technical details

An improper escaping flaw in the Satori SVG library (a dependency of next/og) permits crafted SVG attribute and content injection. When Next.js applications pass untrusted input from requests into ImageResponse SVG rendering on the Node.js runtime (not the Edge runtime), attackers can inject malicious SVG markup that is interpreted and executed. The vulnerability requires application code to pass attacker-controlled URL parameters or user input directly into SVG attributes, content, or styles without sanitization.

## Affected products

- Vercel Next.js 16.2.0 to 16.3.5

## Timeline

- 2026-09-22: disclosed
- 2026-09-22: patched: version 16.3.6

## References

- [https://github.com/vercel/next.js/security/advisories/GHSA-vcvr-r3jv-pc5j](https://github.com/vercel/next.js/security/advisories/GHSA-vcvr-r3jv-pc5j)
- [https://github.com/vercel/satori/security/advisories/GHSA-wx4j-mvgx-mqwp](https://github.com/vercel/satori/security/advisories/GHSA-wx4j-mvgx-mqwp)

## Related threats

- [Vercel Next.js remote code execution in use cache functions](https://junglewise.ai/threats/next-js-unauthenticated-remote-code-execution-in-use-cache-functions-ac3e73d3)
- [Next.js denial of service in App Router with Server Actions](https://junglewise.ai/threats/cve-2026-94482-next-js-denial-of-service-in-app-router-using-server-actions)
- [Next.js unauthenticated remote code execution in Image Optimization API](https://junglewise.ai/threats/next-js-unauthenticated-remote-code-execution-in-image-optimization-api-f1b22a87)
- [Next.js information disclosure in Draft Mode via use cache](https://junglewise.ai/threats/cve-2026-94544-next-js-is-a-react-framework-for-building-full-stack-web)
- [Next.js Pages Router response cache key bypass](https://junglewise.ai/threats/cve-2026-94543-next-js-is-a-react-framework-for-building-full-stack-web)
