Skip to content
Business logic Write-up Beginner

No Rate Limiting on OTP sending

The OTP-sending endpoint enforced only a short per-request delay rather than a real rate limit, so the same request could be repeated indefinitely. An attacker could automate the request and flood a phone number with OTP messages.

nOOb_mAsTeR Follow

Published on medium.com

Firstly I would like to say that this is my first ever writeup for the InfoSec community and I may not be so good at presenting the explanation, please bear on that. So, its been a year or maybe a bit more than that when I started into cybersecurity.

nOOb_mAsTeR, 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. 4 min read.

Context

The target was a website that registered new users by sending an OTP to a phone number before any other details were provided. In systems of this kind an OTP is normally valid for a certain period, after which the user has to press a resend button to get a new one. On this site there was no resend button at all, which is what drew the researcher's attention.

The weakness reported is a lack of rate limiting on OTP sending, classified as bruteforce and lack of rate limiting. The write-up does not name the program or the exact host; the asset listed for it is medium.com, where the write-up was published.

Setup

The testing was done manually with Burp Suite. The researcher intercepted the request behind the "Send OTP" functionality and used the Repeater to replay it, then moved to the Intruder tab to automate the replay. No accounts, roles or special preconditions are described beyond having a phone number that can receive the OTPs. The report gives no product versions.

Finding it

The researcher first intercepted the request of the "Send OTP" functionality and sent it to Repeater. Sending it once delivered an OTP to the phone. Sending the same request again immediately, without any delay, returned a response saying that the OTP can be sent after one minute.

Waiting a minute and resending worked, and a different OTP arrived. By watching more closely to see exactly when the request would be accepted again, the researcher found the interval was 40 seconds. That made the situation clear: if the process could be automated, multiple OTPs could be sent every 40 seconds.

Exploitation

Step 1: Capture the Send OTP request

Intercept the request issued by the "Send OTP" functionality and send it to Repeater. The report does not include the raw request, so its method, endpoint, parameters and headers are not shown here.

Step 2: Confirm the server-side delay

Send the request once: an OTP is delivered to the phone. Send the identical request again immediately: the response states that the OTP can be sent after one minute. This shows the server enforces a wait between sends rather than allowing unlimited requests.

Step 3: Measure the real interval

Wait a minute, resend, and a different OTP arrives. By observing when the request is accepted, the researcher determined the actual window was 40 seconds, not the one minute the error message suggested.

Step 4: Automate with Intruder

Send the request to the Intruder tab, set the throttle to 40 seconds and the payload type to Null payloads, then start the attack. The Null payload type sends the request repeatedly without substituting any payload, and the throttle spaces the requests 40 seconds apart.

From the original on medium.com

The screenshot shows the result: the attack sent an OTP after every 40 seconds and spammed the researcher's phone.

Root cause

The server did implement a per-request delay between OTP sends, but it was a fixed time window of about 40 seconds rather than a limit on how many OTPs could be requested over a longer period. Because the window was short, a client that simply waited out the interval could keep triggering new OTPs. The report does not describe any additional defence, such as a cap on the number of OTPs per number or per IP, a CAPTCHA, or monitoring, The report does not describe any additional defence, such as a cap on the number of OTPs per number or per IP, a CAPTCHA, or monitoring.

Impact

The researcher could keep generating OTP messages to their own phone at the maximum rate the server allows, roughly one every 40 seconds in this case. The direct effect observed was spam to the researcher's own phone.

Fix

Based on the finding, the fix should be a limit on the number of OTP requests per phone number and per IP over a longer period, rather than only a short fixed delay between sends, together with the usual anti-automation controls on the endpoint.

Variants to test

  1. Measure the real resend window on other OTP endpoints. A positive result is a response that accepts a resend earlier than the message claims, as happened here.
  2. Replay the Send OTP request with a throttle just above the enforced interval and a Null payload. A positive result is a steady stream of OTP messages arriving on the phone.
  3. Try the same replay against the OTP verification endpoint. A positive result is that wrong codes can be submitted without the server locking the account or slowing the responses.
  4. Test whether the limit is keyed to the phone number, the IP or the session. A positive result is that changing one of these, for example the number, resets the window and lets requests through immediately.
  5. Check whether the delay is enforced only client-side. A positive result is that the resend button is hidden or disabled in the browser but the underlying request is still accepted when replayed.

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 website let people sign up by typing in a phone number and receiving a one-time code by text message. That code is called an OTP, short for one-time password: a short string of digits that is valid once, for a limited time, and is meant to prove that the person really controls that phone number.

Most sites of this kind let you ask for a new code only after a while, and they give you a button to do it. This site had no resend button at all, which is what caught the researcher's attention. When they looked at the request the browser sends when you ask for a code, they found the server did have a wait: if you asked again too soon, it replied that the OTP can be sent after one minute. But the real wait turned out to be about 40 seconds, and a program could ask again and again, every 40 seconds. The result was a stream of text messages to the researcher's own phone.

The weakness is described as a lack of rate limiting on OTP sending, and it is grouped with bruteforce. Rate limiting is the practice of counting how many requests a client makes in a period and refusing the ones over the limit. Without it, a client can repeat an action as fast as the server allows.

Background: the pieces involved

Before the steps, a few ideas that come up in the story.

  • A request and a response. When you use a website, your browser sends a message to a server asking for something, and the server sends a message back. A request is the question, a response is the answer. Every click that does something, like sending a code, is really one of these pairs.
  • An API. An API is the part of a website that accepts these requests and does the work, separate from the pages you see. The sign-up form you look at is the shop front; the API is the counter behind it that actually handles your order. Tools can talk to the API directly, without the shop front.
  • An OTP. A one-time password, usually a few digits sent by SMS. It is valid for a short time and should only work once. Its purpose is to confirm that whoever is signing up really has that phone in their hand.
  • Burp Suite. A program used by people who test websites. It sits between your browser and the site, so you can see each request before it is sent, change it, and send it again as many times as you like. Two of its parts matter here: Repeater, where you send one request by hand over and over, and Intruder, where you set up a request to be sent automatically many times.
  • Throttle. A setting in Intruder that puts a pause between each automatic request. Without it, the tool would fire requests as fast as it can; with it, you can space them out.
  • Null payloads. A payload is the changing part of a request that the tool substitutes on each attempt, for example a list of passwords. A Null payload means there is nothing to substitute: the same request is simply sent again and again, unchanged.

The setup

The testing was done by hand with Burp Suite. The researcher intercepted the request behind the "Send OTP" function and used Repeater to replay it, then moved to Intruder to automate the replay. Nothing else was needed beyond a phone number that can receive the codes. The report gives no product versions and does not name the program or the exact host; the asset listed for it is medium.com, where the write-up was published.

Finding it

The researcher first intercepted the request of the "Send OTP" functionality and sent it to Repeater. Sending it once delivered an OTP to the phone. Sending the same request again immediately, with no delay, returned a response saying that the OTP can be sent after one minute.

Waiting a minute and resending worked, and a different OTP arrived. Watching more closely to see exactly when the request would be accepted again, the researcher found the interval was 40 seconds. That made the situation clear: if the process could be automated, multiple OTPs could be sent every 40 seconds.

Exploitation

Step 1: Capture the Send OTP request

Intercept the request issued by the "Send OTP" functionality and send it to Repeater. The report does not include the raw request, so its method, endpoint, parameters and headers are not shown here.

Why this step: you cannot test a request until you can see it and hold a copy of it. Intercepting gives you that copy; Repeater gives you a place to send it again on demand.

Step 2: Confirm the server-side delay

Send the request once: an OTP is delivered to the phone. Send the identical request again immediately: the response states that the OTP can be sent after one minute. This shows the server enforces a wait between sends rather than allowing unlimited requests.

Why this step: it tells you whether the site has any protection at all. A wait enforced by the server is a real control, unlike a greyed-out button in the browser, which anyone can work around. Here the control existed, so the next question was how strong it was.

Step 3: Measure the real interval

Wait a minute, resend, and a different OTP arrives. By observing when the request is accepted, the researcher determined the actual window was 40 seconds, not the one minute the error message suggested.

Why this step: the message is only a hint. What matters is when the server actually accepts the request, because that is the pace an automated tool has to match. A shorter real window than advertised means more messages per hour than the site intends.

Step 4: Automate with Intruder

Send the request to the Intruder tab, set the throttle to 40 seconds and the payload type to Null payloads, then start the attack. The Null payload type sends the request repeatedly without substituting any payload, and the throttle spaces the requests 40 seconds apart.

Why this step: doing it by hand proves the flaw but not the scale. Automating it shows that the server accepted repeated requests spaced 40 seconds apart.

From the original on medium.com

The screenshot shows the result: the attack sent an OTP after every 40 seconds and spammed the researcher's phone.

Root cause

The server did implement a per-request delay between OTP sends, but it was a fixed time window of about 40 seconds rather than a limit on how many OTPs could be requested over a longer period. Because the window was short, a client that simply waited out the interval could keep triggering new OTPs. The report does not describe any additional defence, such as a cap on the number of OTPs per number or per IP, a CAPTCHA, or monitoring, The report does not describe any additional defence, such as a cap on the number of OTPs per number or per IP, a CAPTCHA, or monitoring.

In everyday terms: the site had a rule of "wait a bit between orders" but no rule of "only so many orders per day". Waiting a bit is easy for a machine.

Impact

The researcher could keep generating OTP messages to their own phone at the maximum rate the server allows, roughly one every 40 seconds in this case. The direct effect observed was spam to the researcher's own phone. The report does not describe abuse against other users' numbers, cost implications for the SMS provider, or any account takeover path, so those are not claimed here.

Fix

Based on the finding, the fix should be a limit on the number of OTP requests per phone number and per IP over a longer period, rather than only a short fixed delay between sends, together with the usual anti-automation controls on the endpoint.

Variants to test

  1. Measure the real resend window on other OTP endpoints. A positive result is a response that accepts a resend earlier than the message claims, as happened here.
  2. Replay the Send OTP request with a throttle just above the enforced interval and a Null payload. A positive result is a steady stream of OTP messages arriving on the phone.
  3. Try the same replay against the OTP verification endpoint. A positive result is that wrong codes can be submitted without the server locking the account or slowing the responses.
  4. Test whether the limit is keyed to the phone number, the IP or the session. A positive result is that changing one of these, for example the number, resets the window and lets requests through immediately.
  5. Check whether the delay is enforced only client-side. A positive result is that the resend button is hidden or disabled in the browser but the underlying request is still accepted when replayed.

Glossary

  • API: the part of a website that receives requests and does the work, separate from the pages you see in the browser.
  • Bruteforce: trying something over and over automatically, in the hope that repetition gets past a limit or guesses a value.
  • Burp Suite: a tool that sits between your browser and a website so you can inspect, change and resend requests.
  • CAPTCHA: a test meant to be easy for a person and hard for a program, used to slow down automation.
  • Client-side: enforced in the browser, on the user's machine, and therefore something the user can bypass.
  • Endpoint: the specific address on a server that handles one particular action, such as sending an OTP.
  • Intruder: the part of Burp Suite that sends a request automatically many times, with optional pauses and changing values.
  • IP address: the numeric address a device uses on a network, often used by servers to identify where requests come from.
  • Null payloads: an Intruder setting that sends the same request repeatedly with nothing substituted.
  • OTP: one-time password, a short code valid once for a limited time, here sent by SMS.
  • Payload: the part of a request that a testing tool changes on each attempt.
  • Rate limiting: counting requests from a client over a period and refusing those above the allowed number.
  • Repeater: the part of Burp Suite where you send a single request by hand, again and again, and read each response.
  • Request: the message a browser or tool sends to a server asking it to do something.
  • Response: the message the server sends back.
  • Root cause: the underlying reason a weakness exists, as opposed to its visible symptom.
  • Server-side: enforced on the server, where the user cannot simply switch it off.
  • Session: the server's record of a particular visitor across several requests, usually tied to a cookie or token.
  • Throttle: an Intruder setting that puts a fixed pause between automatic requests.
  • Token: a value the server gives a client to identify it on later requests, like a claim ticket.
  • Vulnerability class: the general category a weakness belongs to, such as lack of rate limiting.

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.