Skip to content

Security: Prevent OTP identity confusion and account takeover - #1

Open
magqqgq wants to merge 1 commit into
sapiom:mainfrom
magqqgq:magqqgq-patch-1
Open

Security: Prevent OTP identity confusion and account takeover#1
magqqgq wants to merge 1 commit into
sapiom:mainfrom
magqqgq:magqqgq-patch-1

Conversation

@magqqgq

@magqqgq magqqgq commented Aug 16, 2026

Copy link
Copy Markdown

This PR fixes a critical vulnerability in the OTP verification flow where the authenticated identity was derived from unverified client-supplied inputs, which allowed potential account takeover attacks.

Changes:

app/api/auth/verify/route.ts: Removed reliance on the client-supplied email or phone fields for session creation. The authenticated subject is now strictly derived from the verifiedTarget securely returned by the verification provider, ensuring a caller cannot use a valid OTP for one contact to impersonate another victim.

This PR fixes a critical vulnerability in the OTP verification flow where the authenticated identity was derived from unverified client-supplied inputs, which allowed potential account takeover attacks.

Changes:

app/api/auth/verify/route.ts: Removed reliance on the client-supplied email or phone fields for session creation. The authenticated subject is now strictly derived from the verifiedTarget securely returned by the verification provider, ensuring a caller cannot use a valid OTP for one contact to impersonate another victim.
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.

1 participant