Skip to content

Backport RSC CSRF hardening to v7 - #15353

Merged
brookslybrand merged 1 commit into
v7from
backport-rsc-csrf-v7
Jul 28, 2026
Merged

brookslybrand merged 1 commit into
v7from
backport-rsc-csrf-v7

Conversation

@brookslybrand

@brookslybrand brookslybrand commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #15348

Backports the fix for GHSA-qwww-vcr4-c8h2 to v7.

On a detected CSRF attack the error was stashed in `potentialCSRFAttackError`
but the original POST request was still passed to `query()`.
`filterMatchesToLoad: () => false` only skips loaders, so the route's
`action` still ran - the mutation happened and the 400 was cosmetic.

Now the CSRF check gets its own try/catch, the error is reported via
`onError`, and the request is downgraded to a GET before `query()` so no
route action can be dispatched.
@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-15353&path:packages/react-router"

And/or install other packages via:

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

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

@brookslybrand
brookslybrand merged commit 8ebd5df into v7 Jul 28, 2026
10 checks passed
@brookslybrand
brookslybrand deleted the backport-rsc-csrf-v7 branch July 28, 2026 20:52
@github-actions

Copy link
Copy Markdown
Contributor

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

@ryanflorence ryanflorence mentioned this pull request Jul 28, 2026
ishiland added a commit to geolens-io/geolens that referenced this pull request Jul 29, 2026
7.18.2 backports the GHSA-qwww-vcr4-c8h2 hardening to the 7.x line
(remix-run/react-router#15353). The advisory range still claims <8.3.0 is
vulnerable, so the js-audit-gate allowlist entry stays, with its reason
updated from 'no 7.x patch exists' to 'patched; advisory range is stale'.

Signed-off-by: Ian Shiland <ishiland@gmail.com>
carmenlau pushed a commit to authgear/authgear-server that referenced this pull request Aug 4, 2026
- ip-address 10.2.0 -> 10.4.0: fixes GHSA-mwp4-54f8-5fhr (SSRF via
  leading-zero octet decoding), GHSA-4xrf-jv44-h6hh, GHSA-22jq-vg5j-6vgg.
- fast-uri 3.1.4 -> 3.1.5: fixes GHSA-7p8r-x3mc-p8w7 (host confusion
  via backslash authority introducer).
- brace-expansion: bumped the nested copies pulled in via minimatch
  3.1.5/9.0.9 (eslint, jest toolchains) to 1.1.18/2.1.4, within their
  parents' already-declared semver ranges. Bumped the scoped
  minimatch@10.2.5 override from ^5.0.8 to ^5.0.9 since 5.0.8 is itself
  vulnerable to GHSA-rgw5-rvv9-x895 (bypasses the prior DoS mitigation).
- react-router-dom 7.18.1 -> 7.18.2: fixes GHSA-qwww-vcr4-c8h2 (RSC
  mode CSRF bypass). npm's advisory database still flags this as
  requiring a major bump to react-router-dom@8.x
  (github/advisory-database#8868 not yet
  merged), but 7.18.2's changelog confirms the CSRF hardening fix
  ("Harden RSC CSRF codepaths", remix-run/react-router#15353), so no
  major upgrade is needed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@keul

keul commented Aug 5, 2026

Copy link
Copy Markdown

Any known reason why npm audit still complains with 7.18.2 installed?

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.

2 participants