Zomatoooo! IDOR in Saved Payments
The saved payment methods endpoint accepted a sequential payment_method_id and returned other users' card details without checking ownership. An attacker could enumerate IDs to view cardholder names, partial card numbers and bank names.
Published on prateeksrivastavaa.medium.com
{{media:0}}
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
Zomato is a food ordering platform. When a user reaches the payment step of an order, the checkout flow presents the payment methods the user has used before, so that a returning customer can pick a saved card instead of entering the details again. The feature that makes this work is a backend call that fetches the user's default payment options. That call is the subject of this write-up.
Setup
The researcher was using the Zomato mobile app on a phone and intercepting its traffic with Burp Suite. No special account, role or privilege is described; the researcher worked from his own account, which had previously used payment methods. The work was done on the researcher's own account.
Finding it
While placing an order, the researcher added a dish to the cart and moved towards payment. At that point the app displayed some of the previously used payment methods. That display was the hint: the app had to be asking the backend for those saved methods, and the request would carry something that identifies which method to return.
Intercepting the traffic from the phone, the researcher found a request that sends a number of parameters to fetch default_payment_options. One of those parameters was payment_method_id. The identifier looked interesting because it was a direct reference to a stored payment method, and the natural question was what happens if it is incremented or decremented by one or two: would the backend return somebody else's payment method details?
Exploitation
Step 1: Change the identifier
The researcher replaced the value of payment_method_id with a random number and replayed the request. The response contained the payment information of a different, unrelated user. The data returned included the cardholder's name, the first six and last four digits of the card, the bank's name, and more.
This showed that the backend did not check that the payment method belonged to the authenticated user making the request.
Step 2: Confirm the identifiers are sequential
The researcher then worked out that the payment_method_id values are sequential. That makes enumeration practical: walking the identifier space reaches other users' saved methods one after another.
Step 3: Automate the enumeration
With sequential identifiers, the researcher moved to Burp Intruder and brute-forced the last four digits of payment_method_id, hoping there would be no rate limiting. There was none: the researcher could send as many requests as he wanted.
Root cause
The backend accepted a client-supplied payment_method_id and returned the matching saved payment method without verifying that it belonged to the authenticated user. Because the identifiers are sequential, guessing or enumerating them is trivial. The absence of rate limiting made bulk enumeration easier. In the researcher's words, there was no proper check at the backend, which is what made this an IDOR.
Impact
An authenticated attacker could read other users' saved payment information by enumerating payment_method_id. The exposed fields named in the report are the cardholder's name, the first six and last four digits of the card, and the bank's name, plus other details the report does not enumerate. The first six digits identify the card issuer and the last four narrow the card down, so the leak is useful for profiling a card even though the full number is not shown. The attack works at scale because there is no rate limiting.
Fix
Zomato pushed a patch. The report does not describe the code change; a fix addressing the root cause would be to authorise every lookup of a saved payment method against the authenticated user.
Variants to test
- Other saved-object endpoints. Look for requests that fetch saved cards, addresses, UPI handles or other stored payment instruments by an identifier. A positive result is a response containing another account's data when the identifier is changed.
- Sequential identifier enumeration. Where identifiers look numeric, increment and decrement by one or two on your own objects. A positive result is a valid record that does not belong to you.
- Rate-limit checks. Replay the same request many times through Intruder. A positive result is a long run of successful responses with no throttling, which turns a single-record leak into a bulk one.
- Parameter tampering on checkout calls. Change identifiers in the request that loads default payment options at checkout. A positive result is a response that reflects a payment method you do not own.
Timeline
The researcher reported the issue to Zomato through HackerOne with a comprehensive report and a proof-of-concept video. Zomato rewarded a bounty and pushed a patch within 43 minutes of the report.
What happened, in plain words
Zomato is a food ordering platform: you browse restaurants, add dishes to a cart, and pay. If you have ordered before, the checkout screen offers you the payment methods you used previously, so you do not have to type your card details again. To show that list, the app has to ask Zomato's servers for it. That request is the heart of this story.
When the researcher reached the payment step, the app showed some of his previously used payment methods. That made him curious about the request behind the list. He captured the traffic from his phone, found the request that fetches the saved payment options, and noticed it carried a parameter called payment_method_id. He changed that number to a random value, and the server sent back another person's payment information. The numbers turned out to run in sequence, and there was no limit on how many requests he could send. There was no limit on how many requests he could send. He reported it to Zomato through HackerOne with a proof-of-concept video, and Zomato rewarded a bounty and pushed a patch within 43 minutes.

The picture above is the author's profile image from the article.
The pieces you need to know first
Before walking through the steps, here are the ideas the story relies on, explained from zero.
- An app talking to a server. When you tap a button in a mobile app, the app usually does not have the answer itself. It sends a message over the internet to a computer owned by the company, called a server, and the server sends back the answer. Think of a restaurant: you (the app) tell the waiter (the request) what you want, the kitchen (the server) prepares it, and the waiter brings back the plate (the response).
- API. The set of rules for those messages is called an API (Application Programming Interface). It defines which requests the server accepts and what it sends back. It is like a menu with fixed dish names: you can only order what is on it, in the format the kitchen expects.
- Request and response. A request is the message the app sends: it names what it wants and carries some details. A response is the server's reply, usually containing the data asked for. Both are just text travelling over the network.
- Parameters. Parameters are the named details attached to a request, like the fields on a form. If a request asks for a payment method, a parameter might say which payment method, for example
payment_method_id=12345. The name is the label, the value is what you filled in. - Identifier (ID). An identifier is a number or string that uniquely names a thing stored on the server, the way a student number names one student in a school. Here, each saved payment method has its own
payment_method_id. - Intercepting traffic. Your phone and the server exchange messages over the network. With a tool running on a computer, you can place yourself in the middle and read, pause and edit those messages before they reach the server. It is like opening a letter, reading it, changing a word, and sealing it again before delivery.
- Burp Suite. Burp Suite is a popular tool for exactly that: it sits between your browser or phone and the internet, records every request and response, and lets you change a request and send it again. Its Intruder feature sends the same request many times with one part changed each time, which is how people test numbers in bulk.
- IDOR. IDOR stands for Insecure Direct Object Reference. It means the server hands out a stored object (a payment method, an address, an invoice) based only on an identifier the client sends, without checking that the object belongs to the person asking. Compare it to a hotel reception that gives you a room key whenever you say a room number, without checking that the room is booked in your name. If you say room 204 instead of room 105, you get someone else's key.
- Sequential identifiers. If the IDs are 1001, 1002, 1003 and so on, they are sequential: each one is the previous plus one. That makes guessing easy, because you can simply try the neighbours of your own number.
- Brute force. Brute forcing means trying many values systematically, one after another, instead of cleverly deducing the right one. With sequential IDs, brute forcing is just counting.
- Rate limiting. Rate limiting is a server-side rule that says no more than N requests per minute from one user. It is a speed bump against exactly this kind of bulk guessing. Without it, nothing slows an attacker down.
- Bounty and HackerOne. HackerOne is a platform where security researchers report bugs to companies. A bounty is the money a company pays for a valid report.
Setting the scene
The researcher was using the Zomato mobile app on a phone and capturing its traffic with Burp Suite. Nothing special was needed on the account: no administrator role, no extra permission. The researcher used his own account, which had previously used payment methods. The work was done on his own account.
Finding it
- He added a dish to the cart and moved towards payment.
- At that point the app displayed some of his previously used payment methods.
- That display was the hint. For the app to show those methods, it had to be asking the server for them, and the request had to carry something that says which method to return.
He intercepted the traffic from the phone and found a request that sends a number of parameters to fetch default_payment_options. One of those parameters was payment_method_id. That name stood out because it is a direct reference to a stored payment method. The natural next question was: what happens if I add or subtract one or two from that number? Would the server return somebody else's payment method details?
Exploitation
Step 1: Change the identifier
He replaced the value of payment_method_id with a random number and sent the request again. The response contained the payment information of a different, unrelated user. The data returned included the cardholder's name, the first six and last four digits of the card, the bank's name, and more.
Why this matters: the server did not check that the payment method behind that number belonged to the account making the request. That missing check is the whole vulnerability.
Step 2: Confirm the identifiers are sequential
He then worked out that the payment_method_id values run in sequence. That makes enumeration practical: walking through the numbers reaches other users' saved methods one after another, like reading consecutive page numbers in a book.
Step 3: Automate the enumeration
With sequential identifiers, he moved to Burp Intruder and brute-forced the last four digits of payment_method_id, hoping there would be no rate limiting. There was none. He could send as many requests as he wanted.
In his own words: there was no proper check at the backend, which is what made this an IDOR.
Root cause
The server accepted a payment_method_id supplied by the client and returned the matching saved payment method without verifying that it belonged to the authenticated user. Because the identifiers are sequential, guessing or enumerating them is trivial. The absence of rate limiting made bulk enumeration easier.
Impact
An authenticated attacker could read other users' saved payment information by enumerating payment_method_id. The exposed fields named in the report are the cardholder's name, the first six and last four digits of the card, and the bank's name, plus other details the report does not enumerate.
The first six digits identify the card issuer and the last four narrow the card down, so the leak is useful for profiling a card even though the full number is not shown. The attack works at scale because there is no rate limiting.
Fix
Zomato pushed a patch. The report does not describe the code change; a fix addressing the root cause would be to authorise every lookup of a saved payment method against the authenticated user. In plain terms: before handing over the key, check that the room is booked in your name.
Variants to test
If you want to look for similar problems, these are directions worth testing.
- Other saved-object endpoints. Look for requests that fetch saved cards, addresses, UPI handles or other stored payment instruments by an identifier. A positive result is a response containing another account's data when the identifier is changed.
- Sequential identifier enumeration. Where identifiers look numeric, increment and decrement by one or two on your own objects. A positive result is a valid record that does not belong to you.
- Rate-limit checks. Replay the same request many times through Intruder. A positive result is a long run of successful responses with no throttling, which turns a single-record leak into a bulk one.
- Parameter tampering on checkout calls. Change identifiers in the request that loads default payment options at checkout. A positive result is a response that reflects a payment method you do not own.
Timeline
The researcher reported the issue to Zomato through HackerOne with a comprehensive report and a proof-of-concept video. Zomato rewarded a bounty and pushed a patch within 43 minutes of the report.
Glossary
- API: the set of rules that defines how an app and a server exchange requests and responses.
- Bounty: money a company pays a researcher for a valid security report.
- Brute force: trying many values systematically, one after another, rather than deducing the right one.
- Burp Suite: a tool that sits between your device and the internet, records traffic, and lets you edit and resend requests.
- Burp Intruder: the part of Burp Suite that sends the same request many times with one part changed each time.
- Checkout flow: the sequence of screens from cart to payment in an online order.
- default_payment_options: the request the app sends to fetch the user's saved payment methods.
- Enumeration: walking through a list of possible values, such as consecutive numbers, to find valid ones.
- HackerOne: a platform where researchers report security bugs to companies.
- IDOR (Insecure Direct Object Reference): a flaw where the server returns a stored object based only on an identifier from the client, without checking that the object belongs to the requester.
- Identifier (ID): a number or string that uniquely names a stored object on the server.
- Intercepting: pausing and reading network traffic between your device and a server, and optionally changing it.
- Parameter: a named detail attached to a request, with a name and a value.
- payment_method_id: the parameter that names which saved payment method the server should return.
- Proof-of-concept (PoC) video: a recording that demonstrates the bug actually working.
- Rate limiting: a server rule that caps how many requests a user can send in a period of time.
- Request: the message an app sends to a server asking for something.
- Response: the server's reply, usually containing the requested data.
- Sequential identifiers: identifiers that increase by one each time, making them easy to guess.
- Server: the computer owned by a company that stores data and answers requests from apps.
- UPI handle: an identifier used for a payment service in India.