Packages / react-router / Security
ModerateVulnerabilityGHSA-2j2x-hqr9-3h42CVE-2026-40181Published 3 Jun 2026
React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation
Affected releases · react-router
- 7.x7.0.0 – 7.14.0Fixed in 7.14.1
- 6.x6.7.0 – 6.30.3Fixed in 6.30.4
On 7.x, the newest line:
npm install react-router@7.14.18.x
Not affected
8.0.0 – 8.5.0
8 releases, latest
7.x
Affected
7.0.0 – 7.14.0
41 releases
Fixed
7.14.1 – 7.18.4
11 releases
6.x
Not affected
6.0.0 – 6.6.2
19 releases
Affected
6.7.0 – 6.30.3
48 releases
Fixed
6.30.4 – 6.30.6
3 releases
Is your project affected?
Paste your package.json, or type the range you declare for react-router. It is read in your browser and sent nowhere.
What happens
Certain URLs passed to the redirect function can trigger an open redirect to an external domain depending on the level of validation done by the application prior to returning the redirect.
[!NOTE] This does not impact your React Router application if you are using Declarative Mode (
<BrowserRouter>)