Packages / next / Security

ModerateVulnerabilityGHSA-h64f-5h5j-jqjhCVE-2026-44577Published 11 May 2026

Next.js has a Denial of Service in the Image Optimization API

Affected releases · next

  • 16.x16.0.0 – 16.2.4Fixed in 16.2.5
  • 15.x15.0.0 – 15.5.15Fixed in 15.5.16
  • 14.x14.0.0 – 14.2.35No fix on this line yet
  • 13.x and older10.0.0 – 13.5.11No fix, no longer updated

On 16.x, the newest line:

npm install next@16.2.5
16.x
  1. Affected

    16.0.0 – 16.2.4

    25 releases

  2. Fixed

    16.2.5 – 16.4.2

    20 releases, latest

15.x
  1. Affected

    15.0.0 – 15.5.15

    70 releases

  2. Fixed

    15.5.16 – 15.5.28

    12 releases

14.x
  1. Affected

    14.0.0 – 14.2.35

    46 releases

13.x
  1. Affected

    13.0.0 – 13.5.11

    56 releases

12.x
  1. Affected

    12.0.0 – 12.3.7

    33 releases

11.x
  1. Affected

    11.0.0 – 11.1.4

    7 releases

10.x
  1. Affected

    10.0.0 – 10.2.3

    18 releases

423 stable releases of next, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for next. It is read in your browser and sent nowhere.

What happens

Impact

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

  • If you are using images.localPatterns, only the patterns in that array are impacted.

  • If you are using images.unoptimized: true, you are NOT impacted.

  • If you are using images.loader: 'custom', you are NOT impacted.

  • If you are using Vercel, you are NOT impacted.

Fix

We now apply response size limits consistently to internal image fetches, not just external ones, and fail oversized responses before they can exhaust process memory.

This can be adjusted using the images.maximumResponseBody configuration.

Workarounds

If you cannot upgrade immediately, avoid routing large local assets through /_next/image, disable image optimization for large or untrusted local files, or block image optimization access to those assets at the edge.

You can disable using the images.localPatterns: [] configuration. This will still allow fetching remote images (which is not impacted).