How I Bypassed 2FA on a B2B Site and Earned a Critical Bug Bounty
The site's OTP verification steps relied on client-side response handling, so an attacker could intercept the server's error response and change it to a success response. This allowed creating an account with any email and phone number without proving ownership of either.
medium.com
Published on medium.com
As a bug bounty hunter, I’m always on the hunt for vulnerabilities that could compromise user security or platform integrity. Recently, I uncovered a critical flaw on a B2B business site where users can create online stores to sell products.
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 performed OTP verification only on the client side, trusting the browser's response rather than validating the OTP on the server.
Impact
Attackers could create accounts using any email and phone number without verifying ownership, potentially leading to account takeovers if linked to existing users, and could impersonate sellers or abuse platform features.
What the attacker needed
A free account; ability to intercept HTTP responses; no access to victim email or phone
The fix
The application should perform OTP validation on the server side so that only correct OTPs allow progression.
How it was found
- Start the email sign-in flow with an email address not owned by the tester.
- Enter a random OTP and intercept the verification request in Burp Suite.
- Change the server's error response to a success response with a redirect.
- Forward the request and reach the next registration step.
- Enter arbitrary details and a phone number, then intercept the phone OTP verification request.
- Change the error response to a success message and complete registration.
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 sign up, the site sends a one-time code (OTP) to your email or phone to prove it is yours. Here, the site trusted the web browser's display of the server's answer instead of checking the code on its own servers. By editing the error message in the browser's developer tools, the attacker made the site think the code was correct.
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.