Skip to content
Account takeover Write-up Intermediate

500$ Account Takeover

The sign-up response leaked a JWT token that also worked for login, and no email verification was required. By combining this with pre-account takeover (account squatting) and response manipulation, an attacker could log into an account they had pre-registered before the victim signed up.

Hemant Kumar Follow

Published on medium.com

Bounty$500 View original

I guys, today i’m gonna share with you one of my intresting finding, which is Account Takeover by chaining 3 vulnerabilities . 1) Preaccount 2) Response manipulation 3) Login token leaked in response .

HEMANT, 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 sign-up endpoint returned a valid login token without email verification, and the login flow trusted a client-side response status change.

Impact

An attacker could take over an account by pre-registering it and then using the leaked token and response manipulation to log in as the victim.

What the attacker needed

Attacker can sign up with victim's email; victim later signs up with same email; attacker can intercept and modify responses

The fix

The sign-up response should not leak a login token, email verification should be required, and the login flow should not trust client-side response status changes.

How it was found

  1. Sign up on the target subdomain and capture the sign-up response.
  2. Note that the response contains a JWT token that is also used for login.
  3. Log in, update the name and last name, then log out.
  4. Try to log in with OAuth and observe account squatting (pre-account takeover).
  5. Attempt a normal login with credentials, capture the request, and change the response status from 400 to 200 OK.
  6. Insert the leaked token into the response and forward it to log in successfully.

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 create an account, the website sometimes sends back a secret login token in the response. If that token is not protected and the site does not check that you own the email address, someone can register an account with a victim's email first. Later, when the real owner signs up, the attacker can use the leaked token and a tampered response to log in as them.

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.

More by Hemant Kumar

View all

4 more disclosed reports, best first.

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.