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-2026-27978

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

CVE-2026-27978 is a CSRF vulnerability in Vercel Next.js that allows attackers to bypass origin verification through sandboxed iframes. This article covers the technical details, affected versions, impact, and mitigation.

Published: March 20, 2026

CVE-2026-27978 Overview

CVE-2026-27978 is a Cross-Site Request Forgery (CSRF) vulnerability in Next.js, the popular React framework for building full-stack web applications. The vulnerability exists in the Server Action CSRF validation mechanism, where requests with origin: null were incorrectly treated as having a "missing" origin rather than being properly validated as cross-origin requests. This flaw allows attackers to bypass origin verification when requests originate from opaque contexts such as sandboxed iframes.

Critical Impact

Attackers can induce victim browsers to submit Server Actions from sandboxed contexts, potentially executing state-changing actions with victim credentials, leading to unauthorized operations on behalf of authenticated users.

Affected Products

  • Vercel Next.js versions 16.0.1 through 16.1.6
  • Applications using Next.js Server Actions without additional CSRF protection
  • Deployments that allow opaque origin contexts (sandboxed iframes)

Discovery Timeline

  • 2026-03-18 - CVE CVE-2026-27978 published to NVD
  • 2026-03-18 - Last updated in NVD database

Technical Details for CVE-2026-27978

Vulnerability Analysis

This CSRF vulnerability stems from improper handling of the origin: null header value in Next.js Server Action requests. The framework's CSRF protection mechanism was designed to validate the origin of incoming requests to prevent cross-site request forgery attacks. However, when the origin header was set to the literal string 'null' (which browsers send from privacy-sensitive contexts like sandboxed iframes), the validation logic incorrectly interpreted this as a missing origin value rather than an explicit cross-origin request indicator.

This misinterpretation allowed requests from sandboxed iframes and other opaque contexts to bypass the origin verification checks entirely. Since these contexts can still transmit credentials such as cookies, an attacker could craft a malicious page containing a sandboxed iframe that submits Server Action requests to a vulnerable Next.js application, executing actions with the victim's authenticated session.

Root Cause

The root cause lies in the conditional logic within the action-handler.ts file that processes the origin header. The original implementation used a condition that checked if originHeader !== 'null' before parsing the origin URL, effectively treating 'null' origins the same as completely absent origins. This design oversight failed to account for the security implications of opaque origin contexts, which are legitimate browser behaviors but require explicit handling in CSRF protection mechanisms.

Attack Vector

The attack vector is network-based and requires user interaction. An attacker can exploit this vulnerability by:

  1. Creating a malicious webpage containing a sandboxed iframe
  2. Configuring the iframe to point to or interact with the target Next.js application
  3. Inducing the victim to visit the malicious page while authenticated to the target application
  4. The sandboxed iframe sends requests with origin: null headers
  5. The vulnerable Next.js application bypasses CSRF validation and processes the Server Action
  6. State-changing operations execute with the victim's credentials
typescript
// Security patch from action-handler.ts
// Source: https://github.com/vercel/next.js/commit/a27a11d78e748a8c7ccfd14b7759ad2b9bf097d8

   workStore.fetchCache = 'default-no-store'
 
   const originHeader = req.headers['origin']
-  const originDomain =
-    typeof originHeader === 'string' && originHeader !== 'null'
-      ? new URL(originHeader).host
+  const originHost =
+    typeof originHeader === 'string'
+      ? // 'null' is a valid origin e.g. from privacy-sensitive contexts like sandboxed iframes.
+        // However, these contexts can still send along credentials like cookies,
+        // so we need to check if they're allowed cross-origin requests.
+        originHeader === 'null'
+        ? 'null'
+        : new URL(originHeader).host
       : undefined
   const host = parseHostHeader(req.headers)

Detection Methods for CVE-2026-27978

Indicators of Compromise

  • Unexpected Server Action requests originating from origin: null in application logs
  • State changes or data modifications without corresponding legitimate user activity
  • Unusual patterns of form submissions or API calls from sandboxed iframe contexts
  • Authentication events followed by immediate sensitive operations from null origins

Detection Strategies

  • Monitor HTTP request logs for Server Action endpoints receiving origin: null headers
  • Implement application-level logging that captures origin headers for all Server Action requests
  • Set up alerting for patterns of requests with null origins to sensitive endpoints
  • Review web server access logs for unusual referrer patterns combined with null origins

Monitoring Recommendations

  • Enable detailed request logging for all Next.js Server Action endpoints
  • Configure SIEM rules to alert on origin: null requests to sensitive application functions
  • Monitor for anomalous user session activity, particularly state-changing operations without corresponding UI interactions
  • Track and baseline normal origin patterns to identify deviations

How to Mitigate CVE-2026-27978

Immediate Actions Required

  • Upgrade Next.js to version 16.1.7 or later immediately
  • Audit existing Server Actions for sensitive state-changing operations
  • Implement additional CSRF token protection for critical Server Actions
  • Review experimental.serverActions.allowedOrigins configuration to ensure 'null' is not inadvertently allowed

Patch Information

The vulnerability is fixed in Next.js version 16.1.7. The patch modifies the origin header handling logic to treat 'null' as an explicit origin value rather than a missing value. After the fix, requests with origin: null are properly enforced against host/origin checks unless 'null' is explicitly allowlisted in the experimental.serverActions.allowedOrigins configuration. For detailed information about the fix, refer to the GitHub Security Advisory GHSA-mq59-m269-xvcx and the Next.js v16.1.7 release.

Workarounds

  • Add explicit CSRF tokens for all sensitive Server Actions as an additional protection layer
  • Configure SameSite=Strict on sensitive authentication cookies to prevent cross-site cookie transmission
  • Ensure 'null' is not included in serverActions.allowedOrigins unless intentionally required with additional protections
  • Consider implementing server-side request validation that explicitly rejects null origin requests for sensitive operations
bash
# Configuration example for next.config.js
# Ensure 'null' is NOT in allowedOrigins unless explicitly needed

# Example secure configuration:
# experimental: {
#   serverActions: {
#     allowedOrigins: ['your-domain.com', 'trusted-subdomain.your-domain.com']
#     // Do NOT include 'null' unless you have additional CSRF protection
#   }
# }

# After upgrading to 16.1.7, verify your Next.js version:
npm list next
# or
yarn list next

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

  • Vulnerability Details
  • TypeCSRF

  • Vendor/TechNext.js

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-352
  • Technical References
  • GitHub Next.js Release v16.1.7
  • Vendor Resources
  • GitHub Next.js Commit

  • GitHub Security Advisory GHSA-mq59-m269-xvcx
  • Related CVEs
  • CVE-2026-27977: Vercel Next.js Auth Bypass Vulnerability

  • CVE-2026-27979: Vercel Next.js DoS Vulnerability

  • CVE-2026-27980: Vercel Next.js DOS Vulnerability

  • CVE-2026-29057: Vercel Next.js Auth Bypass Vulnerability
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