Skip to content
Account takeover Write-up Beginner

D001 to V001 — Hacked Your Account!

The password reset flow returned a status code that the attacker could change from a failure value to a success value, which then allowed setting a new password for the victim's account. The attacker could take over any account by knowing only the victim's email address.

medium.com

Published on medium.com

Whenever I tell people I’m an ethical hacker, they immediately ask, “So… can you hack others account?” And I have to reply with the boring professional line: “I only hack with permission.” But deep down, my brain is screaming: “Of course I can, watch me!” Anyway, let’s keep those thoughts inside and get to the fun…

Ghost, 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 server trusted a client-supplied status value to decide whether the one-time password check passed, instead of validating the actual OTP on the server.

Impact

An attacker could take over any account by knowing only the victim's email address, with no defence mentioned in the text.

What the attacker needed

Victim's email address; ability to intercept requests

The fix

The server should validate reset codes itself, use strong tokens, limit attempts, and notify users of password reset activity.

How it was found

  1. Enter the victim's email address and continue.
  2. Submit a wrong one-time password and intercept the validation request.
  3. Observe the failure status code in the response.
  4. Change the failure status code to the success value.
  5. Set a new password for the victim's account.
  6. Log in with the victim's email and the new password.

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 forget a password, a site sends a one-time code to prove it is you. Here, the server trusted a code the attacker sent back to it, so changing a failure code into a success code let the attacker set a new password without ever seeing the real code.

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.