Skip to content

fix(frontend): bump react-router-dom to 7.18.2 for RSC CSRF hardening - #122

Merged
toastedcoffee merged 1 commit into
mainfrom
fix/react-router-rsc-csrf-advisory
Jul 31, 2026
Merged

toastedcoffee merged 1 commit into
mainfrom
fix/react-router-rsc-csrf-advisory

Conversation

@toastedcoffee

Copy link
Copy Markdown
Owner

Closes the exposure behind Dependabot alert 24 (GHSA-qwww-vcr4-c8h2, "React
Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 Response").

Why this is a patch bump, not a major migration

Dependabot reports the affected range as >= 7.12.0, < 8.3.0 with 8.3.0 as
the first patched version, which makes this look like a forced 7 -> 8 major.
It isn't. The upstream advisory on the react-router repo lists patched
versions as 7.18.2 and 8.3.0 — the GitHub Advisory Database entry
collapsed those into one range and dropped the 7.x backport.

7.18.2 is a patch release already permitted by the declared ^7.18.1
range. Its entire changelog is one entry: "Harden RSC CSRF codepaths"
(remix-run/react-router#15353). No API changes, no breaking changes, and
its dependency and peer-dependency sets are identical to 7.18.1.

For contrast, the 8.x path would have been substantial: react-router-dom
has no 8.x release at all — it was folded into react-router in v8 — so
that route means migrating all 9 importing files off the package entirely.

Exploitability in this app: none

The advisory states: "This only affects your application if you are using
the unstable RSC APIs." This frontend is a client-only Vite SPA:

  • mounts the declarative BrowserRouter (frontend/src/App.tsx), not a
    data router — no createBrowserRouter / RouterProvider
  • no route loaders or actions, no server rendering, no server actions
  • imports only Routes, Route, Navigate, Link, Outlet,
    useNavigate, useParams, useLocation
  • the production bundle contains zero RSC code: callServer, decodeAction,
    decodeReply, createTemporaryReferenceSet, and any csrf symbol all
    return 0 matches across dist/assets/*.js

The bump is taken because it is free, not because the path was reachable.

Note on npm audit

npm audit will continue to flag this after the bump, because the advisory
database range still covers 7.18.2. Do not run npm audit fix --force
here: on this tree it proposes react-router-dom@7.11.0, a downgrade to a
more vulnerable version, since the DB range offers it no valid 7.x target.
Alert 24 likely needs a manual dismissal noting that 7.18.2 carries the fix.

Test plan

All run locally on this commit, from frontend/:

  • npm run type-check — clean
  • npm run lint — clean
  • npm test — 92/92 passing across 10 files
  • npm run build — succeeds; react-vendor chunk still forms correctly
    (the vite.config.ts chunk rule matches on package name, not version)
  • Lockfile diff inspected: both packages move 7.18.1 -> 7.18.2 upward,
    integrity hashes updated, no other packages touched

🤖 Generated with Claude Code

GHSA-qwww-vcr4-c8h2 (Dependabot alert 24) reports a CSRF bypass in
React Router's unstable RSC code paths. The upstream advisory backports
the fix to 7.18.2 as well as 8.3.0; the GitHub Advisory Database range
(>= 7.12.0, < 8.3.0) omits the 7.x patch and so points at a major bump.

7.18.2 is a patch release already permitted by the declared ^7.18.1
range, containing only "Harden RSC CSRF codepaths" with no API changes.

Note this app was never exposed: it mounts the declarative BrowserRouter
and uses no data router, loaders, actions, or server rendering. The
shipped bundle contains no RSC code at all. The bump is taken because
it is free, not because the path was reachable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@toastedcoffee
toastedcoffee merged commit 2906380 into main Jul 31, 2026
3 checks passed
@toastedcoffee
toastedcoffee deleted the fix/react-router-rsc-csrf-advisory branch July 31, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant