Cross-site Request Forgery (CSRF) Affecting next package, versions >=16.0.1 <16.1.7>=16.2.0-canary.0 <16.2.0-canary.102


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.02% (5th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-NEXT-15674557
  • published17 Mar 2026
  • disclosed17 Mar 2026
  • creditUnknown

Introduced: 17 Mar 2026

NewCVE-2026-27978  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade next to version 16.1.7, 16.2.0-canary.102 or higher.

Overview

next is a react framework.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) due to the uncaught origin: null in the Server Action CSRF validation. An attacker can perform unauthorized state-changing actions on behalf of a user by inducing the user's browser to submit requests from a sandboxed context, bypassing origin verification.

Workaround

This vulnerability can be mitigated by adding CSRF tokens for sensitive Server Actions, preferring SameSite=Strict on sensitive authentication cookies, and ensuring that null is not allowed in serverActions.allowedOrigins unless intentionally required and additionally protected.

CVSS Base Scores

version 4.0
version 3.1