GHSA-3x4c-7xq6-9pq8

Suggest an improvement
Source
https://github.com/advisories/GHSA-3x4c-7xq6-9pq8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-3x4c-7xq6-9pq8/GHSA-3x4c-7xq6-9pq8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-3x4c-7xq6-9pq8
Aliases
Downstream
CGA (18)
MINI (3)
Published
2026-03-17T16:17:06Z
Modified
2026-09-10T03:50:36Z
Severity
  • 6.9 (Medium) CVSS_V4 - 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 CVSS Calculator
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)
Database specific
{
    "cwe_ids":  [
        "CWE-400"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-03-17T16:17:06Z",
    "nvd_published_at":  "2026-03-18T01:16:04Z",
    "severity":  "MODERATE"
}
References

Affected packages

npm / next

Package

Affected ranges

Type
SEMVER
Events
Introduced
16.0.0-beta.0
Fixed
16.1.7

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-3x4c-7xq6-9pq8/GHSA-3x4c-7xq6-9pq8.json"

npm / next

Package

Affected ranges

Type
SEMVER
Events
Introduced
10.0.0
Fixed
15.5.14

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-3x4c-7xq6-9pq8/GHSA-3x4c-7xq6-9pq8.json"