Skip to content
Account takeover Write-up Intermediate

OTP Bypass Part 2: Advanced Logic Flaws and Race Conditions

The article describes advanced OTP bypass techniques, including race conditions to defeat attempt limits, header spoofing to evade IP-based rate limits, and a logic flaw where changing the email parameter in the verification request allowed an attacker to obtain a session token for a victim's account. An attacker could brute-force OTPs or take over accounts.

arrheniuspaelongan09 Follow

Published on medium.com

In my previous article, I shared how a simple Response Manipulation (changing false to true) could bypass OTP screens. It was a classic "low-hanging fruit." However, as developers become more aware of these basic flaws, they’ve started implementing more robust server-side checks.

Arrhenius Paelongan, 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 checked the OTP and the attempt counter non-atomically, trusted client-supplied email parameters for identity, and used spoofable headers for rate limiting.

Impact

An attacker could bypass OTP verification and take over accounts, and could also brute-force OTPs by defeating rate limits through race conditions or header spoofing.

What the attacker needed

Ability to intercept requests; victim's email or account identifier

The fix

Developers should use atomic counters for rate limiting and ensure the OTP is strictly tied to the session or user ID, not a client-supplied email.

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 or email to prove it's you. This article shows that if the server checks the code and the attempt limit separately, an attacker can send many guesses at once to get around the limit. It also shows a mistake where the server checked the attacker's own code but then logged them into someone else's account.

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 arrheniuspaelongan09

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.