When a Session Token Isn’t Enough, A Full Account Takeover Story
The application validated only the session value part of a two-part session token and ignored the user ID part, so an attacker could swap the user ID in the Authorization header to impersonate any user and obtain their access token, leading to full account takeover without user interaction.
Published on medium.com
Hello, I’m Ahmed Ramadan, but most people call me Rmdn. I’m a dentist by day and a pentester and bug hunter by night.
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
Impact
An attacker could impersonate any user and obtain their access token, resulting in full account takeover without any user interaction.
What the attacker needed
A valid session token from login; knowledge of another user's ID
How it was found
- Log in with Google to obtain a session token from the first authentication step.
- Capture the token, which contains a user ID and a session value.
- Replace the user ID in the Authorization header with another user's ID.
- Send the request to the token exchange endpoint to receive the victim's access token.
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 log in, the app gives you a token that proves who you are. This token had two parts: one saying which user you are, and one proving your session is valid. The app only checked the second part, so by changing the first part to someone else's user ID, the attacker could get that person's access token and take over their account.
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.