Advisory

GHSA-3x4c-7xq6-9pq8

Also known as: CVE-2026-27980

Summary

Next.js: Unbounded next/image disk cache growth can exhaust storage

Details

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)

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-03-17 16:17 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

next

npm · All systems

Affected

  • introduced 16.0.0-beta.0, fixed 16.1.7 (semver)

Fixed versions

16.1.7

Fix

next

npm · All systems

Affected

  • introduced 10.0.0, fixed 15.5.14 (semver)

Fixed versions

15.5.14

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences