Skip to content
Account takeover Write-up Beginner

Authentication OTP Bypass Via (“Response manipulation”)

The password-reset flow trusted the client-side response of the OTP verification request, so an attacker could submit a wrong code and replace the server's failure response with a previously captured success response. This let the attacker reset the victim's password and take over the account.

medium.com

Published on medium.com

Halo teman2 semua, hari ini saya ingin mengshare salah satu bug keamanan yang saya temukan di salah satu web eccomerce

Skysenz, 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 application relied on the client-side response body to decide whether OTP verification succeeded, instead of enforcing the check server-side and binding the reset to a server-issued session.

Impact

An attacker could take over the victim's account by resetting the password and setting a new one, though the write-up does not show whether the server itself accepted the forged response or only the client did.

What the attacker needed

Victim's email known; attacker can intercept own traffic; a valid OTP captured once

The fix

The OTP check should be enforced entirely on the server, with the reset tied to a server-side session rather than any client-supplied response.

How it was found

  1. Go to the login page and start a password reset for the victim's email.
  2. Enter a valid OTP and intercept the confirmation request in a proxy.
  3. Intercept the response, copy the valid response body and save it.
  4. Drop the request, then repeat the reset and submit a wrong OTP such as an all-zero code.
  5. Intercept the response to the wrong-code request and replace its body with the saved valid response.
  6. Forward the request and the OTP check is bypassed.

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 site asks for a one-time code sent to your email. The site's front end decided whether the code was correct by looking at the reply it got back, and that reply could be edited in transit. By swapping a 'wrong code' reply for an earlier 'correct code' reply, the attacker made the site believe the check passed.

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.