The art of account takeover
The password reset endpoint for pending organisation users returned a JWT for the target user in a response cookie, which the attacker could use to authenticate as that user across the main domain and linked products.
Published on medium.com
Hello reader, I hope you are doing well. Today I want to talk about one of my findings.
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 password reset endpoint for pending users issued a valid session JWT for the target account instead of only sending a temporary password by email.
Impact
An attacker could take over accounts of pending organisation users and access those accounts on the main domain and linked products.
What the attacker needed
Ability to invite a user to an organisation; knowledge of the target user's UUID
How it was found
- Send an invitation to a user so their account gets a UUID and pending status.
- Call the reset password endpoint using that user's UUID.
- Observe that the response sets a JWT cookie belonging to the target user.
- Use that JWT to obtain a user_id and token for Product 1.
- Use the same JWT to retrieve an accessToken for Product 2.
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 reset a password, the server should not send back a login token for the account you are resetting. Here, it did, so anyone who could trigger a reset for another user got a token that let them log in as that user on several websites.
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.