Advisory

GHSA-h64f-5h5j-jqjh

Also known as: CVE-2026-44577

Summary

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

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-05-11 15:56 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

next

npm · All systems

Affected

  • introduced 10.0.0, fixed 15.5.16 (semver)

Fixed versions

15.5.16

Fix

next

npm · All systems

Affected

  • introduced 16.0.0, fixed 16.2.5 (semver)

Fixed versions

16.2.5

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences