Skip to content
OpenAdvisories
Medium · 6.2 CVE-2025-57752 EUVD-2025-28624GHSA-g5qg-72qw-gw5v

Next.js Affected by Cache Key Confusion for Image Optimization API Routes

Published Aug 29, 2025 · Updated Sep 2, 2025 · Assigned by GitHub_M

Description

Next.js is a React framework for building full-stack web applications. In versions before 14.2.31 and from 15.0.0 to before 15.4.5, Next.js Image Optimization API routes are affected by cache key confusion. When images returned from API routes vary based on request headers (such as Cookie or Authorization), these responses could be incorrectly cached and served to unauthorized users due to a cache key confusion bug. This vulnerability has been fixed in Next.js versions 14.2.31 and 15.4.5. All users are encouraged to upgrade if they use API routes to serve images that depend on request headers and have image optimization enabled.

Affected products

VendorProductAffectedFixed
vercel next.js >= 15.0.0, < 15.4.5, < 14.2.31 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling jitsucom-jitsu +2 2.11.0-r1 —

Affected packages

EcosystemPackageAffectedFixedRecord
npm next >= 0.9.9, < 14.2.31 14.2.31 GHSA-g5qg-72qw-gw5v
npm next >= 15.0.0, < 15.4.5 15.4.5 GHSA-g5qg-72qw-gw5v

Advisories 1

References