ref(api): Tighten accept-invite cleanup-delete path#114040
Merged
michelletran-sentry merged 1 commit intomasterfrom Apr 27, 2026
Merged
ref(api): Tighten accept-invite cleanup-delete path#114040michelletran-sentry merged 1 commit intomasterfrom
michelletran-sentry merged 1 commit intomasterfrom
Conversation
JoshFerge
reviewed
Apr 27, 2026
| return self.invite_context.user_id is not None | ||
| # Must match the authenticated request user — not merely "the resolved | ||
| # member has some user_id". When `_get_invite` falls through to the URL | ||
| # member_id lookup, `invite_context.user_id` is the _victim_'s user_id, |
Member
There was a problem hiding this comment.
does the code having the concept of a victim make sense, or is it only in relation to this PR?
Contributor
Author
There was a problem hiding this comment.
Whoops, ya it's related to bug bounty. Comment doesn't make sense without that context... will remove. Thanks for the catch!
Validate the invite token and pending state before the cleanup-delete branch of ApiInviteHelper runs, and scope `member_already_exists` to the authenticated user rather than any non-null user_id on the resolved record. Replace the duplicated delete in user_authenticator_enroll with a call through the helper so the new guard applies in both call sites. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
d8bbaec to
c56af21
Compare
JoshFerge
approved these changes
Apr 27, 2026
cleptric
pushed a commit
that referenced
this pull request
May 5, 2026
Validate the invite token and pending state before the cleanup-delete branch of ApiInviteHelper runs, and scope `member_already_exists` to the authenticated user rather than any non-null user_id on the resolved record. Replace the duplicated delete in user_authenticator_enroll with a call through the helper so the new guard applies in both call sites. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Validate the invite token and pending state before the cleanup-delete branch of ApiInviteHelper runs, and scope
member_already_existsto the authenticated user rather than any non-null user_id on the resolved record. Replace the duplicated delete in user_authenticator_enroll with a call through the helper so the new guard applies in both call sites.