Skip to content
Account takeover Write-up Beginner

Bypassing OTP via Inspect Element

The OTP verification code was exposed in the front-end page source, allowing an attacker to read it via browser developer tools and complete login verification without receiving the code on the target phone number.

medium.com

Published on medium.com

I’m an intermediate-level bug hunter. I enjoy exploring websites, finding security loopholes, and learning more about ethical hacking.

Whoami, 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 OTP was generated and included in the client-side page or response instead of being kept server-side and validated only on the server.

Impact

An attacker could complete OTP verification for a phone number they do not control, potentially logging in as another user.

What the attacker needed

Access to the login page; a phone number to enter

The fix

The OTP should be generated and validated only on the server side and never exposed in front-end code or responses.

How it was found

  1. Enter a different phone number during the login process.
  2. When the OTP input page appears, open the browser's Inspect Element tool.
  3. Search the page elements for the term OTP.
  4. Find the OTP displayed in the response or hidden in the code.
  5. Use that OTP to complete the verification process.

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.

A one-time password (OTP) is a short code sent to your phone to prove it is you. Here, the website put that secret code directly into the web page's code, so anyone could open their browser's developer tools and read it. That let someone log in as another person without ever having access to their phone.

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.