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-2026-27978: CWE-352: Cross-Site Request Forgery (CSRF) in vercel next.js

0
Medium
VulnerabilityCVE-2026-27978cvecve-2026-27978cwe-352
Published: Tue Mar 17 2026 (03/17/2026, 23:59:22 UTC)
Source: CVE Database V5
Vendor/Project: vercel
Product: next.js

Description

CVE-2026-27978 is a Cross-Site Request Forgery (CSRF) vulnerability in Next. js versions 16. 0. 1 up to but not including 16. 1. 7. The issue arises because the framework treated 'origin: null' as a missing origin during Server Action CSRF validation, allowing requests from opaque contexts like sandboxed iframes to bypass origin checks. This flaw enables attackers to trick users into submitting unauthorized Server Actions that can change state with the victim's credentials. The vulnerability is fixed in version 16. 1.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 03/25/2026, 01:03:10 UTC

Technical Analysis

Next.js, a popular React framework for full-stack web applications, had a CSRF vulnerability identified as CVE-2026-27978 affecting versions from 16.0.1 up to but not including 16.1.7. The root cause was the improper handling of the 'origin' header during Server Action CSRF validation. Specifically, requests with 'origin: null'—which occur in opaque contexts such as sandboxed iframes—were treated as if the origin was missing, allowing these requests to bypass origin verification checks. This flaw permitted attackers to craft malicious web pages that, when visited by a victim, could submit Server Actions from sandboxed contexts without proper origin validation. Such actions could change application state or perform sensitive operations using the victim's credentials, effectively enabling CSRF attacks. The vulnerability was addressed in Next.js 16.1.7 by treating 'null' as a valid origin value and enforcing strict host/origin checks unless 'null' is explicitly allowlisted in the experimental.serverActions.allowedOrigins configuration. This fix ensures that requests from opaque origins are either blocked or explicitly permitted with additional protections. If immediate upgrading is not feasible, developers are advised to implement CSRF tokens on sensitive Server Actions, use SameSite=Strict on authentication cookies to limit cross-site cookie transmission, and avoid allowing 'null' in allowed origins unless necessary and secured. The CVSS 4.0 vector indicates the attack is network-based, requires no privileges or authentication, but does require user interaction, with a medium impact on integrity and low impact on confidentiality and availability.

Potential Impact

This vulnerability allows attackers to perform CSRF attacks against applications using vulnerable Next.js versions, potentially causing unauthorized state changes such as modifying user data, performing transactions, or altering application settings under the victim's session. Since the attack exploits the browser's trust in the user's credentials and session cookies, it can lead to compromised user accounts and unauthorized operations without the victim's explicit consent. The impact is particularly significant for applications handling sensitive data or critical operations, as attackers can manipulate server-side actions that rely on Server Actions. While the vulnerability does not directly expose confidential data or cause denial of service, the integrity of application state and user trust can be severely undermined. Organizations relying on Next.js for web applications face risks of reputational damage, regulatory non-compliance, and potential financial loss if exploited. The medium CVSS score reflects the moderate severity due to the requirement of user interaction and the limited scope of impact to integrity rather than confidentiality or availability.

Mitigation Recommendations

1. Upgrade all Next.js applications to version 16.1.7 or later, which includes the fix treating 'null' as an explicit origin and enforcing strict origin checks. 2. For environments where immediate upgrading is not possible, implement CSRF tokens on all sensitive Server Actions to ensure requests are validated beyond origin headers. 3. Configure authentication cookies with the SameSite=Strict attribute to prevent them from being sent with cross-origin requests, reducing CSRF risk. 4. Review and restrict the experimental.serverActions.allowedOrigins configuration to disallow 'null' unless absolutely necessary, and if allowed, ensure additional protections such as token validation are in place. 5. Conduct thorough security testing of Server Actions, especially those that change state or perform sensitive operations, to verify that CSRF protections are effective. 6. Educate developers about the risks of opaque origins and the importance of strict origin validation in web applications. 7. Monitor application logs for unusual Server Action requests originating from unexpected contexts or origins. 8. Employ Content Security Policy (CSP) headers to restrict iframe embedding and sandboxing where possible, reducing attack surface for opaque origin exploitation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-02-25T03:24:57.793Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 69b9ee21771bdb1749ef1e18

Added to database: 3/18/2026, 12:13:21 AM

Last enriched: 3/25/2026, 1:03:10 AM

Last updated: 5/1/2026, 3:49:22 AM

Views: 121

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 more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses