Skip to content
Account takeover Write-up Intermediate

A Real-World Web Application Penetration Testing Story: Detecting & Evading Rate Limits for OTP Brute Force

The password change form lacked CAPTCHA and rate limiting on the SMS OTP, allowing an attacker to brute-force the 4-digit code. The attacker could then change the password and take over the account.

Onurcan Genç Follow

Published on systemweakness.com

Today, I would like to discuss a finding I discovered during a web application penetration test. First off, the article’s title might seem confusing, but I will guide you through it step by step.

Onurcan Genç, on systemweakness.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 password change endpoint did not enforce rate limiting or CAPTCHA on OTP verification, and the OTP was only 4 digits.

Impact

An attacker could brute-force the OTP and change the password, leading to account takeover; rate limiting only blocked after many attempts, and a VPN was used to bypass IP bans.

What the attacker needed

A valid account; access to the password change form; ability to receive or guess SMS OTP

The fix

The application should enforce strict rate limiting (e.g., 10 attempts) and CAPTCHA on OTP verification, and use longer OTPs.

How it was found

  1. Open the password change utility, which sends an SMS verification code to the phone number.
  2. Use Burp Suite Intruder to try all 4-digit codes from 0000 to 9999.
  3. Observe that many attempts are allowed before rate limiting kicks in.
  4. Provide the correct OTP along with a new password to complete the change.

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 change form sent a 4-digit code by SMS to confirm it was you. The site did not limit how many times you could guess that code, so someone could try all 10,000 combinations and then set a new password for the 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 Onurcan Genç

View all

2 more disclosed reports, 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.