CVE-2026-40181: React router React Router's Same-origin Redirect With Vulnerability

MODERATE
Advisory Identifier: GHSA-2j2x-hqr9-3h42
CWE-601
Published
Advisory Summary

CVE-2026-40181 is a MODERATE react router's same-origin redirect with vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting React router libraries in the npm ecosystem. The issue involves react router's same-origin redirect with path starting // causes open redirect via protocol-relative url reinterpretation. Remediation is available by upgrading affected packages to version 7.14.1, 6.30.4, 1.23.3.

CVE-2026-40181 at a Glance

CVE Identifier CVE-2026-40181
GHSA Identifier GHSA-2j2x-hqr9-3h42
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product React router
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-40181

To remediate this vulnerability, upgrade all affected React router dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

react-router fixed: 7.14.1
npm install react-router@7.14.1
react-router fixed: 6.30.4
npm install react-router@6.30.4
@remix-run/router fixed: 1.23.3
npm install @remix-run/router@1.23.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls react-router

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-40181, inspect your project dependencies using npm:

npm ls react-router

Analyze the terminal output to locate any version of React router in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.14.1), your application is affected.

Note: The npm ls react-router command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In React router, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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>`)

CVE-2026-40181 Affected React router Versions

3 component(s)
Fixed Versions:
7.14.16.30.41.23.3
Product / Package Ecosystem Affected Versions Fixed Version
react-router
npm
≥ 7.0.0
< 7.14.1
7.14.1
react-router
npm
≥ 6.7.0
< 6.30.4
6.30.4
@remix-run/router
npm
≥ 1.3.0
< 1.23.3
1.23.3

References

Frequently Asked Questions

What is CVE-2026-40181?
CVE-2026-40181 is a security vulnerability in React router involving React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which React router versions are affected?
Affected versions include releases prior to 7.14.1, 6.30.4, 1.23.3 across affected packages: react-router, @remix-run/router.
What version fixes CVE-2026-40181?
Upgrading to 7.14.1, 6.30.4, 1.23.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is react-router affected?
Yes, react-router is affected in releases prior to 7.14.1, 6.30.4. Upgrade your dependency to 7.14.1, 6.30.4 or later.
Is @remix-run/router affected?
Yes, @remix-run/router is affected in releases prior to 1.23.3. Upgrade your dependency to 1.23.3 or later.
What CWE is associated with CVE-2026-40181?
CVE-2026-40181 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for CVE-2026-40181?
Run the dependency tree command: 'npm ls react-router'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2j2x-hqr9-3h42",
  "modified" : "2026-08-04T21:26:09Z",
  "published" : "2026-06-03T20:58:01Z",
  "aliases" : [ "CVE-2026-40181" ],
  "summary" : "React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation",
  "details" : "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`.\n\n> [!NOTE]\n> This does not impact your React Router application if you are using [Declarative Mode](https://reactrouter.com/start/modes#declarative) (`<BrowserRouter>`)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "react-router"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.14.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "react-router"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.7.0"
      }, {
        "fixed" : "6.30.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@remix-run/router"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "1.23.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/remix-run/react-router/security/advisories/GHSA-2j2x-hqr9-3h42"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40181"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/remix-run/react-router/commit/d77f6b1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/remix-run/react-router"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-03T20:58:01Z",
    "nvd_published_at" : "2026-06-02T20:16:35Z"
  }
}