Vulnerability
CVE-2025-59471
A denial of service vulnerability exists in self-hosted Next.js applications that have `remotePatterns` configured for the Image Optimizer. The image optimization endpoint (`/_next/image`) loads external images entirely into memory without enforcing a maximum size limit, allowing an attacker to cause out-of-memory conditions by requesting optimization of arbitrarily large images. This vulnerability requires that `remotePatterns` is configured to allow image optimization from external domains and that the attacker can serve or control a large image on an allowed domain. Strongly consider upgrading to 15.5.10 or 16.1.5 to reduce risk and prevent availability issues in Next applications.
12 advisories report this vulnerability, across 4 ecosystems.
Advisories
- CGA-3m85-g76f-cv3v
- CGA-79w8-jqjh-89cr
- CGA-g4w2-cxjc-8w8w
- CGA-h9fx-3r46-24rq
- CGA-m666-vwfj-v8rw
- CGA-pw97-fj5v-32gf
- CGA-q8w9-8wj3-jp5f
- CGA-r8x7-jhjp-vxmv
- CGA-vj9r-62cx-69xp
- CGA-w979-cjc5-rv7r
-
GHSA-9g9p-9gw9-jx7f
Next.js self-hosted applications vulnerable to DoS via Image Optimizer remotePatterns configuration
-
RHVEX-CVE-2025-59471
next: NextJS Denial of Service in Image Optimizer