One Time Code Bypass With An Inverted Brute Force Attack
The application rate-limited guesses against a single one-time code but did not limit how often a new code could be generated. An attacker could repeatedly request new codes and try a small fixed set of guesses each time, eventually matching the server's code and bypassing the verification.
Published on infosecwriteups.com
We see them all the time while testing web applications. In order to verify your identity, the application sends a 6 digit numerical code to your registered email address or phone number.
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 rate-limited verification attempts per code but did not rate-limit the generation of new codes, allowing an attacker to repeatedly reset the attempt counter.
Impact
Depending on what the code protects, this could allow an attacker to bypass multi-factor authentication or verify an email address or phone number they do not control, which may be more critical if that contact is later used to link accounts.
What the attacker needed
Attacker can trigger code generation; attacker can submit guesses
How it was found
- Identify how many attempts are allowed before the generated code expires.
- Generate that same number of different one-time codes to build a static list.
- Repeatedly request a new code and submit all codes from the static list until one matches.
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 code is a short number sent to your phone or email to prove it is you. Normally, an attacker cannot guess it because the app blocks you after a few wrong tries. Here, the app only blocked wrong tries for one code, but let the attacker ask for a brand new code as many times as they wanted, so they could keep trying a few guesses until one matched.
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.