Toutes les vulnérabilités
HIGHAppSecexploited in the wild

APPSEC-INSTAGRAM-OTP-BRUTEFORCE-2019

API · Instagram (Meta) mobile password recovery

Résumé

In 2019, researcher Laxman Muthiyah found an account-takeover flaw in Instagram's mobile password-recovery flow, which Facebook rewarded with a $30,000 bounty, mapping to OWASP API4:2023 Unrestricted Resource Consumption combined with broken authentication. The flow sent a six-digit recovery code to the user's phone, giving only 1,000,000 possible values, and its rate limiting was insufficient to stop high-volume guessing. Muthiyah observed that of 1,000 codes submitted from one IP, about 250 were processed while the rest were throttled, so per-IP limits alone did not cap total attempts. By combining a race condition with IP rotation, he sent roughly 200,000 concurrent requests from 1,000 different IP addresses and estimated about 5,000 IPs would suffice to cover the full code space within the 10-minute validity window, brute-forcing the code and taking over any account. The core defect was the absence of an effective global lockout tying failed attempts to the targeted account rather than only the source IP.

Comment l’éviter dans votre code

  • Rate-limit and lock out OTP attempts per target account, not only per source IP.
  • Enforce a small global cap on failed recovery codes before invalidating the OTP.
  • Process verification submissions atomically to prevent race-condition bypass of counters.
  • Use longer OTPs or short expiry plus exponential backoff to shrink the brute-force window.
  • Detect distributed IP-rotation patterns and require step-up verification on anomalies.

Références

Vulnérabilités liées

Tout AppSec →