Skip to content
Account takeover Write-up Intermediate

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.

iknowhatodo Follow

Published on medium.com

Hello reader, I hope you are doing well. Today I want to talk about one of my findings.

Hossam Ahmed, on medium.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 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

  1. Send an invitation to a user so their account gets a UUID and pending status.
  2. Call the reset password endpoint using that user's UUID.
  3. Observe that the response sets a JWT cookie belonging to the target user.
  4. Use that JWT to obtain a user_id and token for Product 1.
  5. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.