Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-57822: CWE-918: Server-Side Request Forgery (SSRF) in vercel next.js

0
Medium
VulnerabilityCVE-2025-57822cvecve-2025-57822cwe-918
Published: Fri Aug 29 2025 (08/29/2025, 21:33:15 UTC)
Source: CVE Database V5
Vendor/Project: vercel
Product: next.js

Description

Next.js is a React framework for building full-stack web applications. Prior to versions 14.2.32 and 15.4.7, when next() was used without explicitly passing the request object, it could lead to SSRF in self-hosted applications that incorrectly forwarded user-supplied headers. This vulnerability has been fixed in Next.js versions 14.2.32 and 15.4.7. All users implementing custom middleware logic in self-hosted environments are strongly encouraged to upgrade and verify correct usage of the next() function.

AI-Powered Analysis

AILast updated: 09/07/2025, 00:35:23 UTC

Technical Analysis

CVE-2025-57822 is a Server-Side Request Forgery (SSRF) vulnerability identified in the Next.js framework, a popular React-based platform for building full-stack web applications. This vulnerability affects self-hosted Next.js applications running versions prior to 14.2.32 and 15.4.7. The root cause lies in the improper handling of the next() function within custom middleware logic. Specifically, when next() is invoked without explicitly passing the request object, the framework may incorrectly forward user-supplied headers. This flaw enables an attacker to craft malicious requests that the server then forwards internally, potentially accessing internal resources or services that are not intended to be exposed externally. SSRF vulnerabilities are particularly dangerous because they can allow attackers to bypass network access controls, reach internal-only endpoints, or exploit trust relationships within the infrastructure. The vulnerability has been assigned a CVSS v3.1 base score of 6.5, indicating a medium severity level. The vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N) shows that the attack can be performed remotely without authentication or user interaction but requires high attack complexity. The impact primarily affects confidentiality (high impact), with limited integrity impact and no availability impact. No known exploits are currently reported in the wild, but the vulnerability is publicly disclosed and fixed in versions 14.2.32 and 15.4.7. Organizations using custom middleware in self-hosted Next.js environments should urgently review their usage of next() and upgrade to the patched versions to mitigate this risk.

Potential Impact

For European organizations, the impact of this SSRF vulnerability can be significant, especially for those relying on Next.js for internal or customer-facing web applications. Exploitation could allow attackers to access sensitive internal services, databases, or metadata endpoints that are otherwise protected by network segmentation or firewalls. This could lead to unauthorized disclosure of confidential information, including personal data protected under GDPR, intellectual property, or internal configuration details. The partial integrity impact means attackers might manipulate some internal requests, potentially leading to further exploitation or pivoting within the network. While availability is not directly affected, the breach of confidentiality alone can result in regulatory penalties, reputational damage, and financial losses. The medium severity score suggests that exploitation is not trivial but feasible, emphasizing the need for proactive patching and code review. Organizations with complex middleware or custom header forwarding logic are at higher risk. Given the widespread adoption of Next.js in Europe’s tech sector, especially among startups and enterprises building modern web applications, the threat is relevant and should be addressed promptly.

Mitigation Recommendations

1. Upgrade Next.js to versions 14.2.32 or 15.4.7 or later immediately to incorporate the official fix. 2. Conduct a thorough audit of all custom middleware implementations to ensure that the next() function is always called with the explicit request object, avoiding implicit forwarding of user-supplied headers. 3. Implement strict validation and sanitization of all headers and user inputs that influence internal requests. 4. Employ network segmentation and internal access controls to limit the exposure of sensitive internal endpoints, reducing the impact of potential SSRF exploitation. 5. Monitor application logs for unusual internal request patterns that may indicate SSRF attempts. 6. Use Web Application Firewalls (WAFs) with rules tailored to detect and block SSRF attack patterns targeting Next.js applications. 7. Educate development teams about secure middleware practices and the risks of SSRF to prevent similar issues in future code.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-08-20T14:30:35.011Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68b22005ad5a09ad007bb545

Added to database: 8/29/2025, 9:47:49 PM

Last enriched: 9/7/2025, 12:35:23 AM

Last updated: 10/14/2025, 8:29:03 AM

Views: 284

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats