megachangelog
Security14.2.32, 15.4.7

CVE-2025-57822: SSRF vulnerability in Next.js middleware patched

A Server-Side Request Forgery vulnerability in Next.js middleware (versions before v14.2.32 and v15.4.7) has been patched. The issue allowed misconfigured middleware that reflected user request headers to unintentionally route requests to attacker-controlled destinations, exploitable in self-hosted deployments.

Summary

Impact

Resolution

Workarounds

Credit

References

A vulnerability affecting has been addressed. It impacted versions prior to and , and involved a risk introduced by misconfigured usage of the function within middleware. Applications that reflected a user's request headers in this function, rather than passing them through the object, could unintentionally allow the server to issue requests to attacker-controlled destinations. Next.js Middlewarev14.2.32v15.4.7Server-Side Request Forgery (SSRF)NextResponse.next()request

A patch applied on August 25th, 2025 eliminated exposure for Vercel customers running the affected versions.

In affected configurations, an attacker could:

This issue is exploitable in self-hosted deployments where developers use custom middleware logic and do not adhere to documented usage of . It is on Vercel infrastructure, which isolates and protects internal request behavior.NextResponse.next({ request })not exploitable

The issue was resolved by updating the internal middleware logic to prevent unsafe fallback behavior when is omitted from the call. This ensures the origin server behavior cannot be unintentionally altered by user-supplied headers or misrouted requests.requestnext()

Fix available in:

For users who cannot upgrade immediately:

Thanks to at RootSys, and and the for their responsible disclosure.Dominik ProdingerNicolas Lamoureux Latacora team

Read more

  • Influence the destination of internal requests triggered by middleware routing logic

  • Perform SSRF against internal infrastructure if user-controlled headers (e.g.,

    ) were forwarded or interpreted without validationLocation

  • Potentially access sensitive internal resources or services unintentionally exposed via internal redirect behavior

  • Next.js v14.2.32

  • Next.js v15.4.7

  • Ensure middleware follows official guidance: Use to explicitly pass the request objectNextResponse.next({ request })

  • Avoid forwarding user-controlled headers to downstream systems without validation

  • Ensure headers that should never be sent from client to server are not reflected back to the client via , such as .NextResponse.nextLocation

securityssrfmiddlewarenext.jscve

Source: original entry ↗

More from Vercel

Follow Vercel to get its new changes in your feed and email digest.

Announcement2026.10.19

Updates to Hobby and Pro Terms of Service

Vercel is updating Terms of Service for Hobby and Pro customers effective October 19, 2026, clarifying credit policies, managed accounts, auto-renewal practices, and adding statutory cancellation and refund rights for UK and EU consumers, including protections for service changes with negative impact.

termsbillingcreditspolicylegal
Announcement

Mercury 3 now available on AI Gateway

Inception's Mercury 3 model is now available on Vercel's AI Gateway with 50% launch pricing and generation speeds exceeding 1,000 tokens per second. The model enables parallel text refinement with a 1M-token context window, ideal for real-time applications like browser agents and customer support.

ai-gatewaymodelsinferencellmlaunch
Announcement

MiniMax M3.1 Flash now available on AI Gateway for free

MiniMax M3.1 Flash, an open-weight multimodal model with 1M-token context window for coding and agentic work, is now available on Vercel's AI Gateway at no cost through October 20. The model excels at complex agent tasks, coding applications, and cybersecurity work, and can be used through multiple APIs and coding agents.

ai-gatewaymodelscodingagentsapi
See all Vercel changes →