الاستيلاء على الحساب من خلال إدارة دورة حياة OAuth غير السليمة
The application links a Google OAuth identity to a user account permanently, even after the user changes their email address. An attacker who has access to the original Google account can continue to log in and take over the account despite the victim changing their email.
Published on medium.com
My name is Montaser Mohsen, and I’m interested in Web Application Security, especially logic-based vulnerabilities that are often overlooked. In this article, I’ll discuss a Google OAuth misbinding vulnerability that I highly recommend for beginners.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application does not revoke or update the OAuth binding when the user's email address changes, leaving the original Google identity permanently linked.
Impact
An attacker with access to the original Google account could maintain persistent unauthorized access and achieve full account takeover, even after the victim changes their email to secure the account.
What the attacker needed
Attacker has access to victim's Google account; victim changes email to secure account
The fix
The application should revoke all OAuth sessions and require re-authentication and re-linking of OAuth providers when the email address is changed.
How it was found
- Register a new account using Google OAuth with a specific email address.
- Navigate to Account Settings.
- Change the email address to a different one.
- Set a new password when prompted, resulting in two authentication methods.
- Log out.
- Log in again using Google OAuth with the original Google account.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you sign in with Google, the app remembers your Google account and links it to your user profile. If you later change your email address, the app should forget that old Google link, but it does not. So anyone who still controls the old Google account can keep logging in as you.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.