CVE-2026-40181: React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation
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>)
Other sources
React Router is a router for React. In versions 7.0.0 through 7.14.0 and 6.7.0 through 6.30.3, certain URLs passed to the redirect function can trigger an open redirect to an external domain due to path values starting with // being reinterpreted as protocol-relative URLs. The level of impact depends on the validation done by the application prior to returning the redirect. This does not impact applications using Declarative Mode (<BrowserRouter>). This is patched in versions 7.14.1 and 6.30.4.
— MITRE
React Router is a router for React. In versions 7.0.0 through 7.14.0 and 6.7.0 through 6.30.3, certain URLs passed to the redirect function can trigger an open redirect to an external domain due to path values starting with // being reinterpreted as protocol-relative URLs. The level of impact depends on the validation done by the application prior to returning the redirect. This does not impact applications using Declarative Mode (BrowserRouter). This is patched in versions 7.14.1 and 6.30.4.
— IBM
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/react-routerto a version that resolves this vulnerability.Fixed in 6.30.4 - Upgrade
Upgrade
npm/react-routerto a version that resolves this vulnerability.Fixed in 7.14.1 - Upgrade
Upgrade
react-routerto a version that resolves this vulnerability.Fixed in 7.14.1 - Upgrade
Upgrade
react-routerto a version that resolves this vulnerability.Fixed in 6.30.4
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40181?
CVE-2026-40181 has a medium severity rating of 6.6.
How do I fix CVE-2026-40181?
To fix CVE-2026-40181, upgrade React Router to version 7.14.1 or later, or 6.30.4 or later.
What does CVE-2026-40181 exploit?
CVE-2026-40181 exploits a vulnerability in React Router that allows for open redirects due to protocol-relative URL reinterpretation.
Which versions of React Router are affected by CVE-2026-40181?
CVE-2026-40181 affects React Router versions 7.0.0 through 7.14.0 and 6.7.0 through 6.30.3.
What impact does CVE-2026-40181 have?
The impact of CVE-2026-40181 includes the potential for attackers to redirect users to external domains.