How I got an Account-Takeover By Race-conditions on Login page
A race condition in the Google sign-in flow caused a non-unique social-auth token to be generated for concurrent logins, leading to the wrong authentication token being issued to a user. An attacker could exploit this to gain unauthorised access to another user's account without any interaction from the victim.
Published on medium.com
Hi, I’m Krishna , and in this blog, I’ll walk you through my recent account takeover finding. Due to confidentiality, I can’t disclose the domain name, so I’ll refer to the target as example.com.
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 server generated a non-unique social-auth token for concurrent login requests and then assigned the resulting authentication token to the wrong session due to overlapping request timing.
Impact
An attacker could gain unauthorised access to random user accounts without any interaction from the victim, potentially accessing sensitive information or performing actions on their behalf.
What the attacker needed
Ability to send concurrent login requests; victim logs in at the same time
The fix
The authentication flow should be fixed by implementing proper locking mechanisms, using unique session identifiers, throttling authentication requests, and validating session assignments before allowing access.
How it was found
- Log in normally with Google and observe being redirected to the profile setup page instead of the home page.
- Re-submit the profile details.
- Navigate to the /profile endpoint and find yourself logged in as another user.
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.
A race condition is a bug where two actions happening at almost the same time interfere with each other. Here, when two people logged in simultaneously, the system mixed up their login tokens, so one person ended up logged in as the other. This let an attacker take over someone else's account just by logging in repeatedly.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.