CVE-2025-59471: High severity npm/next vulnerability
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.
Other sources
A DoS 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 and 16.1.5 to reduce risk and prevent availability issues in Next applications.
— GitHub
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-59471?
CVE-2025-59471 is classified as a denial of service vulnerability that can significantly impact application performance.
How do I fix CVE-2025-59471?
To resolve CVE-2025-59471, update your Next.js application to version 15.5.10 or higher, or 16.1.5 or higher.
What are the implications of CVE-2025-59471?
CVE-2025-59471 allows an attacker to exploit the image optimization endpoint by sending oversized images, leading to potential service downtime.
Which Next.js versions are affected by CVE-2025-59471?
CVE-2025-59471 affects Next.js versions prior to 15.5.10 and also versions before 16.1.5.
How can I mitigate risks related to CVE-2025-59471 before upgrading?
You can mitigate the risks by implementing a reverse proxy that limits the size of incoming requests to the image optimization endpoint.