How I approach Account takeover due to no rate limit on OTP
The account verification and password reset endpoints accepted a six-digit code in the URL without any rate limiting or CAPTCHA, so an attacker could brute-force the code. By guessing the correct code, an attacker could confirm an account or reset the password for any email address, leading to account takeover.
Published on medium.com
Today I will tell you how I was able to find account takeover due to no rate limit on OTP
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
Impact
An attacker who knows a victim's email address could brute-force the OTP to confirm an account or reset the password, leading to account takeover.
What the attacker needed
Victim's email address; no CAPTCHA on OTP entry; no rate limiting on OTP attempts
The fix
The endpoints should be fixed by adding rate limiting and CAPTCHA to OTP verification and password reset, and by using longer, cryptographically random codes.
How it was found
- Create an account and observe the account confirmation URL containing the email and a six-digit code.
- Notice that the OTP entry page has no CAPTCHA, making brute-force feasible.
- Use Burp Suite Intruder to send many requests with different codes; most return 401 Unauthorized.
- Identify the request that returns 200 OK as the correct OTP and use it to access the account without the email link.
- Apply the same brute-force technique to the password reset endpoint, which also uses a six-digit code in the URL.
- Successfully reset the password for any account, achieving takeover.
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 or reset a password, the site sends a short number (a one-time password, or OTP) to your email. This report found that the page where you enter that number had no limit on how many times you could try, so someone could keep guessing until they got it right. That let them take over other people's accounts.
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.