Skip to content
Business logic Write-up Beginner

Little bit about the target

The forgot password function had no rate limiting, and each reset request generated a new random password that replaced the previous one. An attacker could flood the endpoint, causing the victim's password to change repeatedly and locking them out of their account.

Vedant Tekale Follow

Published on medium.com

Hello again great #bugbounty community! My name is Vedant(Also known as Vegeta on Twitter😁) and I’m a cybersecurity enthusiast and an aspiring Bug hunter :) Today I’ll share you a story about an interesting bug that I found recently.

Vedant Tekale, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Vedant Tekale (known as Vegeta on Twitter) walks through a bug he found on a private program he had been hunting on for about a month. He calls the target target.com throughout. By the time of this discovery he had already done most of the recon on the program and had found reflected XSS, blind XSS, SSRF, information disclosures and a stored XSS, which he describes as the highest severity bug he had found so far.

The feature involved is the customer portal application on one of the target's subdomains. That subdomain had a signup page, and the portal offered a forgot password function. The behaviour of that function is the whole story: when a user requests a password reset, the application does not send a reset link that lets the user choose a new password. Instead it generates a new random 8 digit password and sends it to the user by email. The researcher notes that this was the first time he had seen such behaviour.

Setup

There is no tooling to describe. The researcher created an account on the customer portal subdomain and then enumerated the functionalities available to a logged in user.

Finding it

He was going through screenshots of the subdomains of target.com when he noticed one subdomain with a signup page. He opened it, found a customer portal application, created an account and started enumerating functionality.

He first tried for XSS, open redirect, SSRF and IDOR, and nothing worked. He then decided that if he could not find high severity bugs he would look for low hanging ones, and started looking at improper session handling and missing rate limiting.

From the original on medium.com

Exploitation

Step 1: observe what a reset actually does

He went to the forgot password functionality and requested a single reset password link, purely to observe the token. Opening the reset password mail from the target showed that the application provided a new password, a random 8 digit password, rather than a link to a reset form. This was new to him.

Step 2: repeat the request

He then performed a no rate limiting attack on the reset password function, repeating the request 88 times. There was no rate limiting in place, and he received 88 reset password mails from the target.

Step 3: try the first password

After some time he tried to log in on the portal with the password copied from the first reset password link, just to see whether it worked. He was not able to log in.

Step 4: try the last password

He then copied the password from the very last reset password mail and tried to log in. He was logged in.

The point of steps 3 and 4 is that every reset request changes the user's password. The first password he had received was already invalid because the subsequent requests had replaced it, and only the password from the most recent mail was current.

Root cause

The forgot password function has no rate limiting, so a client can issue reset requests as fast as it likes. On top of that, each request immediately rotates the account password to a new random 8 digit value and emails it, instead of issuing a time limited, single use reset token that the user redeems to set a password of their own choosing.

Because the two behaviours combine, a flood of reset requests leaves the account in a state where the old password no longer works and the only valid password is the one in the most recent mail. The researcher describes this as a situation like account lockout: the user cannot log in with the old password, and the new password keeps changing with every reset request. He put it in the report as the reason a simple missing rate limit has a huge impact here.

The report does not describe any server side defence that was present and failed; the absence of rate limiting is the finding itself.

Impact

An attacker who can reach the forgot password endpoint can submit repeated reset requests for a victim's account. Each one rotates the victim's password and sends a new one to the victim's mailbox, so the victim is locked out of the old password and cannot reliably use any password that is not the latest one. The new passwords go to the account's mailbox, and the researcher frames the result as an account lockout style condition caused by a bug that would otherwise be considered low severity. The researcher frames the result as an account lockout style condition caused by a bug that would otherwise be considered low severity.

Fix

The report does not say what the program changed. A reset should issue a single use, expiring token that the user redeems to set their own password, so that repeated requests cannot invalidate the credential the legitimate user already holds.

Variants to test

  1. Request a password reset once and inspect the mail. If it contains a generated password rather than a reset link, the account credential is being rotated server side on every request; repeat the request a handful of times and then try the first password and the last one. A positive result is that only the most recent password works.
  2. Send the forgot password request repeatedly in quick succession and count the emails that arrive. A positive result is a large number of reset mails with no throttling, captcha or cooldown appearing.
  3. Do the same on the registration confirmation and email change endpoints, where a missing limit also means mailbox flooding and, in the email change case, possible confusion about which link is current.
  4. Check whether the reset endpoint is keyed on the account or on the requester. If the limit exists per session or per IP but not per target account, rotating the source or dropping the session may still let you flood a single victim.
  5. Where a reset token is used instead of a generated password, request several tokens for the same account and check whether older tokens stay valid. A positive result is that all issued tokens remain usable, which weakens the single use property.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

A security researcher, Vedant Tekale (known online as Vegeta), spent about a month testing a private bug bounty program. He calls the target target.com in his write-up. He had already found several serious bugs there, including reflected XSS, blind XSS, SSRF, information disclosures and a stored XSS, which he says was the most severe bug he had found so far.

The bug in this story is about the "forgot password" feature on a customer portal that lived on one of the target's subdomains. Normally, when you forget your password, a website emails you a link that lets you choose a new password yourself. This application did something different: every time you asked to reset your password, it generated a brand new random 8 digit password and emailed it to you. Each reset replaced the previous password.

On its own, that is unusual but not necessarily dangerous. The real problem was that the forgot password form had no rate limiting. Rate limiting is a control that stops someone from submitting the same form over and over in a short time. Without it, the researcher could ask for a password reset 88 times in a row, and the application happily sent 88 emails, each with a different new password. Because each request replaced the previous password, the account was left in a state where the original password no longer worked and only the password from the most recent email was valid. The researcher described this as a kind of account lockout: the legitimate user could not log in with their old password, and the new password kept changing with every reset request.

The report does not say whether a bounty was paid or what the program changed.

From the original on medium.com

The target and the feature

The target was a private program, which means it is not open to everyone. He had already done most of the reconnaissance (recon), which is the work of mapping out a target's systems, subdomains and features before you start testing for bugs.

He was looking through screenshots of the target's subdomains. A subdomain is a prefix added to a domain name, like blog.example.com or shop.example.com, and each one can host a different application. One of those screenshots showed a subdomain with a signup page. He opened it and found a customer portal application, which is a website where customers log in to manage their account, view orders or support tickets, and so on. He created an account and started enumerating the functionalities, meaning he clicked through every feature available to a logged-in user to see what the application could do.

Finding it

He first looked for common high-impact bugs: XSS (cross-site scripting, where an attacker can make a site run their own JavaScript in another user's browser), open redirect (where a site sends you to an address an attacker controls), SSRF (server-side request forgery, where an attacker makes the server send requests to internal systems) and IDOR (insecure direct object reference, where changing an ID in a URL lets you see someone else's data). None of them worked.

He then decided that if he could not find high severity bugs, he would look for low hanging fruit: simpler issues that are easier to find. He started checking for improper session handling (how the site keeps you logged in) and missing rate limiting (whether the site stops you from repeating an action too many times).

Exploitation

Step 1: see what a password reset actually does

He went to the forgot password page and requested a single reset. The purpose was to observe the token. A token here is a piece of data the application sends you, usually by email, that proves you own the account. In a normal reset flow, the email contains a link with a token, and you click it to open a page where you type a new password. Here, the email did not contain a link to a form. Instead, it contained a new password: a random 8 digit password. The researcher notes this was the first time he had seen such behaviour.

Step 2: repeat the request many times

He then performed a no rate limiting attack on the reset password function. That means he submitted the same forgot password request repeatedly, 88 times. There was no rate limiting in place, so the application accepted every request and sent 88 reset password emails to the account's mailbox.

Step 3: try the first password

After some time, he tried to log in on the portal using the password from the first reset email. He could not log in. The reason is that each subsequent reset request had already replaced that password with a new one.

Step 4: try the last password

He then copied the password from the very last reset email and tried to log in. This time he was logged in. Only the most recent password was valid, because every reset request changes the password and invalidates the previous one.

Why it works

The forgot password function has no rate limiting, so a client can send reset requests as fast as it likes. On top of that, each request immediately changes the account password to a new random 8 digit value and emails it, instead of issuing a time-limited, single-use reset token that the user redeems to set a password of their own choosing.

Because these two behaviours combine, a flood of reset requests leaves the account in a state where the old password no longer works and the only valid password is the one in the most recent email. The researcher describes this as a situation like account lockout: the user cannot log in with the old password, and the new password keeps changing with every reset request. He put it in the report as the reason a simple missing rate limit has a huge impact here.

The report does not describe any server-side defence that was present and failed; the absence of rate limiting is the finding itself.

Impact

An attacker who can reach the forgot password endpoint can submit repeated reset requests for a victim's account. Each one changes the victim's password and sends a new one to the victim's mailbox, so the victim is locked out of the old password and cannot reliably use any password that is not the latest one. The new passwords go to the account's mailbox, and the researcher frames the result as an account lockout style condition caused by a bug that would otherwise be considered low severity. The researcher frames the result as an account lockout style condition caused by a bug that would otherwise be considered low severity.

Fix

A reset should issue a single-use, expiring token that the user redeems to set their own password, so that repeated requests cannot invalidate the credential the legitimate user already holds.

Variants to test

  1. Request a password reset once and inspect the email. If it contains a generated password rather than a reset link, the account credential is being rotated server-side on every request; repeat the request a handful of times and then try the first password and the last one. A positive result is that only the most recent password works.
  2. Send the forgot password request repeatedly in quick succession and count the emails that arrive. A positive result is a large number of reset emails with no throttling, captcha or cooldown appearing.
  3. Do the same on the registration confirmation and email change endpoints, where a missing limit also means mailbox flooding and, in the email change case, possible confusion about which link is current.
  4. Check whether the reset endpoint is keyed on the account or on the requester. If the limit exists per session or per IP but not per target account, rotating the source or dropping the session may still let you flood a single victim.
  5. Where a reset token is used instead of a generated password, request several tokens for the same account and check whether older tokens stay valid. A positive result is that all issued tokens remain usable, which weakens the single-use property.

Glossary

  • Bug bounty program: A program run by an organisation that rewards people for finding and reporting security vulnerabilities in its systems.
  • Private program: A bug bounty program that is not open to the public; only invited researchers can participate.
  • Recon (reconnaissance): The phase of gathering information about a target, such as finding subdomains, technologies and features, before testing for vulnerabilities.
  • Subdomain: A prefix added to a domain name that points to a separate application or service, for example shop.example.com.
  • Customer portal: A website where customers log in to manage their account and interact with a company's services.
  • Enumerating functionalities: Systematically going through every feature available in an application to understand what it does and where it might be vulnerable.
  • XSS (cross-site scripting): A vulnerability that lets an attacker inject and execute their own JavaScript in another user's browser session.
  • Open redirect: A vulnerability where an application redirects users to an address supplied by the attacker, often used in phishing.
  • SSRF (server-side request forgery): A vulnerability where an attacker can make the server send requests to internal or arbitrary destinations.
  • IDOR (insecure direct object reference): A vulnerability where changing an identifier (like a user ID) in a request lets an attacker access another user's data.
  • Rate limiting: A control that restricts how many times an action can be performed in a given time period, to prevent abuse.
  • Token: A piece of data, often random, used to prove identity or authorise an action, such as a password reset.
  • Session handling: The mechanisms a website uses to keep a user logged in across requests, typically using cookies.
  • Account lockout: A state where a user cannot log in to their account, often because of too many failed attempts or, in this case, because the password keeps changing.
  • Endpoint: A specific URL or function in an application that performs an action, such as the forgot password form.
  • Single-use token: A token that is valid only once and cannot be reused, reducing the risk of abuse.
  • Throttling: Deliberately slowing down or limiting requests, similar to rate limiting.
  • Captcha: A challenge designed to distinguish humans from automated scripts, often used to prevent abuse.
  • Cooldown: A waiting period during which an action cannot be repeated.
  • IP address: A numeric address that identifies a device on a network; rate limits are sometimes applied per IP address.
  • Session: A period of interaction between a user and a website, often maintained by a session cookie after login.

More by Vedant Tekale

View all

8 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.