6.9medium
Next.js: Unbounded next/image disk cache growth can exhaust storage
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.87% (higher than 59% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3x4c-7xq6-9pq8
Description
Next.js is a React framework for building full-stack web applications. Starting in version 10.0.0 and prior to version 16.1.7, the default Next.js image optimization disk cache (`/_next/image`) did not have a configurable upper bound, allowing unbounded cache growth. An attacker could generate many unique image-optimization variants and exhaust disk space, causing denial of service. This is fixed in version 16.1.7 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. If upgrading is not immediately possible, periodically clean `.next/cache/images` and/or reduce variant cardinality (e.g., tighten values for `images.localPatterns`, `images.remotePatterns`, and `images.qualities`).
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vercel next.js | >= 10.0.0, < 16.1.7, from 10.0.0 before 16.1.7 | CVE List, NVD |
| next (npm) | from 16.0.0-beta.0 before 16.1.7, from 10.0.0 before 15.5.14 | GitHub Advisory Database |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Next.js is a React framework for building full-stack web applications. Starting in version 10.0.0 and prior to version 16.1.7, the default Next.js image optimization disk cache (`/_next/image`) did not have a configurable upper bound, allowing unbounded cache growth. An attacker could generate many unique image-optimization variants and exhaust disk space, causing denial of service. This is fixed in version 16.1.7 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. If upgrading is not immediately possible, periodically clean `.next/cache/images` and/or reduce variant cardinality (e.g., tighten values for `images.localPatterns`, `images.remotePatterns`, and `images.qualities`).
GitHub Advisory Database
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, andimages.qualities)
NVD (es)
Next.js es un React framework para construir aplicaciones web full-stack. A partir de la versión 10.0.0 y antes de la versión 16.1.7, la caché de disco predeterminada de optimización de imágenes de Next.js ('/_next/image') no tenía un límite superior configurable, permitiendo un crecimiento ilimitado de la caché. Un atacante podría generar muchas variantes únicas de optimización de imágenes y agotar el espacio en disco, causando denegación de servicio. Esto se corrige en la versión 16.1.7 añadiendo una caché de disco basada en LRU con 'images.maximumDiskCacheSize', incluyendo la expulsión de las entradas menos usadas recientemente cuando se excede el límite. Establecer 'maximumDiskCacheSize: 0' deshabilita el almacenamiento en caché en disco. Si la actualización no es inmediatamente posible, limpie periódicamente '.next/cache/images' y/o reduzca la cardinalidad de las variantes (por ejemplo, ajuste los valores para 'images.localPatterns', 'images.remotePatterns' y 'images.qualities').
References
| https://github.com/vercel/next.js/security/advisories/GHSA-3x4c-7xq6-9pq8 | mitigation, vendor-advisory, web | |
| https://github.com/vercel/next.js/commit/39eb8e0ac498b48855a0430fbf4c22276a73b4bd | patch, web | |
| https://github.com/vercel/next.js/releases/tag/v16.1.7 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-27980 | advisory | |
| https://github.com/vercel/next.js | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27980 changed 2026-03-18 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3x4c-7xq6-9pq8 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-27980 changed 2026-06-17 | Public domain |