Skip to content
Account takeover Write-up Beginner

Discovering OTP Validation Bypass and IDOR in a Data Export Funct

The application did not verify the OTP during login, so any random OTP was accepted, and the data export endpoint used a company identifier parameter without checking the user's authorisation, allowing access to other companies' data. An attacker with valid credentials could bypass 2FA, and any authenticated user could change the identifier to download sensitive data from other organisations.

Shir0E Follow

Published on medium.com

During a recent white-box penetration testing engagement, I discovered two serious vulnerabilities in a web application used by service providers to manage customer data for client companies.

Shir0E, 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-side code did not compare the submitted OTP with the stored one, and the export endpoint trusted a client-supplied company identifier without an authorisation check.

Impact

An attacker with valid credentials could bypass the second authentication factor entirely, and any authenticated user could access sensitive data from other companies, potentially leading to serious data breaches.

What the attacker needed

Valid email and password; authenticated session for IDOR; ability to intercept and modify requests

The fix

The OTP should be validated server-side before authentication succeeds, and proper authorisation checks should be implemented for all resource requests, including validating whether the logged-in user has permission to access the requested mnocode.

How it was found

  1. Log in to the Test-1 account while intercepting traffic.
  2. Observe the authentication API requests.
  3. Attempt login with correct email, correct password, and a random OTP.
  4. Note that authentication succeeds despite the wrong OTP.
  5. Export data and monitor the request in Burp Suite.
  6. Change the mnocode parameter and observe data from another company.

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.

Two-factor authentication (2FA) adds a second step, like a one-time code sent to your email, so a stolen password alone is not enough. Here the server asked for the code but never checked it, so any random code worked. Separately, the data export page used a number to say which company's data to show, and the server did not check if you were allowed to see that company, so changing the number showed someone else's data.

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 Shir0E

View all

1 more disclosed report, 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.