The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-57822

CVE-2025-57822: Vercel Next.js SSRF Vulnerability

CVE-2025-57822 is an SSRF vulnerability in Vercel Next.js affecting self-hosted applications using next() without explicit request objects. This article covers technical details, affected versions, impact, and mitigation.

Published: March 11, 2026

CVE-2025-57822 Overview

CVE-2025-57822 is a Server-Side Request Forgery (SSRF) vulnerability in Vercel's Next.js framework that affects self-hosted applications using custom middleware logic. The vulnerability occurs when the next() function is used without explicitly passing the request object, leading to incorrect forwarding of user-supplied headers that can be exploited to perform SSRF attacks against internal services.

Critical Impact

Self-hosted Next.js applications with custom middleware implementations may inadvertently forward malicious user-controlled headers, enabling attackers to make unauthorized requests to internal services and potentially access sensitive data or internal resources.

Affected Products

  • Vercel Next.js versions prior to 14.2.32
  • Vercel Next.js versions prior to 15.4.7
  • Self-hosted Next.js applications using custom middleware

Discovery Timeline

  • 2025-08-29 - CVE-2025-57822 published to NVD
  • 2025-09-08 - Last updated in NVD database

Technical Details for CVE-2025-57822

Vulnerability Analysis

This vulnerability is classified as CWE-918 (Server-Side Request Forgery). The issue stems from improper handling of HTTP request objects within Next.js middleware when developers call the next() function without explicitly passing the request object. In this scenario, user-supplied headers are incorrectly forwarded through the middleware chain, allowing attackers to inject malicious headers that influence subsequent server-side requests.

The vulnerability is particularly dangerous in self-hosted environments where the application may have access to internal network resources, databases, or cloud metadata endpoints that should not be accessible from external requests.

Root Cause

The root cause lies in the router utilities module of Next.js, specifically in how the framework handles location response headers and redirect status codes during request resolution. When middleware invokes next() without the request parameter, the framework fails to properly sanitize or validate the forwarded headers, creating a path for user-controlled data to influence internal server requests.

The security patch addresses this by importing and enforcing allowedStatusCodes from the redirect-status library, adding validation to the router handling logic when setting location response headers.

Attack Vector

An attacker can exploit this vulnerability by crafting HTTP requests with specially crafted headers targeting a vulnerable Next.js application. The attack requires network access to the target application and no authentication or user interaction. When the malicious headers are forwarded through the middleware, they can direct the server to make requests to arbitrary internal or external endpoints, potentially exposing sensitive configuration data, internal service responses, or cloud metadata.

typescript
import { toNodeOutgoingHttpHeaders } from '../../web/utils'
import { isAbortError } from '../../pipe-readable'
import { getHostname } from '../../../shared/lib/get-hostname'
-import { getRedirectStatus } from '../../../lib/redirect-status'
+import {
+  getRedirectStatus,
+  allowedStatusCodes,
+} from '../../../lib/redirect-status'
import { normalizeRepeatedSlashes } from '../../../shared/lib/utils'
import { getRelativeURL } from '../../../shared/lib/router/utils/relativize-url'
import { addPathPrefix } from '../../../shared/lib/router/utils/add-path-prefix'

Source: GitHub Commit 9c9aaed

Detection Methods for CVE-2025-57822

Indicators of Compromise

  • Unusual outbound requests from Next.js application servers to internal IP ranges or cloud metadata endpoints
  • Unexpected Host, X-Forwarded-Host, or similar headers in application logs that don't match legitimate traffic patterns
  • Server-side requests to localhost, 127.0.0.1, 169.254.169.254, or internal DNS names originating from the web application tier

Detection Strategies

  • Implement network traffic monitoring to detect anomalous outbound connections from application servers to internal network segments
  • Review middleware code for instances of next() being called without explicit request object parameters
  • Enable verbose logging for Next.js middleware to capture and analyze header forwarding behavior
  • Deploy web application firewall (WAF) rules to detect SSRF payload patterns in request headers

Monitoring Recommendations

  • Configure alerts for outbound connections from application servers to RFC 1918 private IP address ranges
  • Monitor for requests to cloud metadata service endpoints (e.g., 169.254.169.254 for AWS/GCP/Azure)
  • Implement DNS query logging to identify internal service discovery attempts from the application tier
  • Establish baseline network behavior for Next.js applications and alert on deviations

How to Mitigate CVE-2025-57822

Immediate Actions Required

  • Upgrade Next.js to version 14.2.32 or 15.4.7 or later immediately
  • Audit all custom middleware implementations to ensure next() is called with explicit request objects
  • Review and restrict outbound network access from application servers using firewall rules or network policies
  • Implement egress filtering to block requests to internal networks and cloud metadata endpoints

Patch Information

Vercel has released security patches in Next.js versions 14.2.32 and 15.4.7 that address this vulnerability. The fix modifies the router handling logic in packages/next/src/server/lib/router-utils/resolve-routes.ts to properly validate status codes and prevent unauthorized header forwarding.

For detailed patch information, refer to:

  • GitHub Security Advisory GHSA-4342-x723-ch2f
  • Vercel CVE Changelog
  • GitHub Commit 9c9aaed

Workarounds

  • Ensure all middleware functions explicitly pass the request object to next(request) rather than calling next() without parameters
  • Implement a reverse proxy or API gateway that strips or validates sensitive headers before forwarding to the Next.js application
  • Configure network-level controls to block SSRF attempts by restricting application egress to known-good destinations
  • Deploy additional input validation on headers in middleware before processing
bash
# Upgrade Next.js to patched versions
npm install next@14.2.32
# or for version 15.x
npm install next@15.4.7

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSSRF

  • Vendor/TechNext.js

  • SeverityHIGH

  • CVSS Score8.2

  • EPSS Probability5.63%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-918
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory

  • Vercel CVE Changelog
  • Related CVEs
  • CVE-2024-34351: Vercel Next.js SSRF Vulnerability

  • CVE-2026-27977: Vercel Next.js Auth Bypass Vulnerability

  • CVE-2026-27978: Vercel Next.js CSRF Vulnerability

  • CVE-2026-27979: Vercel Next.js DoS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English