CVE-2025-57752
ASP.NET Core vulnerability analysis and mitigation

Overview

Next.js, a React framework for building full-stack web applications, disclosed a cache key confusion vulnerability (CVE-2025-57752) affecting versions before 14.2.31 and from 15.0.0 to before 15.4.5. The vulnerability was discovered on August 29, 2025, and involves the Next.js Image Optimization API routes. 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 (NVD, GitHub Advisory).

Technical details

The vulnerability lies in the Next.js Image Optimizer's handling of images served from internal API routes. The root cause was identified in the fetchInternalImage function within packages/next/src/server/image-optimizer.ts. This function was forwarding the incoming request's headers to the internal API route, causing the route to generate user-specific images. However, the resulting optimized image was stored in the cache using a key that did not include the headers that influenced the image content. The vulnerability has been assigned a CVSS v3.1 base score of 6.2 (Moderate) with a vector string of CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N (GitHub Advisory, Vercel Changelog).

Impact

The vulnerability could lead to unauthorized disclosure of user-specific or protected image content and cross-user leakage of conditional content via CDN or internal cache. This issue arises without user interaction and requires no elevated privileges, only a prior authorized request to populate the cache. It's worth noting that Vercel deployments were never impacted by this vulnerability (Vercel Changelog).

Mitigation and workarounds

The issue has been fixed in Next.js versions 14.2.31 and 15.4.5. The resolution ensures that request headers aren't forwarded to the request that is proxied to the image endpoint, preventing the image endpoint from serving images that require authorization data and thus cannot be cached. All users are encouraged to upgrade if they use API routes to serve images that depend on request headers and have image optimization enabled (GitHub Advisory, Vercel Changelog).

Additional resources


SourceThis report was generated using AI

Related ASP.NET Core vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-55315CRITICAL9.9
  • C#C#
  • Microsoft.AspNetCore.App.Runtime.win-x86
NoYesOct 14, 2025
CVE-2025-55247HIGH7.3
  • C#C#
  • aspnetcore-runtime-dbg-8.0
NoYesOct 14, 2025
CVE-2025-57752MEDIUM6.2
  • ASP.NET CoreASP.NET Core
  • aspnetcore-targeting-pack-7.0
NoYesAug 29, 2025
CVE-2025-55248MEDIUM4.8
  • C#C#
  • dotnet-hostfxr-9.0
NoYesOct 14, 2025
CVE-2025-55173MEDIUM4.3
  • ASP.NET CoreASP.NET Core
  • dotnet-targeting-pack-7.0
NoYesAug 29, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management