Skip to content
Account takeover Write-up Beginner

Bypass Rate Limit on Reset Password Feature Using X-Forwarded-For

The reset password feature's rate limit could be bypassed by sending a duplicate X-Forwarded-For header with varying IP addresses, allowing an attacker to brute-force OTP codes without being blocked.

ilhamm.0a Follow

Published on ilhamm0a.medium.com

Hello everyone! In this post, I want to share my personal experience discovering and exploiting a vulnerability in the rate limit system of a website’s reset password feature.

ilhamm.0a, on ilhamm0a.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 server trusted the X-Forwarded-For header to determine the client's IP address for rate limiting, and did not properly handle duplicate headers, allowing an attacker to spoof different IPs.

Impact

An attacker could brute-force OTP codes for password reset without being rate-limited, potentially leading to account takeover.

What the attacker needed

Access to the reset password feature; ability to intercept and modify requests

How it was found

  1. Intercept the password reset request and send it to Intruder.
  2. Attempt brute-force with number payloads for the OTP; receive 429 Too Many Requests.
  3. Add two X-Forwarded-For headers, with the second one set to a dynamic value.
  4. Configure the payload to vary the last octet of the IP address.
  5. Start the attack and observe that the server responds with 200 OK instead of 429.

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 website limits how many times you can try a password reset code to stop guessing. The attacker found that by adding a special header that tells the server the request came from a different IP address each time, the server stopped counting the attempts and let them try as many codes as they wanted.

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 ilhamm.0a

View all

1 more disclosed report, 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.