Packages

react-router

8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed

Your version

7.12.0

7 Jan 2026Where it was published

7.18.6 is the newest release of 7.x.

In short

1 security7 fixed

Security

Fixes 3 advisories that affected 7.11.0

13 advisories affect 7.12.0; 7.18.2 fixes them

8 more

Release note

The section about react-router of a note shared by several packages.

Minor Changes

  • Security

    Add additional layer of CSRF protection by rejecting submissions to UI routes from external origins. If you need to permit access to specific external origins, you can specify them in the react-router.config.ts config allowedActionOrigins field.

Patch Changes

  • Fix generatePath when used with suffixed params (i.e., "/books/:id.json")

  • Export UNSAFE_createMemoryHistory and UNSAFE_createHashHistory alongside UNSAFE_createBrowserHistory for consistency. These are not intended to be used for new apps but intended to help apps usiong unstable_HistoryRouter migrate from v6->v7 so they can adopt the newer APIs.

  • Escape HTML in scroll restoration keys

  • Validate redirect locations

  • [UNSTABLE] Pass <Scripts nonce> value through to the underlying importmap script tag when using future.unstable_subResourceIntegrity

  • [UNSTABLE] Add a new future.unstable_trailingSlashAwareDataRequests flag to provide consistent behavior of request.pathname inside middleware, loader, and action functions on document and data requests when a trailing slash is present in the browser URL.

    Currently, your HTTP and request pathnames would be as follows for /a/b/c and /a/b/c/

    URL /a/b/cHTTP pathnamerequest pathname`
    Document/a/b/c/a/b/c ✅
    Data/a/b/c.data/a/b/c ✅
    URL /a/b/c/HTTP pathnamerequest pathname`
    Document/a/b/c//a/b/c/ ✅
    Data/a/b/c.data/a/b/c ⚠️

    With this flag enabled, these pathnames will be made consistent though a new _.data format for client-side .data requests:

    URL /a/b/cHTTP pathnamerequest pathname`
    Document/a/b/c/a/b/c ✅
    Data/a/b/c.data/a/b/c ✅
    URL /a/b/c/HTTP pathnamerequest pathname`
    Document/a/b/c//a/b/c/ ✅
    Data/a/b/c/_.data ⬅️/a/b/c/ ✅

    This a bug fix but we are putting it behind an opt-in flag because it has the potential to be a "breaking bug fix" if you are relying on the URL format for any other application or caching logic.

    Enabling this flag also changes the format of client side .data requests from /_root.data to /_.data when navigating to / to align with the new format. This does not impact the request pathname which is still / in all cases.

  • Preserve clientLoader.hydrate=true when using <HydratedRouter unstable_instrumentations>

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.