CVE-2026-27980: Next.js: Unbounded next/image disk cache growth can exhaust storage

Published Mar 17, 2026
·
Updated

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.

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)

Other sources

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)

GitHub

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).

NVD

Affected Software

4 affected componentsFixes available
npm/next>=10.0.0<16.1.7
16.1.7
Vercel Next.js Node.js>=10.0.0<16.1.7
npm/next>=10.0.0<15.5.14
15.5.14
npm/next>=16.0.0-beta.0<16.1.7
16.1.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/next to a version that resolves this vulnerability.

    Fixed in 16.1.7
  2. Upgrade

    Upgrade npm/next to a version that resolves this vulnerability.

    Fixed in 15.5.14
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 16.1.7
  4. Configuration

    Set images.maximumDiskCacheSize to 0 to disable the disk cache (limits unbounded growth)

    Next.js next/image (image optimization disk cache at /_next/image) images.maximumDiskCacheSize = 0
  5. Configuration

    If upgrade is not possible, reduce variant cardinality by tightening images.localPatterns, images.remotePatterns, and images.qualities

    Next.js next/image (variant generation controls) images.localPatterns / images.remotePatterns / images.qualities = tighter values
  6. Operational

    If upgrade is not possible, periodically clean .next/cache/images to prevent disk exhaustion from cached image optimization variants

Event History

Mar 17, 2026
Advisory Published
via GitHub·04:17 PM
Data Sourced
via GitHub·04:17 PM
DescriptionWeaknessAffected Software
Mar 18, 2026
CVE Published
via MITRE·12:23 AM
Data Sourced
via MITRE·12:23 AM
DescriptionWeakness
Data Sourced
via Red Hat·01:02 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·01:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-27980?

CVE-2026-27980 is categorized as a moderate severity vulnerability due to its potential for causing denial of service.

2

How do I fix CVE-2026-27980?

To fix CVE-2026-27980, upgrade Next.js to version 16.1.7 or later.

3

What is the impact of CVE-2026-27980?

CVE-2026-27980 allows attackers to exhaust disk space by generating numerous unique image-optimization variants.

4

What software is affected by CVE-2026-27980?

CVE-2026-27980 affects Next.js versions from 10.0.0 to 16.1.6.

5

Is there a configuration option to limit cache growth in CVE-2026-27980?

By default, there is no configurable upper bound for cache growth in affected versions of Next.js.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203