#BugBounty — @Paytm Customer Information is at risk — India’s largest digital wallet company
The bill payment endpoint accepted an account number with any mobile number, allowing retrieval of other users' bill details. An attacker could brute-force account numbers to access thousands of users' names, addresses, and bill amounts.
Published on medium.com
#### Avinash Jain (@logicbomb1)
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.
Context
Paytm is described in the report as India's largest digital wallet company. The feature involved is the online electricity bill payment flow. Normally a user enters their electricity account number and the mobile number associated with that account, and the application validates the combination before showing the user their own bill details.
The researcher found that the validation could be bypassed, so that bill details belonging to other users could be retrieved. The weakness is classified as an IDOR.
Setup
The report does not describe any special accounts, roles or tool versions. The researcher reached the feature as an ordinary user doing an online electricity bill payment, and used Burp Suite's Intruder for the brute-force step. No authentication precondition beyond access to the bill payment section is stated.
Finding it
While paying an electricity bill, the researcher reached the electricity payment section.

After entering the required details, namely the account number and the associated mobile number, the application simply presented the bill information.

The researcher then inspected the HTTP request that the page triggered.

In that request, the mobile number is passed as recharge_number_2 and the account number as recharge_number. The two are meant to be validated together as a correct combination before the bill details are returned. The researcher noted that the two were meant to be validated together as a correct combination before the bill details are returned.
Exploitation
Step 1: Change the account number
The researcher changed the account number, the recharge_number parameter, while keeping any random mobile number in recharge_number_2. With that change, the application returned the complete bill details of another user associated with that account number.

The report does not reproduce the raw request or response for this step; the request is shown only in the screenshot above.
Step 2: Brute-force the consumer number
The researcher expected Paytm to have a strong application firewall and some throttling over repeated requests, but found nothing of the kind. Using Intruder to brute-force the consumer number, within a couple of hours the researcher had thousands of users' bill information, containing their name, address, bill amount, date of birth and similar fields.

The report does not include the Intruder payload set, the request template or the number of requests sent.
Root cause
The application appears to authorise the bill lookup on the account number alone, rather than requiring that the supplied mobile number actually belongs to that account. The mobile number parameter is accepted but does not constrain which record is returned, so changing recharge_number while leaving recharge_number_2 arbitrary still yields another user's bill. This is likely a missing ownership check on the record fetched for the supplied account number.
The absence of rate limiting or throttling on repeated requests meant the same weakness could be turned into bulk enumeration of consumer numbers.
Impact
An attacker who can reach the electricity bill payment flow could retrieve the bill details of other users by supplying their account numbers, including name, address, bill amount and date of birth. Because requests were not throttled, this could be done at scale: the researcher collected thousands of users' records in a couple of hours. The report does not state how account numbers are formatted or how easily they can be guessed, beyond the fact that brute-forcing them worked.
Fix
It records that the issue was first accepted but not fixed, on the grounds that it was according to functionality and a third-party issue, and that after re-reporting it was accepted and later marked fixed. The fix should ensure that the mobile number supplied with the account number is validated as belonging to that account before any bill details are returned, and that repeated lookups are throttled.
Variants to test
- On other bill payment or recharge flows, change the account or consumer identifier while leaving the linked mobile number arbitrary. A positive result is another user's bill details being returned.
- Swap the mobile number to one that does not belong to the account. A positive result is the bill still being returned.
- Send the same request repeatedly with sequential account numbers and observe whether responses are throttled or blocked. A positive result is a steady stream of distinct users' records with no rate limiting.
- Check whether the response includes fields beyond the bill itself, such as name, address and date of birth. A positive result is personal data appearing in the response body.
What happened, in plain words
Paytm is described in the report as India's largest digital wallet company. Among the things you can do on Paytm is pay an electricity bill online. To do that, you type in your electricity account number and the mobile number that is registered with that electricity account. The site checks the two together and then shows you your own bill: how much you owe, your name, your address and so on.
A security researcher found that this check could be bypassed. By changing one value in the request that his browser sent, he could make Paytm show him the bill details of a completely different person. Because nothing slowed down repeated requests, he could then do this over and over automatically and collect the details of thousands of users in a couple of hours.
This kind of flaw is called an IDOR, short for Insecure Direct Object Reference. The name sounds complicated, but the idea is simple. Imagine a hotel where every room key is just a number written on a card, and the reception desk hands you the key for room 204. If the door lock only checks that the number on the card is a valid room number, and never checks that room 204 is your room, then writing 305 on a blank card gets you into room 305. The application is trusting an identifier that the user supplies, instead of checking that the user is allowed to see the thing that identifier points to. That is exactly what happened here: the account number told Paytm which bill to fetch, and Paytm fetched it without checking that the person asking had any right to it.
The story around the bug
The researcher reported the issue to the Paytm security team. According to the report, the team accepted it at first but did not fix it, saying it was according to their functionality and a third-party issue. He then checked whether other e-wallet companies such as Mobikwik and Freecharge behaved the same way, and found that they did not expose user information in this manner. He reported the issue to Paytm again, and this time the team accepted it quickly.

The screenshot above shows the issue being re-reported to Paytm.
The second screenshot shows the Paytm team's response.
A short timeline at the end of the report records the sequence of events:
- 27-Nov-2017: bug reported to the company.
- 5-Jan-2018: bug marked fixed.
- 5-Jan-2018: fix tested and confirmed.
- 5-Jan-2018: rewarded by the company.
- 21-June-2018: bug re-opened.
- 25-July-2018: rewarded by the company.
Background you need before the technical part
A few ideas come up repeatedly below, so here they are from scratch.
A web request. When you use a website, your browser is constantly sending small messages to a server and receiving answers. Typing an address and pressing Enter sends a request for a page; clicking a button often sends another request behind the scenes. Each request has a method (such as GET, meaning "give me this" or POST, meaning "here is some data, process it"), a URL saying what it is about, and often a body carrying data such as form fields.
Parameters. Many requests carry named values, for example account=12345&mobile=98765. Each name is a parameter and each value is what the application reads. If the application uses a parameter to decide which record to show, and does not check that you are entitled to that record, you have the kind of bug described here.
An API. Think of a restaurant. The menu and the waiter are the interface; the kitchen is where the food is actually made. An API (Application Programming Interface) is the waiter: a defined way for one piece of software to ask another for data or an action, without knowing what happens in the kitchen. When the Paytm page shows your bill, the page has almost certainly asked a Paytm API for the bill data, and the API has answered with the details. The request the researcher inspected is that conversation between the page and the API.
A cookie or token. Websites need to remember who you are between one request and the next, because the underlying protocol, HTTP, has no memory. After you log in, the server gives your browser a small piece of data, usually stored as a cookie, which the browser sends back with every later request. It works like a wristband at an event: you show it at the door once, and after that the staff recognise you by the band rather than asking for your ID again. The report does not reproduce any cookie or token values, and none are needed to understand the bug.
Burp Suite and Intruder. Burp Suite is a tool that sits between your browser and the website and lets you look at, and change, the requests your browser sends. Intruder is one of its features: you mark a part of a request as a variable, give it a list of values, and Intruder sends the request once for each value automatically. It is the difference between trying every key on a keyring by hand and having a machine try them one after another. The researcher used Intruder for the brute-force step described later.
Brute force. Trying many possibilities in sequence, quickly, instead of guessing cleverly. If account numbers are short numbers, trying all of them is feasible for a computer.
Rate limiting or throttling. A server-side limit on how often the same client may repeat an action, for example "no more than a few lookups per minute". It is the digital equivalent of a shop assistant who starts refusing to serve someone who keeps asking for other people's receipts. Without it, a single weakness can be turned into bulk collection.
A web application firewall (WAF). A filter placed in front of a website that inspects incoming requests and blocks ones that look abusive or malicious. The researcher expected Paytm to have a strong one, and to have throttling, and found neither in the way of his repeated requests.
Finding the flaw, step by step
Step 1: Reach the electricity payment section
While paying an electricity bill, the researcher reached the electricity payment section of Paytm.

The screenshot shows the online electricity payment page on Paytm.
Step 2: Enter your own details and see your own bill
He filled in the required details: his electricity account number and the mobile number associated with that account. The application then simply presented his bill information.

The screenshot shows the bill details page that appeared.
At this point everything is working as intended. The important question for a security tester is not "does it work?" but "what exactly did my browser send to make it work?". That is why the next step is to look at the request.
Step 3: Inspect the request
He inspected the HTTP request that the page triggered.

The screenshot shows the request that fetches the bill information.
In that request, the mobile number is passed as recharge_number_2 and the account number as recharge_number. The intention is that the two are checked together as a correct combination before the bill details are returned. Only if the pair matches should the bill come back.
The researcher's observation was that this was not how it behaved. The account number alone appeared to decide whose data came back. In other words, the mobile number was being accepted as a formality rather than actually checked.
Step 4: Change the account number
He changed the account number, the recharge_number parameter, while keeping any random mobile number in recharge_number_2. With that change, the application returned the complete bill details of another user associated with that account number.

The screenshot shows another user's bill details being disclosed.
Why this step matters: the mobile number was deliberately left wrong. If the application had really been validating the pair, a wrong mobile number should have produced an error, no matter what account number was supplied. Getting a full bill back with a random mobile number shows the pair was not being validated as intended. The account number is the only thing that matters, and the account number is something the user controls.
The report does not reproduce the raw request or response for this step; the request is shown only in the screenshot above.
Step 5: Do it at scale
One other person's bill is already a serious problem, but it is still one record at a time. The next question is whether the site stops you from asking again and again. The researcher expected Paytm to have a strong application firewall and some throttling over repeated requests, but found nothing of the kind.
So he used Intruder to brute-force the consumer number. Within a couple of hours he had thousands of users' bill information, containing their name, address, bill amount, date of birth and similar fields.

The two screenshots show the resulting disclosure of user information.
The report does not include the Intruder payload set, the request template or the number of requests sent.
Why it worked
The application appears to authorise the bill lookup on the account number alone, rather than requiring that the supplied mobile number actually belongs to that account. The mobile number parameter is accepted but does not constrain which record is returned, so changing recharge_number while leaving recharge_number_2 arbitrary still yields another user's bill. This is most likely a missing ownership check on the record fetched for the supplied account number: the server fetches the record the user asked for, and never asks whether the user is allowed to have it.
The absence of rate limiting or throttling on repeated requests meant the same weakness could be turned into bulk enumeration of consumer numbers. One missing check plus no speed limit equals mass data collection.
What the impact was
An attacker who can reach the electricity bill payment flow could retrieve the bill details of other users by supplying their account numbers, including name, address, bill amount and date of birth. Because requests were not throttled, this could be done at scale: the researcher collected thousands of users' records in a couple of hours. The report does not state how account numbers are formatted or how easily they can be guessed, beyond the fact that brute-forcing them worked.
How it should be fixed
The report does not describe the code change made. It records that the issue was first accepted but not fixed, on the grounds that it was according to functionality and a third-party issue, and that after re-reporting it was accepted and later marked fixed.
The fix should ensure that the mobile number supplied with the account number is validated as belonging to that account before any bill details are returned, and that repeated lookups are throttled. In plain terms: check the wristband, and stop serving someone who keeps asking for other people's receipts.
Similar things to test elsewhere
If you are learning, these are the same idea applied in slightly different places. Each one is a question you can ask of a site you are authorised to test.
- On other bill payment or recharge flows, change the account or consumer identifier while leaving the linked mobile number arbitrary. A positive result is another user's bill details being returned.
- Swap the mobile number to one that does not belong to the account. A positive result is the bill still being returned.
- Send the same request repeatedly with sequential account numbers and observe whether responses are throttled or blocked. A positive result is a steady stream of distinct users' records with no rate limiting.
- Check whether the response includes fields beyond the bill itself, such as name, address and date of birth. A positive result is personal data appearing in the response body.
Glossary
- API (Application Programming Interface): a defined way for one piece of software to ask another for data or an action, like a waiter carrying orders between the dining room and the kitchen.
- Brute force: trying many possible values in sequence, quickly, rather than guessing cleverly.
- Burp Suite: a tool that sits between your browser and a website so you can inspect and modify the requests being sent.
- Cookie: a small piece of data a site stores in your browser and which your browser sends back with later requests, so the site can recognise you.
- GET / POST: HTTP methods. GET asks for something; POST sends data for the server to process.
- HTTP request: the message a browser sends to a server asking for a page or an action, including a method, a URL and often parameters or a body.
- IDOR (Insecure Direct Object Reference): a flaw where an application uses an identifier supplied by the user to fetch a record, without checking that the user is allowed to access that record.
- Intruder: a Burp Suite feature that sends a request repeatedly, substituting a different value into a marked position each time.
- Parameter: a named value carried in a request, such as
recharge_number=12345. - Rate limiting / throttling: a server-side limit on how often a client may repeat an action.
- Token: a piece of data, similar in purpose to a cookie, that proves to the server who you are on later requests.
- WAF (web application firewall): a filter in front of a website that inspects incoming requests and blocks ones that look abusive or malicious.
- Web request: see HTTP request.