react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
8.5.2 is the newest release of 8.x.
In short
1 security1 new5 fixed1 changed
Security
Fixes 1 advisory that affected 8.2.0
- HighReact Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 ResponseGHSA-qwww-vcr4-c8h2 · 24 Jul 2026Fixed in 8.3.0
Release note
The section about react-router of a note shared by several packages.
Patch Changes
Encode path params in
href/generatePathper RFC 3986 path-segment rules instead ofencodeURIComponentCharacters that are valid literally in a path segment (
$ & + , ; = : @— RFC 3986pchar) are no longer percent-encoded, so values like a semver build1.0.0+1interpolate unchanged instead of becoming1.0.0%2B1Structural/unsafe characters (
/ ? # %, whitespace, non-ASCII) are still escaped exactly as before
Use
crypto.randomUUID()forcreateMemorySessionStoragesession idscreateMemorySessionStorageis only intended for local development and testing - sessions are lost when the server restarts
Fix
NavLinknot applying itspendingstate whentohas a trailing slashPreserve RSC route component metadata so routes with a
clientLoadercan skip unnecessary server requests once their components have rendered while still fetching missing server-rendered elements- Security
Harden RSC CSRF code paths
Fix server crash (
TypeError: Invalid state: Unable to enqueue) when a request is aborted while the RSC HTML stream has a pending flushHandle cancellation of the
injectRSCPayloadreadable side, clear the pending flush, and cancel the underlying RSC payload stream
Unstable Changes
⚠️ Unstable features are not recommended for production use
Detect stale RSC clients during lazy route discovery and reload the destination document
Migration
Apps using the default RSC Framework entry do not need to make any changes. Apps with a custom entry.rsc.tsx should import the generated client version and pass it to unstable_matchRSCServerRequest:
import clientVersion from "virtual:react-router/unstable_rsc/client-version";
return unstable_matchRSCServerRequest({
// ...
clientVersion,
});Add CSP nonce support to RSC document rendering
Add
nonceoptions tounstable_routeRSCServerRequestandunstable_RSCStaticRouterForward the nonce to the HTML renderer and apply it to injected RSC payload scripts and nonce-aware framework components
To adopt nonce-based CSP, update your
entry.ssr.tsx(runreact-router reveal entry.ssrfirst in RSC Framework Mode) to generate a fresh nonce for each request. Pass it torouteRSCServerRequest, spread therenderHTMLoptions into React's HTML renderer, passoptions.noncetoRSCStaticRouter, and use the same nonce in theContent-Security-Policyresponse header:const nonce = crypto.randomUUID(); const response = await routeRSCServerRequest({ request, serverResponse, createFromReadableStream, nonce, async renderHTML(getPayload, options) { const payload = getPayload(); return renderHTMLToReadableStream( <RSCStaticRouter getPayload={getPayload} nonce={options.nonce} />, { ...options, bootstrapScriptContent, formState: await payload.formState, signal: request.signal, }, ); }, }); response.headers.set( "Content-Security-Policy", `script-src 'self' 'nonce-${nonce}'`, );
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.