GHSA-2j2x-hqr9-3h42
React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation
Packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | react-router | >= 7.0.0, < 7.14.1 | 7.14.1 |
| npm | react-router | >= 6.7.0, < 6.30.4 | 6.30.4 |
| npm | @remix-run/router | >= 1.3.0, < 1.23.3 | 1.23.3 |
Details
As written in the advisory (Markdown source, shown as plain text).
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](https://reactrouter.com/start/modes#declarative) (`<BrowserRouter>`)
References
External links from the advisory. They lead to third-party sites.