Cross-site Request Forgery (CSRF) Affecting react-router package, versions >=7.12.0 <7.18.3>=8.0.0 <8.3.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.59% (50th 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-REACTROUTER-23184468
  • published1 Dec 2026
  • disclosed30 Nov 2026
  • creditJoost Grunwald

Introduced: 30 Nov 2026

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

How to fix?

Upgrade react-router to version 7.18.3, 8.3.1 or higher.

Overview

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via a cross-scheme bypass in the throwIfPotentialCSRFAttack function in packages/react-router/lib/actions.ts. The function compares only the host portion of the Origin header against the request URL host, rather than comparing full origins (scheme + host + port). An attacker can craft a request where the Origin header shares the same host but uses a different scheme (e.g., http:// vs https://), causing the validation to incorrectly pass and allowing cross-site request forgery against server-side actions on behalf of authenticated users.

Note: This is only exploitable in Framework, unstable RSC Data, and unstable RSC Framework modes, and depends on the application's deployment, authentication cookie configuration, and use of server-side actions.

CVSS Base Scores

version 4.0
version 3.1