Login with Google Not Authenticated on iOS App
The backend endpoint for Google login accepts an ID token issued for another app's Google client. A token from another app could be used to access user accounts.
Originally disclosed on HackerOne
- Fixed in 7 days
- Paid in 2 months
- Disclosed after 4 months
In your iOS application, there is Login with Google. In this, you're not authenticating a user properly and it can lead to access to user accounts.
Affected API: https://www.instacart.com/api/v2/users/google_login_auth
In this request, these are the parameters: access_token, client_id,id_token, login_only, read_terms.
In the parameter: id_token, you're passing the token generated by Google user authentication. But the token generated is not properly authenticated at your backend. You're not authenticating if the token is generated by your app or not. For example, I logged in with the app Meetup via login with Google. The id_token generated by Google for this app, when used with your /google_login_auth API, it's still get accepted.
This means an app like Meetup can access the user accounts of your users using the id_token generated by Meetup. This can compromise your user's accounts.
The proper way of authenticating the user is mentioned here: https://developers.google.com/identity/sign-in/web/backend-auth#verify-the-integrity-of-the-id-token
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the backend does not verify the token's audience (the client_id it was issued for), so it accepts tokens minted for any Google OAuth client.
Impact
An attacker could use a token from another app to access user accounts, compromising them.
What the attacker needed
A Google account; access to another app's Google login; ability to send requests to the API
The fix
The backend should verify the ID token's integrity and audience as described in Google's documentation.
How it was found
- Log in to a different app (Meetup) using Google sign-in.
- Obtain the ID token that Google issued for that app.
- Send that token to the target's google_login_auth endpoint.
- Observe that the token is accepted by the endpoint.
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 report has not been written yet. The Original tab links to the source.
When you sign in with Google, Google gives your app a special token that proves who you are. The app's server should check that the token was meant for this app, but it didn't. So a token from a different app could be used to log in as someone else.
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.