Server Action CSRF Vulnerability in Next.js Framework by Vercel
CVE-2026-27978
5.3MEDIUM
What is CVE-2026-27978?
A vulnerability in the Next.js framework allows CSRF attacks due to improper handling of the 'origin' header. Specifically, the framework treats 'origin: null' as a missing origin, enabling attackers to bypass crucial verification processes in Server Actions when invoked from opaque contexts like sandboxed iframes. This could let unauthorized requests be executed using the victim’s credentials. The issue has been resolved in version 16.1.7, which mandates strict origin checks unless 'null' is explicitly allowed. Recommendations for mitigation include using CSRF tokens for sensitive server actions and ensuring proper cookie settings.
Affected Version(s)
next.js >= 16.0.1, < 16.1.7