Skip to content
Account takeover Disclosed report Beginner

Adding phone number to profile By OTP brute forcing

The phone-number verification step accepted unlimited OTP guesses, so an attacker could brute force the six-digit code. By finding the correct OTP, an attacker could attach another person's phone number to their own account and then receive that person's login OTPs.

ganesh_reddy Follow

Originally disclosed on HackerOne

Bounty$100 Medium 4.3 View original
  • Fixed in 33 days
  • Paid in 19 days
  • Disclosed after 13 months

Steps to reproduce the bug : Step1: In the permanent address enter any phone number, then enter any user phone and verify phone number then it will ask a OTP for phone number verification. Step2: So enter any OTP in the OTP filed and intercept the request in the burp-suite, Then send the intercepted request to burp intruder. Step3: In the burp intruder Brute force the OTP from 100000 to 999999, In this OTP brute force once we send the request with received OTP in the response we will get 961 length So OTP verified . Step4: Copy that response and paste that first intercepted request response and forward that, Then check phone number added to our account.

Impact

Using this we can add any user phone number to our account , Then that added phone number will received the OTP's and used to login.

Note : As i received a mail from you to report this bug again i am reporting this bug again so please check and reward me that reward.

The original report as published on HackerOne, by ganesh_reddy. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

CoinMate.io is a cryptocurrency exchange, and the report concerns its profile feature for adding a phone number. Normally a user enters a phone number, the application sends a one-time password (OTP) to that number, and the user types the OTP back into the form to prove ownership of the number. The report describes what happens when the OTP check on that flow can be brute forced.

The weakness is classified as insecure storage of sensitive information, with a CVSS score of 4.3 (medium). The researcher is ganesh_reddy, and the report was disclosed on HackerOne with a bounty of 100.00 USD.

Setup

To follow the steps you need an account on the target, a phone number you control for the initial verification, and Burp Suite with its proxy and Intruder modules. The researcher does not name any specific versions of Burp or of the application, and the report gives no endpoint, parameter name or request header, so the exact HTTP traffic is not reproduced here.

The precondition is that the attacker has a logged-in account and can reach the profile page where a phone number is added. The attacker also needs a phone number they can verify once, because the flow first asks for a number and an OTP before the interesting request appears.

Finding it

The report gives only the reproduction steps, not how the issue was first noticed. That makes the OTP field a candidate for brute forcing: if the server does not limit the number of attempts and does not tie the OTP to a short-lived, single-use state, an attacker can simply try every value until one is accepted.

Exploitation

Step 1: start the phone verification flow

In the permanent address section, enter any phone number, then enter any user phone and verify the phone number. The application then asks for an OTP for phone number verification.

The point of this step is to get the application into the state where it is waiting for an OTP. The report does not say whether the first number and the second number have to differ, or what the permanent address field has to do with the flow.

Step 2: intercept the OTP submission

Enter any OTP in the OTP field and intercept the request in Burp Suite, then send the intercepted request to Burp Intruder.

The value entered here does not matter, because the request is going to be replayed with other values.

Step 3: brute force the OTP

In Burp Intruder, brute force the OTP from 100000 to 999999. In this OTP brute force, once we send the request with the received OTP in the response we will get 961 length, so the OTP is verified.

The search space is the six-digit range from 100000 to 999999. The signal that a guess succeeded is the response length: the correct OTP produces a response of 961 bytes, which differs from the responses to wrong guesses.

Step 4: replay the successful response

Copy that response and paste it into the first intercepted request's response, then forward that, and check that the phone number was added to the account.

This step uses Burp's ability to edit a response before it reaches the browser. The successful response from the Intruder run is pasted into the first intercepted request's response and forwarded, and the phone number is then added to the account.

Root cause

The OTP verification endpoint accepts repeated guesses for the same verification attempt without an effective limit, and the six-digit code space is small enough to enumerate.

The report notes that the successful request produced a response of 961 length.

Impact

Using this, an attacker can add any user's phone number to their own account. The added phone number then receives the OTPs, and those OTPs can be used to log in.

Fix

What should be done is to enforce a strict limit on OTP attempts per verification attempt and per account, invalidate the OTP after a small number of failures, expire codes quickly, and make each code single-use. The response for a wrong code should not differ in a way that reveals success, and the verification state should be tracked server-side rather than inferred from a response the client can edit.

Variants to test

  1. Other OTP flows on the same target: password reset, email verification, withdrawal confirmation and login second factor. A positive result is a successful code found by enumeration within the allowed attempt budget.
  2. Different code lengths: four-digit codes are easier to enumerate than six-digit ones. A positive result is a hit well inside the range you can send before any lockout.
  3. Response-based oracles: compare status codes, body length, redirect targets and timing between wrong and right codes. A positive result is any consistent difference that lets you filter guesses without reading the body.
  4. Attempt-limit bypasses: reset the verification attempt, change the session, or start a new flow to see whether the counter resets. A positive result is a fresh budget of attempts for the same code.
  5. Code reuse: submit a code that was already accepted. A positive result is a second acceptance of the same value.

Hunting notes

This kind of bug tends to hide in flows that are added late to a product, such as phone number attachment, address changes and second-factor enrolment, where the OTP check is implemented separately from the main login flow and may lack the rate limiting applied elsewhere. During recon, look for any endpoint that takes a short numeric code and returns a distinguishable response; the length difference seen here is a common signal. The researcher showed enough impact by completing the flow end to end: the number was added to the account and the report explains that the number then receives the OTPs used to log in. The report also notes that it was submitted again after a mail asking for it to be reported again, with a request for the reward.

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. 10 min read.

What happened, in plain words

CoinMate.io is a cryptocurrency exchange, a website where people buy, sell and hold digital currencies. Like most sites that hold money, it lets you attach a phone number to your profile. The phone number is used as a second way to prove who you are: when you log in or do something sensitive, the site sends a short code to your phone by text message, and you type that code back into the website.

That short code is called a one-time password, or OTP. The idea is that only the person holding the phone can read the message, so only that person can type the code. The code is meant to be used once and then thrown away.

The researcher found that the code could be guessed by sending many attempts until one was accepted. A six-digit code has a million possible values, which sounds like a lot, but a computer can send guesses far faster than a person can type. If the site never says "too many attempts, try later", an attacker can simply try every value until one is accepted.

Once the correct code was found, the response was pasted into the first intercepted request and forwarded, and the phone number was added to the account. From then on, any code the site sends to that number goes to the attacker's phone, and those codes can be used to log in. The report was rated medium severity with a CVSS score of 4.3, was disclosed on HackerOne, and paid a bounty of 100.00 USD. The researcher is ganesh_reddy.

The pieces you need to understand first

Before walking through the steps, here are the ideas the report relies on. None of them require any security background.

A web request and a response. When you fill in a form and press a button, your browser sends a message to the website's computer (the server) asking it to do something. That message is the request. The server sends a message back, the response, which tells the browser what happened. Most of the time you never see either one; the browser draws the result on screen.

An API. Think of a restaurant. The menu and the waiter are the API: a fixed way for you to ask the kitchen for something without going into the kitchen yourself. On the web, an API is the set of addresses (endpoints) a website's pages use to ask the server for data or actions. The page you see is one thing; the requests it makes behind the scenes are another.

An endpoint. A specific address on the server that does one job, for example "check this OTP". The report does not name the endpoint used here, so we do not know its exact address.

A session cookie or token. After you log in, the server gives your browser a small piece of text that acts like a wristband at an event: it proves you already checked in, so you do not have to show your ID at every door. The browser sends it with every request. If someone steals it, they can act as you. The report does not show the cookie or token used in these requests.

An OTP (one-time password). A short numeric code, usually sent by text message or email, that proves you can access a phone number or mailbox. Here it is six digits long.

Brute forcing. Guessing every possible answer until one works, instead of being clever. Think of a padlock with a three-digit dial: you could try 000, 001, 002 and so on. It is slow by hand but fast for a machine. The defence is to make the number of possible answers large and to stop accepting guesses after a few failures.

Burp Suite, Proxy and Intruder. Burp Suite is a tool that sits between your browser and the website, like a postal worker who opens every letter, lets you read and change it, and then sends it on. The Proxy part lets you pause a request and look at it. Intruder is the part that takes one request and sends it many times with one part changed each time, which is exactly what guessing a code needs.

Response length as a signal. Servers often send slightly different amounts of data depending on the outcome. If a wrong code produces one size of reply and a right code produces another, you can spot the winner just by looking at the size, without reading the content. Here the winning reply was 961 bytes long.

The vulnerability class. The report is filed under "insecure storage of sensitive information". In plain terms, the sensitive thing here is the OTP and the state of the verification: the server did not keep that state safely enough to stop repeated guessing.

What you need before starting

  1. An account on CoinMate.io that you are logged in to.
  2. A phone number you control, so you can receive the first code the site sends.
  3. Burp Suite installed, with the Proxy and Intruder modules available, and your browser set to send its traffic through Burp.

The report gives no endpoint, parameter name or request header, so the exact request is not reproduced here. What follows is the sequence of actions the researcher describes.

Finding it

The report gives only the reproduction steps, not how the issue was first noticed. That combination is what makes guessing possible: if the server does not count attempts and does not tie each code to a single use, you can keep sending guesses until one is accepted.

Exploitation

Step 1: start the phone verification flow

In the permanent address section, enter any phone number, then enter any user phone and verify the phone number. The application then asks for an OTP for phone number verification.

The purpose of this step is to get the site into the state where it is waiting for a code. That waiting state is what the later requests act on.

Step 2: intercept the OTP submission

Enter any OTP in the OTP field and intercept the request in Burp Suite, then send the intercepted request to Burp Intruder.

The value you type here does not matter, because the request will be replayed with other values. Pausing it in Burp is how you get a copy of the request to work with. Sending it to Intruder turns that copy into a template for many attempts.

An anti-CSRF token is a hidden value the site puts in forms so that another website cannot submit them on your behalf; it is worth knowing about because it is one of the things that can make replaying a request harder.

Step 3: brute force the OTP

In Burp Intruder, brute force the OTP from 100000 to 999999. In this OTP brute force, once we send the request with the received OTP in the response we will get 961 length, so the OTP is verified.

The range 100000 to 999999 is every six-digit number that does not start with zero. Intruder sends the request once for each value, swapping the code each time. The signal that a guess worked is the size of the reply: the correct code produced a response of 961 bytes, which is different from the replies to wrong guesses.

Step 4: replay the successful response

Copy that response and paste it into the first intercepted request's response, then forward that, and check that the phone number was added to the account.

Burp lets you edit a response before the browser sees it. Here the successful reply from the Intruder run is put in place of the reply to the original request, and then forwarded. The successful reply from the Intruder run is put in place of the reply to the original request and forwarded, and the phone number is added to the account.

Why it works

The verification step accepts repeated guesses for the same attempt without an effective limit, and six digits is a small enough space to work through. The likely gaps are: no counter of attempts per verification, no lockout after a number of failures, and no rule that each code can only be submitted once.

The report notes that the successful request produced a response of 961 length.

Impact

With this, an attacker can add any user's phone number to their own account. The added number then receives the OTPs, and those OTPs can be used to log in.

Fix

The sensible fixes are: enforce a strict limit on OTP attempts per verification and per account, invalidate the code after a small number of failures, expire codes quickly, and make each code single-use. The reply for a wrong code should not differ in a way that reveals success, and the verification state should be tracked on the server rather than inferred from a response the browser can edit.

Variants to test

  1. Other OTP flows on the same target: password reset, email verification, withdrawal confirmation and login second factor. A positive result is a successful code found by enumeration within the allowed attempt budget.
  2. Different code lengths: four-digit codes are easier to enumerate than six-digit ones. A positive result is a hit well inside the range you can send before any lockout.
  3. Response-based oracles: compare status codes, body length, redirect targets and timing between wrong and right codes. A positive result is any consistent difference that lets you filter guesses without reading the body.
  4. Attempt-limit bypasses: reset the verification attempt, change the session, or start a new flow to see whether the counter resets. A positive result is a fresh budget of attempts for the same code.
  5. Code reuse: submit a code that was already accepted. A positive result is a second acceptance of the same value.

Hunting notes

This kind of bug tends to hide in flows that are added late to a product, such as phone number attachment, address changes and second-factor enrolment. Those flows are often built separately from the main login flow and may lack the rate limiting applied elsewhere. During recon, look for any endpoint that takes a short numeric code and returns a distinguishable response; the length difference seen here is a common signal. The researcher showed enough impact by completing the flow end to end: the number was added to the account, and the report explains that the number then receives the OTPs used to log in. The report also notes that it was submitted again after a mail asking for it to be reported again, with a request for the reward.

Glossary

  • API: the fixed set of addresses and rules a website's pages use to ask its server to do things, like a menu and waiter in a restaurant.
  • Bounty: money a company pays a researcher for reporting a security bug responsibly.
  • Brute forcing: trying every possible value of a secret until one is accepted, rather than guessing cleverly.
  • Burp Intruder: the part of Burp Suite that sends one request many times with a chosen part changed each time.
  • Burp Proxy: the part of Burp Suite that pauses requests and responses so you can read and edit them.
  • Burp Suite: a tool that sits between your browser and a website and lets you inspect and modify the traffic.
  • Cookie: a small piece of text a site stores in your browser, often used to remember that you are logged in.
  • CSRF token: a hidden value in a form that proves the form came from the real site, not from another website.
  • CVSS: a standard scoring system for how serious a security bug is; 4.3 is in the medium range.
  • Endpoint: a specific address on a server that performs one job.
  • Insecure storage of sensitive information: a weakness where data that should be protected is kept or handled in a way that lets the wrong people reach it.
  • OTP (one-time password): a short code, usually sent by text or email, meant to be used once to prove you control a phone number or mailbox.
  • Rate limiting: a server rule that refuses further attempts after too many in a short time.
  • Request: the message your browser sends to a server asking it to do something.
  • Response: the message the server sends back describing what happened.
  • Response length: the size in bytes of the server's reply; a difference in size can reveal whether an attempt succeeded.
  • Second factor: an extra proof of identity beyond a password, such as a code sent to your phone.
  • Session: the period during which a site remembers who you are, usually carried by a cookie or token.
  • Token: a piece of text that stands in for your identity or permission, so you do not have to send your password every time.

More from CoinMate.io

View all

The newest disclosed reports for this program.

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.