GHSA-2xp9-vwfh-vxw4: Next Remote Code Execution Vulnerability

CRITICAL
CWE-1395
Published
Advisory Summary

GHSA-2xp9-vwfh-vxw4 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 unauthenticated remote code execution in image optimization api when avif files are used. Remediation is available by upgrading affected packages to version 15.5.24, 16.3.3.

GHSA-2xp9-vwfh-vxw4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2xp9-vwfh-vxw4
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-2xp9-vwfh-vxw4

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: 15.5.24
npm install next@15.5.24
next fixed: 16.3.3
npm install next@16.3.3
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-2xp9-vwfh-vxw4, 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 15.5.24), 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

A vulnerability in the underlying `libheif` library used by `sharp` which Next.js uses for image optimization can lead to remote code execution when AVIF files are optimized. Until a fix has propagated, optimization of AVIF files is disabled.

GHSA-2xp9-vwfh-vxw4 Affected Next Versions

2 component(s)
Fixed Versions:
15.5.2416.3.3
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 10.0.0
< 15.5.24
15.5.24
next
npm
≥ 16.0.0
< 16.3.3
16.3.3

References

Frequently Asked Questions

What is GHSA-2xp9-vwfh-vxw4?
GHSA-2xp9-vwfh-vxw4 is a security vulnerability in Next involving Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used under CWE-1395: Dependency on Vulnerable Third-Party Component.
Which Next versions are affected?
Affected versions include releases prior to 15.5.24, 16.3.3 across affected packages: next.
What version fixes GHSA-2xp9-vwfh-vxw4?
Upgrading to 15.5.24, 16.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 15.5.24, 16.3.3. Upgrade your dependency to 15.5.24, 16.3.3 or later.
What CWE is associated with GHSA-2xp9-vwfh-vxw4?
GHSA-2xp9-vwfh-vxw4 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-2xp9-vwfh-vxw4?
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-2xp9-vwfh-vxw4",
  "modified" : "2026-09-08T21:21:12Z",
  "published" : "2026-09-08T21:21:12Z",
  "aliases" : [ ],
  "summary" : "Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used",
  "details" : "A vulnerability in the underlying `libheif` library used by `sharp` which Next.js uses for image optimization can lead to remote code execution when AVIF files are optimized.\n\nUntil a fix has propagated, optimization of AVIF files is disabled.",
  "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" : "10.0.0"
      }, {
        "fixed" : "15.5.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.0"
      }, {
        "fixed" : "16.3.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/strukturag/libheif/security/advisories/GHSA-g89c-p67h-r497"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-2xp9-vwfh-vxw4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/pull/97875"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/pull/97931"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/3a15b4ac6ac8e70b1a9b18ecc18e8434462899b3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/409772ec807def20132d251ad48fd8d8ad4c73c2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/7a5937a8ab20b89d0a961f75eabb11577f5d5998"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vercel/next.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v15.5.24"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v16.3.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1395" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T21:21:12Z",
    "nvd_published_at" : null
  }
}