Repository navigation
Conversation
The magic-link route verified the Turnstile cookie but never consumed it, so one verification covered every magic-link request from that IP until the cookie expired. The route now deletes the cookie after a successful verification, as the OAuth sign-in callback already does. The sign-in form solves a new Turnstile for each attempt, so users see no change.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe magic-link route now deletes the Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by deepseek-v4.1-flash · Input: 58.9K · Output: 11.9K · Cached: 864.3K Review guidance: REVIEW.md from base branch |
Collaborator
Author
|
bot: Closing. Clearing the cookie does not stop scripted reuse of the Turnstile token (see the review thread), and Bouncer's per-IP signup rules already limit how many email signups one verification can produce. |
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.
Summary
/api/auth/verify-turnstilesets aturnstile_jwtcookie that is valid for one hour. The OAuth sign-in callback deletes that cookie when it uses it. The magic-link route only verified it, so one Turnstile solve allowed any number of magic-link requests from the same IP until the cookie expired. A script could solve Turnstile once and then request magic links for many addresses.This change deletes the cookie in
/api/auth/magic-linkafter a successful verification. Each magic-link request now needs its own Turnstile solve.User impact
None expected.
useSignInFlowcreates a new Turnstile widget attempt before every submission (email submit, Back, retry, provider click), andsendMagicLinkhas no other caller. The SSO discovery request still reads the cookie before the magic-link request, so the order of the existing flow is unchanged.Tests
accepts only one magic-link request per Turnstile verification: it uses the realverifyTurnstileJWTwith one signed cookie. The first request returns 200 and the second returns 401, and only one email is sent.oxlintandoxfmtpass on the changed files.Related: #7766 (signup step-up for risky signups).