You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were noticing some odd behavior testing out our app where brand new gmail accounts were getting linked with another user. After digging into the code I found this block:
// As they are already signed in, we don't need to do anything after linking them
return{ session, user, isNewUser }
}
IIUC, If I get access to a computer that has an existing NextAuth session, I can essentially hijack that account by going through the login flow with my own email address.
Example:
User A logs into Website 1 on a public computer and forgets to log out.
Minutes later, User B goes to https://website1.com/login and uses their own email account.
User B's email is now linked to User A.
This seems like a bad thing, but I am curious your thoughts. At the very least, I would expect a setting to control this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
We were noticing some odd behavior testing out our app where brand new gmail accounts were getting linked with another user. After digging into the code I found this block:
next-auth/packages/core/src/lib/callback-handler.ts
Lines 163 to 171 in a47b4ce
IIUC, If I get access to a computer that has an existing NextAuth session, I can essentially hijack that account by going through the login flow with my own email address.
Example:
User A logs into Website 1 on a public computer and forgets to log out.
Minutes later, User B goes to
https://website1.com/login
and uses their own email account.User B's email is now linked to User A.
This seems like a bad thing, but I am curious your thoughts. At the very least, I would expect a setting to control this.
Beta Was this translation helpful? Give feedback.
All reactions