react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
7.18.6 is the newest release of 7.x.
In short
6 fixed
Security
13 advisories affect 7.6.1; 7.18.0 fixes them
- HighReact Router: Unauthenticated Denial of Service via Inefficient Route MatchingGHSA-chx6-hx7r-mcp5 · 24 Jul 2026Fixed in 7.18.0
- HighReact Router vulnerable to Denial of Service via reflected user input in single-fetchGHSA-rxv8-25v2-qmq8 · 4 Jun 2026Fixed in 7.14.0
- HighReact Router vulnerable to DoS via unbounded path expansion in __manifest endpointGHSA-8x6r-g9mw-2r78 · 3 Jun 2026Fixed in 7.15.0
- HighReact Router's vendored turbo-stream v2 allows arbitrary constructor invocation via TYPE_ERROR deserialization leading to Unauth RCEGHSA-49rj-9fvp-4h2h · 3 Jun 2026Fixed in 7.14.2
- HighReact Router vulnerable to XSS via Open RedirectsGHSA-2w69-qvjg-hvjx · 8 Jan 2026Fixed in 7.12.0
8 more
- HighReact Router SSR XSS in ScrollRestorationGHSA-8v8x-cx79-35w7 · 8 Jan 2026Fixed in 7.12.0
- HighReact Router has XSS VulnerabilityGHSA-3cgp-3xvw-98x8 · 8 Jan 2026Fixed in 7.9.0
- ModerateReact Router: Open redirect via backslash in <Link> and useNavigate (CVE-2025-68470 bypass)GHSA-wrjc-x8rr-h8h6 · 23 Jul 2026Fixed in 7.18.0
- ModerateReact Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR HydrationGHSA-337j-9hxr-rhxg · 23 Jul 2026Fixed in 7.18.0
- ModerateReact Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretationGHSA-2j2x-hqr9-3h42 · 3 Jun 2026Fixed in 7.14.1
- ModerateReact Router has stored XSS via unescaped Location header in prerendered redirect HTMLGHSA-f22v-gfqf-p8f3 · 3 Jun 2026Fixed in 7.13.2
- ModerateReact Router has CSRF issue in Action/Server Action Request ProcessingGHSA-h5cw-625j-3rxh · 8 Jan 2026Fixed in 7.12.0
- ModerateReact Router has unexpected external redirect via untrusted pathsGHSA-9jcx-v3wj-wh4m · 8 Jan 2026Fixed in 7.9.6
Release note
The section about react-router of a note shared by several packages.
Patch Changes
Update
Route.MetaArgsto reflect thatdatacan be potentiallyundefinedThis is primarily for cases where a route
loaderthrew an error to it's ownErrorBoundary. but it also arises in the case of a 404 which renders the rootErrorBoundary/metabut the root loader did not run because not routes matched.Partially revert optimization added in
7.1.4to reduce calls tomatchRoutesbecause it surfaced other issuesFix typegen when same route is used at multiple paths
For example,
routes/route.tsxis used at 4 different paths here:import { type RouteConfig, route } from "@react-router/dev/routes"; export default [ route("base/:base", "routes/base.tsx", [ route("home/:home", "routes/route.tsx", { id: "home" }), route("changelog/:changelog", "routes/route.tsx", { id: "changelog" }), route("splat/*", "routes/route.tsx", { id: "splat" }), ]), route("other/:other", "routes/route.tsx", { id: "other" }), ] satisfies RouteConfig;Previously, typegen would arbitrarily pick one of these paths to be the "winner" and generate types for the route module based on that path.
Now, typegen creates unions as necessary for alternate paths for the same route file.Better types for
paramsFor example:
// routes.ts import { type RouteConfig, route } from "@react-router/dev/routes"; export default [ route("parent/:p", "routes/parent.tsx", [ route("layout/:l", "routes/layout.tsx", [ route("child1/:c1a/:c1b", "routes/child1.tsx"), route("child2/:c2a/:c2b", "routes/child2.tsx"), ]), ]), ] satisfies RouteConfig;Previously,
paramsfor theroutes/layout.tsxroute were calculated as{ p: string, l: string }.
This incorrectly ignores params that could come from child routes.
If visiting/parent/1/layout/2/child1/3/4, the actual params passed toroutes/layout.tsxwill have a type of{ p: string, l: string, c1a: string, c1b: string }.Now,
paramsare aware of child routes and autocompletion will include child params as optionals:params.| // ^ cursor is here and you ask for autocompletion // p: string // l: string // c1a?: string // c1b?: string // c2a?: string // c2b?: string
You can also narrow the types for
paramsas it is implemented as a normalized union of params for each page that includesroutes/layout.tsx:if (typeof params.c1a === 'string') { params.| // ^ cursor is here and you ask for autocompletion // p: string // l: string // c1a: string // c1b: string }UNSTABLE: renamed internal
react-router/route-moduleexport toreact-router/internal
UNSTABLE: removedInfoexport from generated+types/*filesAvoid initial fetcher execution 404 error when Lazy Route Discovery is interrupted by a navigation
Href replaces splats
*const a = href("/products/*", { "*": "/1/edit" }); // -> /products/1/edit
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.