Skip to content
Account takeover Write-up Advanced

He Sent 200,000 Reset Codes to Instagram in 10 Minutes. Instagram

Instagram's password reset endpoint rate-limited attempts per IP address rather than per account, and the rate limiter had a race condition that allowed multiple concurrent requests to bypass the limit. An attacker could send many simultaneous requests from many IP addresses to brute-force the 6-digit recovery code and reset any account's password.

Vivek ps Follow

Published on medium.com

Most developers assume that if you put a 6-digit OTP behind a rate limiter, brute force is dead.

Vivek PS, 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 rate limiter counted attempts per client IP instead of per account or token, and its counter update was not atomic, so concurrent requests could slip through before the limit was enforced.

Impact

An attacker could reset the password on any Instagram account in under 10 minutes for about $150 in cloud compute, with no user interaction beyond receiving an SMS.

What the attacker needed

Victim has a phone number or email on file; attacker can rent many IP addresses; no user interaction required

The fix

The fix should enforce strict atomic account-level attempt caps, invalidate the token after excessive failures, and tie rate limits to the token rather than the client IP.

How it was found

  1. Send sequential wrong recovery codes from one IP until the server blocks after about 250 attempts.
  2. Switch to a different IP and observe that the same victim account can be tested again immediately.
  3. Send many simultaneous requests from one IP and see that around 250 to 300 are processed before throttling.
  4. Use many IP addresses to send concurrent requests covering the full 6-digit code space within the 10-minute expiry window.
  5. The winning request returns a valid session token, allowing the password to be overwritten.

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 forget your password, a site sends a short numeric code to your phone or email. If someone tries to guess that code, the site should block them after a few wrong tries. Here, the site only blocked each internet address (IP) separately, not the victim's account, and it could be tricked by sending many guesses at the same moment. So an attacker with many rented computers could try every possible code and take over 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 Vivek ps

View all

14 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.