Repository navigation
Skip CSRF for reject (token-authenticated, no session) - #2999
Merged
Merged
Conversation
The reject endpoint authenticates by the invitation token in the URL, like accept and update. Its form must survive a browser withholding the session cookie (e.g. Safari/WebKit ITP on cross-site navigation), but with CSRF protection enforced reject fails with InvalidAuthenticityToken before the token can do its job. Add reject to the skip_forgery_protection list, matching accept, update and WaitingListsController (same rationale as PR codebar#2641, Rollbar codebar#535), and pin the token-only, no-session request with a spec.
This was referenced Oct 9, 2026
mroderick
marked this pull request as ready for review
October 9, 2026 06:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reject endpoint authenticates by the invitation token in the URL. Unlike accept and update, it still
enforced CSRF — so a browser withholding the session cookie (for example Safari/WebKit ITP on cross-site
navigation) gets
InvalidAuthenticityToken. This PR addsrejectto theskip_forgery_protectionlist and pins the token-only, no-session request.
One of five small PRs from the same pre-existing-gap audit against this flow. Heads are reviewed independently; if a sibling merges first expect a trivial rebase.
Detail
The mismatch showed up when writing the no-session spec: on master the spec fails with
ActionController::InvalidAuthenticityToken. Join and leave (WaitingListsController#create/destroy) are already skipped and covered by analogous specs; reject is the odd one out.Review notes
acceptandupdate(PR fix: skip CSRF protection for feedback form submission #2641, Rollbar Security warning in Firefox #535). If you prefer to keep one CSRF-enforcing action in this controller, that would be accept — but consistency here makes the rules simpler to reason about.Sibling PRs: