GHSA-vcvr-r3jv-pc5j: Next Remote Code Execution Vulnerability

CRITICAL
CWE-1395
Published
Advisory Summary

GHSA-vcvr-r3jv-pc5j is a CRITICAL remote code execution vulnerability (CWE-1395: Dependency on Vulnerable Third-Party Component) affecting Next libraries in the npm ecosystem. The issue involves remote code execution in next/og imageresponse. Remediation is available by upgrading affected packages to version 16.3.6.

GHSA-vcvr-r3jv-pc5j at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vcvr-r3jv-pc5j
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-1395: Dependency on Vulnerable Third-Party Component
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-vcvr-r3jv-pc5j

To remediate this vulnerability, upgrade all affected Next dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

next fixed: 16.3.6
npm install next@16.3.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls next

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-vcvr-r3jv-pc5j, inspect your project dependencies using npm:

npm ls next

Analyze the terminal output to locate any version of Next in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 16.3.6), your application is affected.

Note: The npm ls next command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1395: Dependency on Vulnerable Third-Party Component, where the product has a dependency on a third-party component that contains one or more known vulnerabilities. In Next, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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( <svg width="1200" height="630"> <title>{value}</title> </svg> ) } ``` 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`.

GHSA-vcvr-r3jv-pc5j Affected Next Versions

1 component(s)
Fixed Versions:
16.3.6
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 16.2.0
< 16.3.6
16.3.6

References

Frequently Asked Questions

What is GHSA-vcvr-r3jv-pc5j?
GHSA-vcvr-r3jv-pc5j is a security vulnerability in Next involving Remote Code Execution in next/og ImageResponse under CWE-1395: Dependency on Vulnerable Third-Party Component.
Which Next versions are affected?
Affected versions include releases prior to 16.3.6 across affected packages: next.
What version fixes GHSA-vcvr-r3jv-pc5j?
Upgrading to 16.3.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 16.3.6. Upgrade your dependency to 16.3.6 or later.
What CWE is associated with GHSA-vcvr-r3jv-pc5j?
GHSA-vcvr-r3jv-pc5j is classified under CWE-1395: Dependency on Vulnerable Third-Party Component (The product has a dependency on a third-party component that contains one or more known vulnerabilities.).
How can I check npm dependencies for GHSA-vcvr-r3jv-pc5j?
Run the dependency tree command: 'npm ls next'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vcvr-r3jv-pc5j",
  "modified" : "2026-09-30T14:48:30Z",
  "published" : "2026-09-30T14:48:30Z",
  "aliases" : [ ],
  "summary" : "Next.js: Remote Code Execution in next/og ImageResponse",
  "details" : "## Impact\n\nThe Node.js `ImageResponse` implementation from `next/og` is affected by an upstream vulnerability. This can lead to remote code execution.\n\nAffected applications pass attacker-controlled values into SVG content, attributes, or styles during image generation:\n\n```tsx\nimport { ImageResponse } from 'next/og'\n\nexport async function GET(request: Request) {\n  const value = new URL(request.url).searchParams.get('value') ?? ''\n\n  return new ImageResponse(\n    <svg width=\"1200\" height=\"630\">\n      <title>{value}</title>\n    </svg>\n  )\n}\n```\n\nApplications using the Edge `ImageResponse` implementation, or applications that do not pass attacker-controlled values into SVG content, attributes, or styles, are not affected.\n\n## Workaround\n\nIf 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`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.2.0"
      }, {
        "fixed" : "16.3.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-vcvr-r3jv-pc5j"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/satori/security/advisories/GHSA-wx4j-mvgx-mqwp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/868fad38690d72088868f299fa2bef339b26838e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vercel/next.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v16.3.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1395" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-30T14:48:30Z",
    "nvd_published_at" : null
  }
}