How a Missing Rate Limit in a Password Reset Flow Led to Account
The password reset endpoint lacked rate limiting on OTP verification, allowing unlimited attempts to guess a four-digit code. An attacker could brute-force the OTP within its five-minute validity and reset any user's password, leading to account takeover.
Published on medium.com
Recently, while assessing the security of an online learning platform that provides programming, Linux, and other technical courses, I discovered a vulnerability in its Forgot Password functionality.
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
The password reset OTP verification endpoint did not enforce rate limiting, allowing unlimited guesses of a four-digit code.
Impact
An attacker could brute-force the OTP and reset the password of any account, including a moderator account, leading to account takeover.
What the attacker needed
Knowledge of a valid email address; ability to send many requests
The fix
The password reset flow should enforce rate limiting, restrict repeated failed OTP attempts, and use longer, more unpredictable OTP values.
How it was found
- Intercept the OTP verification request for the password reset.
- Send multiple invalid OTP values and observe the response.
- Notice that the endpoint does not rate-limit failed attempts.
- Use a four-digit wordlist with Burp Intruder to brute-force the OTP.
- Identify the correct OTP by the HTTP 302 redirect response.
- Use the valid OTP to reset the password.
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 password reset often uses a short numeric code sent to your email. If the website lets someone try thousands of codes without slowing them down, an attacker can guess the right code and change your password. Here, the code was only four digits and the site did not block repeated attempts.
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.