[Security] Bump react-router and react-router-dom
Bumps react-router to 7.5.2 and updates ancestor dependency react-router-dom. These dependencies need to be updated together.
Updates react-router from 7.1.1 to 7.5.2 This update includes a security fix.
Vulnerabilities fixed
React Router allows pre-render data spoofing on React-Router framework mode
Summary
After some research, it turns out that it's possible to modify pre-rendered data by adding a header to the request. This allows to completely spoof its contents and modify all the values of the data object passed to the HTML. Latest versions are impacted.
Details
The vulnerable header is
X-React-Router-Prerender-Data, a specific JSON object must be passed to it in order for the spoofing to be successful as we will see shortly. Here is the vulnerable code :To use the header, React-router must be used in Framework mode, and for the attack to be possible the target page must use a loader.
Steps to reproduce
Versions used for our PoC:
- "
@react-router/node": "^7.5.0",- "
@react-router/serve": "^7.5.0",- "react": "^19.0.0"
- "react-dom": "^19.0.0"
- "react-router": "^7.5.0"
- Install React-Router with its default configuration in Framework mode (https://reactrouter.com/start/framework/installation)
- Add a simple page using a loader (example:
routes/ssr)
... (truncated)
Patched versions: 7.5.2 Affected versions: >= 7.0, <= 7.5.1
Release notes
Sourced from react-router's releases.
v7.5.2
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v752
v7.5.1
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v751
v7.5.0
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v750
v7.4.1
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v741
v7.4.0
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v740
v7.3.0
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v730
v7.2.0
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v720
v.7.1.5
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v715
v7.1.4
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v714
v7.1.3
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v713
v7.1.2
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v712
Changelog
Sourced from react-router's changelog.
7.5.2
Patch Changes
Update Single Fetch to also handle the 204 redirects used in
?_datarequests in Remix v2 (#13364)
- This allows applications to return a redirect on
.datarequests from outside the scope of React Router (i.e., anexpress/honomiddleware)⚠️ Please note that doing so relies on implementation details that are subject to change without a SemVer major release- This is primarily done to ease upgrading to Single Fetch for existing Remix v2 applications, but the recommended way to handle this is redirecting from a route middleware
Adjust approach for Prerendering/SPA Mode via headers (#13453)
7.5.1
Patch Changes
Fix single fetch bug where no revalidation request would be made when navigating upwards to a reused parent route (#13253)
When using the object-based
route.lazyAPI, theHydrateFallbackandhydrateFallbackElementproperties are now skipped when lazy loading routes after hydration. (#13376)If you move the code for these properties into a separate file, you can use this optimization to avoid downloading unused hydration code. For example:
createBrowserRouter([ { path: "/show/:showId", lazy: { loader: async () => (await import("./show.loader.js")).loader, Component: async () => (await import("./show.component.js")).Component, HydrateFallback: async () => (await import("./show.hydrate-fallback.js")).HydrateFallback, }, }, ]);Properly revalidate prerendered paths when param values change (#13380)
UNSTABLE: Add a new
unstable_runClientMiddlewareargument todataStrategyto enable middleware execution in customdataStrategyimplementations (#13395)UNSTABLE: Add better error messaging when
getLoadContextis not updated to return aMap" (#13242)Do not automatically add
nulltostaticHandler.query()context.loaderDataif routes do not have loaders (#13223)
- This was a Remix v2 implementation detail inadvertently left in for React Router v7
- Now that we allow returning
undefinedfrom loaders, our prior check ofloaderData[routeId] !== undefinedwas no longer sufficient and was changed to arouteId in loaderDatacheck - thesenullvalues can cause issues for this new check⚠️ This could be a "breaking bug fix" for you if you are doing manual SSR withcreateStaticHandler()/<StaticRouterProvider>, and usingcontext.loaderDatato control<RouterProvider>hydration behavior on the clientFix prerendering when a loader returns a redirect (#13365)
... (truncated)
Commits
-
5819e0cchore: Update version for release (#13456) -
d0cac33chore: Update version for release (pre) (#13454) -
c843029Adjust approach for prerendering/SPA mode via headers (#13453) -
8e4963fRestore handling of 204 "soft" redirects on data requests (#13364) -
ed77157update session documentation links (#13448) -
4281172Missed refactor updates -
b166e48Minor refactors to support RSC (#13423) -
5dd7c15chore: Update version for release (#13422) -
6ce4a79chore: Update version for release (pre) (#13412) -
cd5681bSlight refactor of fetchAndDecode for RSC (#13409) - Additional commits viewable in compare view
Updates react-router-dom from 7.1.1 to 7.5.2
Release notes
Sourced from react-router-dom's releases.
v7.1.3
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v713
react-router-dom-v5-compat@6.4.0-pre.15
Patch Changes
- Updated dependencies
- react-router@6.4.0-pre.15
- react-router-dom@6.4.0-pre.15
react-router-dom-v5-compat@6.4.0-pre.11
Patch Changes
- Updated dependencies
- react-router@6.4.0-pre.11
- react-router-dom@6.4.0-pre.11
react-router-dom-v5-compat@6.4.0-pre.10
Patch Changes
- Updated dependencies
- react-router@6.4.0-pre.10
- react-router-dom@6.4.0-pre.10
react-router-dom-v5-compat@6.4.0-pre.9
Patch Changes
- Updated dependencies
- react-router@6.4.0-pre.9
- react-router-dom@6.4.0-pre.9
react-router-dom-v5-compat@6.4.0-pre.8
Patch Changes
- Updated dependencies
- react-router@6.4.0-pre.8
- react-router-dom@6.4.0-pre.8
react-router-dom-v5-compat@6.4.0-pre.7
Patch Changes
- Updated dependencies
react-router@6.4.0-pre.7react-router-dom@6.4.0-pre.7
Changelog
Sourced from react-router-dom's changelog.
7.5.2
Patch Changes
- Updated dependencies:
react-router@7.5.27.5.1
Patch Changes
- Updated dependencies:
react-router@7.5.17.5.0
Patch Changes
- Updated dependencies:
react-router@7.5.07.4.1
Patch Changes
- Updated dependencies:
react-router@7.4.17.4.0
Patch Changes
- Updated dependencies:
react-router@7.4.07.3.0
Patch Changes
- Updated dependencies:
react-router@7.3.07.2.0
Patch Changes
- Updated dependencies:
react-router@7.2.07.1.5
... (truncated)
Commits
-
5819e0cchore: Update version for release (#13456) -
d0cac33chore: Update version for release (pre) (#13454) -
5dd7c15chore: Update version for release (#13422) -
6ce4a79chore: Update version for release (pre) (#13412) -
15e0a5echore: Update version for release (#13366) -
e6630c6chore: Update version for release (pre) (#13355) -
3aea1f2chore: Update version for release (pre) (#13345) -
7350eefchore: Update version for release (#13322) -
9693bf4chore: Update version for release (pre) (#13312) -
4447236Remove underscore from docs that keeps getting auto-formatted - Additional commits viewable in compare view