fix(privacy): scrub magic link URLs#2359
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by gpt-5.4-2026-03-05 · 869,118 tokens |
86676ab to
b55fa55
Compare
RSO
approved these changes
Apr 24, 2026
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
Pentest L2 identified archived Wayback Machine URLs where magic-link verification links exposed both login tokens and user email addresses in the query string. This PR keeps the existing magic-link token model but removes email PII from generated verification URLs and reduces future leakage paths.
L2: Magic-link URL privacy
emailquery parameter from generated magic-link URLs. The token already maps to the email inmagic_link_tokens, so the credentials provider verifies the token and derives the email from the consumed token row.email=.signin_hintlocalStorage behavior instead of server-generated email query strings.token,email,callbackUrl,code,state) and drop all query params for/auth/verify-magic-link.before_sendsanitizer for default event URL properties ($current_url,$referrer,$referring_domain), covering pageleave/autocapture-style events in addition to manual pageviews.Disallow: /auth/verify-magic-linktorobots.txtand setsCache-Control: no-storeplusX-Robots-Tag: noindex, noarchive, nofollowon the verification route.30 minutes, matching token default.Verification
pnpm --filter web exec jest src/lib/sanitize-analytics-url.test.ts --runInBandpnpm formatVisual Changes
N/A
Reviewer Notes
email=remain accepted because the extra query param is ignored.30 minutes)./api/auth/callback/emailerrors,/auth/verify-magic-linkfailures, magic-link request-to-consumption rate, SSO-domain sign-in completion, PostHog$current_urlvalues containingtoken=oremail=.