CVE-2026-40181: React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation

Published Jun 2, 2026
·
Updated

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

7 affected componentsFixes available
npm/react-router>=7.0.0<=7.14.0, >=6.7.0<=6.30.3
npm/react-router>=6.7.0<6.30.4
6.30.4
npm/react-router>=7.0.0<7.14.1
7.14.1
Shopify React-router Node.js>=6.7.0<6.30.4
Shopify React-router Node.js>=7.0.0<7.14.1
IBM Db2 Genius Hub<=1.1, 1.1.1, 1.1.2
IBM Agentics<=1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/react-router to a version that resolves this vulnerability.

    Fixed in 6.30.4
  2. Upgrade

    Upgrade npm/react-router to a version that resolves this vulnerability.

    Fixed in 7.14.1
  3. Upgrade

    Upgrade react-router to a version that resolves this vulnerability.

    Fixed in 7.14.1
  4. Upgrade

    Upgrade react-router to a version that resolves this vulnerability.

    Fixed in 6.30.4

Event History

Jun 2, 2026
CVE Published
via MITRE·05:55 PM
Data Sourced
via MITRE·05:55 PM
DescriptionWeakness
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 3, 2026
Advisory Published
via GitHub·08:58 PM
Data Sourced
via GitHub·08:58 PM
DescriptionWeaknessAffected Software
Jul 13, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-40181?

CVE-2026-40181 has a medium severity rating of 6.6.

2

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.

3

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.

4

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.

5

What impact does CVE-2026-40181 have?

The impact of CVE-2026-40181 includes the potential for attackers to redirect users to external domains.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203