CVE-2026-27980: Next Unbounded Next/image Disk Cache Growth Vulnerability

MODERATE
Advisory Identifier: GHSA-3x4c-7xq6-9pq8
CWE-400
Published
Advisory Summary

CVE-2026-27980 is a MODERATE unbounded next/image disk cache growth vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Next libraries in the npm ecosystem. The issue involves unbounded next/image disk cache growth can exhaust storage. Remediation is available by upgrading affected packages to version 16.1.7, 15.5.14.

CVE-2026-27980 at a Glance

CVE Identifier CVE-2026-27980
GHSA Identifier GHSA-3x4c-7xq6-9pq8
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-27980

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.1.7
npm install next@16.1.7
next fixed: 15.5.14
npm install next@15.5.14
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 CVE-2026-27980, 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.1.7), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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

## Summary The default Next.js image optimization disk cache (`/_next/image`) did not have a configurable upper bound, allowing unbounded cache growth. ## Impact An attacker could generate many unique image-optimization variants and exhaust disk space, causing denial of service. Note that this does not impact platforms that have their own image optimization capabilities, such as Vercel. ## Patches Fixed by adding an LRU-backed disk cache with `images.maximumDiskCacheSize`, including eviction of least-recently-used entries when the limit is exceeded. Setting `maximumDiskCacheSize: 0` disables disk caching. ## Workarounds If upgrade is not immediately possible: - Periodically clean `.next/cache/images`. - Reduce variant cardinality (e.g., tighten values for `images.localPatterns`, `images.remotePatterns`, and `images.qualities`)

CVE-2026-27980 Affected Next Versions

2 component(s)
Fixed Versions:
16.1.715.5.14
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 16.0.0-beta.0
< 16.1.7
16.1.7
next
npm
≥ 10.0.0
< 15.5.14
15.5.14

References

Frequently Asked Questions

What is CVE-2026-27980?
CVE-2026-27980 is a security vulnerability in Next involving Unbounded next/image disk cache growth can exhaust storage under CWE-400: Uncontrolled Resource Consumption.
Which Next versions are affected?
Affected versions include releases prior to 16.1.7, 15.5.14 across affected packages: next.
What version fixes CVE-2026-27980?
Upgrading to 16.1.7, 15.5.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 16.1.7, 15.5.14. Upgrade your dependency to 16.1.7, 15.5.14 or later.
What CWE is associated with CVE-2026-27980?
CVE-2026-27980 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2026-27980?
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-3x4c-7xq6-9pq8",
  "modified" : "2026-03-19T18:33:24Z",
  "published" : "2026-03-17T16:17:06Z",
  "aliases" : [ "CVE-2026-27980" ],
  "summary" : "Next.js: Unbounded next/image disk cache growth can exhaust storage",
  "details" : "## Summary\nThe default Next.js image optimization disk cache (`/_next/image`) did not have a configurable upper bound, allowing unbounded cache growth.\n\n## Impact\nAn attacker could generate many unique image-optimization variants and exhaust disk space, causing denial of service. Note that this does not impact platforms that have their own image optimization capabilities, such as Vercel.\n\n## Patches\nFixed by adding an LRU-backed disk cache with `images.maximumDiskCacheSize`, including eviction of least-recently-used entries when the limit is exceeded. Setting `maximumDiskCacheSize: 0` disables disk caching. \n\n## Workarounds\nIf upgrade is not immediately possible:\n- Periodically clean `.next/cache/images`.\n- Reduce variant cardinality (e.g., tighten values for `images.localPatterns`, `images.remotePatterns`, and `images.qualities`)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.0-beta.0"
      }, {
        "fixed" : "16.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "15.5.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-3x4c-7xq6-9pq8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27980"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/39eb8e0ac498b48855a0430fbf4c22276a73b4bd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vercel/next.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v16.1.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-17T16:17:06Z",
    "nvd_published_at" : "2026-03-18T01:16:04Z"
  }
}