Packages / react-router / Security
React Router vulnerable to XSS via Open Redirects
Affected releases · react-router
- 7.x7.0.0 – 7.11.0Fixed in 7.12.0
On 7.x, the newest line:
npm install react-router@7.12.0Not affected
8.0.0 – 8.5.0
8 releases, latest
Affected
7.0.0 – 7.11.0
36 releases
Fixed
7.12.0 – 7.18.4
16 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
React Router (and Remix v1/v2) SPA open navigation redirects originating from loaders or actions in Framework Mode, Data Mode, or the unstable RSC modes can result in unsafe URLs causing unintended javascript execution on the client. This is only an issue if developers are creating redirect paths from untrusted content or via an open redirect.
[!NOTE] This does not impact applications that use Declarative Mode (
<BrowserRouter>).