Skip to content

harden RSC CSRF codepaths - #15311

Merged
jacob-ebey merged 3 commits into
mainfrom
rsc_csrf
Jul 13, 2026
Merged

harden RSC CSRF codepaths#15311
jacob-ebey merged 3 commits into
mainfrom
rsc_csrf

Conversation

@jacob-ebey

Copy link
Copy Markdown
Member

No description provided.

@jacob-ebey jacob-ebey changed the title Rsc csrf harden RSC CSRF codepaths Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview Build Available

Preview builds have been created for this PR. You can install react-router using:

pnpm install "remix-run/react-router#preview/pr-15311&path:packages/react-router"

And/or install other packages via:

pnpm install "remix-run/react-router#preview/pr-15311&path:packages/react-router-dev"
pnpm install "remix-run/react-router#preview/pr-15311&path:packages/react-router-express"
pnpm install "remix-run/react-router#preview/pr-15311&path:packages/react-router-node"
pnpm install "remix-run/react-router#preview/pr-15311&path:packages/react-router-serve"

These preview builds will be updated automatically as you push new commits.

@github-actions

Copy link
Copy Markdown
Contributor

✅ CLA Signed

Thanks for signing the Contributor License Agreement.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

✅ Change File Found

One or more change files found.

Type Change
patch Harden RSC CSRF codepaths.

@jacob-ebey
jacob-ebey merged commit 7a71c72 into main Jul 13, 2026
12 checks passed
@jacob-ebey
jacob-ebey deleted the rsc_csrf branch July 13, 2026 20:33
@github-actions

Copy link
Copy Markdown
Contributor

The preview branch preview/pr-15311 has been deleted now that this PR is merged/closed.

@ryanflorence ryanflorence mentioned this pull request Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We recently published version 8.3.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@jbadan

jbadan commented Jul 24, 2026

Copy link
Copy Markdown

@jacob-ebey is this planned for v7 as well? Thanks!

AlvanChow pushed a commit to AlvanChow/personalityquizzes that referenced this pull request Jul 29, 2026
Clears GHSA-qwww-vcr4-c8h2, which was failing `npm audit --omit=dev
--audit-level=high` in both ci.yml and deploy.yml. The deploy workflow runs
that audit before build and `wrangler deploy`, so the gate was blocking
production releases outright, not just showing a red check.

The advisory was never exploitable here — it affects only the unstable RSC
APIs, and the fix (remix-run/react-router#15311) touches a single file,
packages/react-router/lib/rsc/server.rsc.ts, reachable only through the
`react-server` conditional export that a browser SPA bundle never resolves.
This app is declarative-mode only. But there is no patched 7.x: the advisory
range covers 7.12.0 through 8.2.0, `react-router-dom` ends at 7.18.1 with no
v8 line, and the sole patched version is react-router@8.3.0.

- Replace the react-router-dom dependency with react-router@^8.3.0. In v8 the
  v6-compat re-export shim is gone, so the import specifier moves in 34 files
  (32 imports plus the vi.mock in Dashboard.test.jsx and the manualChunks
  entry in vite.config.js). All nine APIs this app uses — BrowserRouter,
  Routes, Route, Navigate, Link, MemoryRouter, useNavigate, useLocation,
  useParams — are unchanged in v8 and verified present in the v8 root export.
  Only RouterProvider/HydratedRouter moved to react-router/dom; neither is
  used here.
- Raise react and react-dom floors to ^19.2.7 to match v8's declared peer
  range. The old ^19.2.0 permitted an under-minimum resolution even though
  npm happens to resolve 19.2.8 today.
- Raise engines.node to >=22.22.0 to match v8. CI and deploy both run Node 24.

Verified: npm run check passes end to end for the first time, including
`npm audit --omit=dev --audit-level=high` reporting 0 vulnerabilities.
361 tests across 42 files pass. Also driven in Chromium against the real
production build with SPA fallback, exercising every router API in use:
eager and lazy routes render their own content, useParams resolves through
the quiz registry, Navigate redirects /crew to /circle, the catch-all
renders NotFound, useNavigate moves route imperatively, and Link navigates
client-side without a document reload.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PmuxLEfqmMeqBg8gpuXNHa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants