Medium · published May 13, 2026
Next.js is a React framework for building full-stack web applications. From 10.0.0 to before 15.5.16 and 16.2.5, when self-hosting Next.js with the default image loader, the Image Optimization API fetches local images entirely into memory without enforcing a maximum size limit. An attacker could cause out-of-memory conditions by requesting large local assets from the /_next/image endpoint that match the images.localPatterns configuration (by default, all patterns are allowed). This vulnerability is fixed in 15.5.16 and 16.2.5.
| Product | Versions | Fixed in |
|---|---|---|
| vercel/next.js | ≥ 10.0.0, < 15.5.16 | 15.5.16 |
| vercel/next.js | ≥ 16.0.0, < 16.2.5 | 16.2.5 |