Skip to content

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

Moderate severity GitHub Reviewed Published Aug 29, 2025 in vercel/next.js • Updated Sep 3, 2025

Package

npm next (npm)

Affected versions

>= 15.0.0, <= 15.4.4
>= 0.9.9, < 14.2.31

Patched versions

15.4.5
14.2.31

Description

A vulnerability in Next.js Image Optimization has been fixed in v15.4.5 and v14.2.31. 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.

All users are encouraged to upgrade if they use API routes to serve images that depend on request headers and have image optimization enabled.

More details at Vercel Changelog

References

@aaronbrown-vercel aaronbrown-vercel published to vercel/next.js Aug 29, 2025
Published to the GitHub Advisory Database Aug 29, 2025
Reviewed Aug 29, 2025
Published by the National Vulnerability Database Aug 29, 2025
Last updated Sep 3, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(2nd percentile)

Weaknesses

Use of Cache Containing Sensitive Information

The code uses a cache that contains sensitive information, but the cache can be read by an actor outside of the intended control sphere. Learn more on MITRE.

CVE ID

CVE-2025-57752

GHSA ID

GHSA-g5qg-72qw-gw5v

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.