Skip to content
Info disclosure Write-up Beginner

How I Found a Pre-Authentication PII Leak Affecting Every User on a Major Indian Deals Platform

The login/signup API endpoint returned full user PII (name, email, user ID, referral code) for any phone number without requiring an OTP or authentication. An attacker could enumerate phone numbers to harvest personal data and identify which numbers have accounts.

anshh.bohara Follow

Published on medium.com

Bug Bounty

anshh.bohara, 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

The target was a popular Indian deals and experiences platform, part of one of India's largest food-tech conglomerates. Its mobile web app handled user login and signup through a JSON API. The endpoint at the centre of the finding is the one that handles both login and signup in a single call:

Text
POST /mobile/api/user/loginOrSignupUser

Normally you would expect such an endpoint to take a phone number, send an OTP, verify it, and only then return anything about the user. That is the flow the researcher describes as the intended one: send phone number, receive OTP, verify OTP, then get user data.

Setup

No special accounts, roles or tooling are described. The researcher was examining the authentication flow of the mobile web app and testing the login/signup endpoint directly. The only precondition that matters is network access to the API and a phone number to submit. The report does not describe any registration, any test account, or any particular client beyond a plain HTTP request.

Finding it

While poking around the authentication flow, the researcher focused on the endpoint that handles both login and signup. The endpoint accepts a phone number in the request body and immediately returns the associated user's PII in the response. No OTP is sent and no verification occurs: the data comes back before any authentication step.

The researcher then ran three negative controls to confirm this was not by design:

  1. No authentication required. The endpoint works with zero headers beyond Content-Type. No cookies, no session, no API key.
  2. No OTP verification. In the normal flow the PII should only appear after the OTP is verified. Here it comes back at step one, before any OTP is even sent.
  3. Real data. The response returned a real name and a real email address. The researcher cross-referenced this with data from another finding on the same platform, an exposed Firestore database, and it matched. This was not test data.

Exploitation

Step 1: Send a phone number with no credentials

The request needs nothing beyond a JSON content type and a phone number in the body:

HTTP
POST /mobile/api/user/loginOrSignupUserContent-Type: application/json
JSON
{"primaryPhoneNumber": "98XXXXXXXX"}

primaryPhoneNumber is the only field shown in the body. The number in the report is masked, but the format is a 10-digit Indian mobile number. There are no cookies, no session token and no Authorization header: just a POST with a phone number.

Step 2: Read the PII straight out of the response

For a registered user, the response contains the full profile:

The user object carries the user ID, full name, email address, mobile number and referral code, plus the isReferralAllowed and totalVouchersPurchased fields. The top-level existingCustomer flag is true.

Step 3: Use the differential response to enumerate users

The response differs depending on whether the phone number belongs to an existing user. For an existing user it returns full PII: name, email, mobile, referral code and user ID. For a non-existing number it creates a skeleton account with null fields for name and email. That makes the endpoint a user enumeration oracle: you can tell exactly which phone numbers have accounts by checking whether the name and email fields are populated.

Step 4: Scale it

Indian phone numbers are 10 digits. The full space is large, but targeted ranges such as specific area codes and number series narrow it significantly. During the researcher's testing there was no rate limiting on the endpoint.

Root cause

The endpoint performs a user lookup and returns the profile before any authentication step has happened. The OTP is not a gate: the PII is served at step one, before an OTP is even sent. The report's takeaway is that developers often return user data in the initial lookup step to pre-populate the UI, forgetting that pre-auth means attacker-accessible. The request required no session, cookie or API key, and no rate limiting was observed during testing.

Impact

The researcher lists four consequences:

  • Mass PII harvesting. Iterate phone numbers and extract names and emails for every customer. No rate limiting was observed.
  • User enumeration. The differential response reveals which phone numbers are registered, enabling targeted attacks.
  • Account correlation. User IDs are sequential integers, allowing cross-referencing with other API endpoints.
  • Referral fraud. Each user's referral code is exposed, potentially enabling abuse of the referral system.

Outcome

The finding was reported through a bug bounty platform and marked Informative because the asset was considered out of scope for the program. The bug was real and the impact was real, but scope is scope.

Fix

The report does not describe a fix being applied. The takeaway it gives is the design rule: check what the login/signup flow returns before authentication completes. Developers often return user data in the initial lookup step to pre-populate the UI, forgetting that pre-auth means attacker-accessible. The OTP should be a gate, not a formality that happens after the data has already been served.

Variants to test

  • Login and signup endpoints on other targets. Submit a phone number or email with no session and see whether the response contains profile fields. A positive result is a name, email, user ID or similar data coming back before any OTP or password step.
  • Differential responses for existence checks. Compare the response for a known-registered identifier with one for an unregistered identifier. A positive result is a consistent difference, such as populated versus null name and email fields, or an existingCustomer style flag.
  • Account creation as a side effect. Send an unregistered identifier and check whether a skeleton account is created. A positive result is a new record with null profile fields.
  • Rate limiting. Repeat the request across a range of identifiers and watch for throttling. A positive result for an attacker is no throttling at all across a meaningful number of requests.
  • Sequential identifiers. Where the response exposes a numeric user ID, check whether IDs are sequential and whether other endpoints accept them. A positive result is a numeric user ID that is sequential and appears in other endpoints.
  • Referral codes in pre-auth responses. Look for referral codes returned before login. A positive result is a code that can be used to abuse the referral system.

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

What happened, in plain words

A security researcher found that a popular Indian app for deals and experiences would hand over a person's private details to anyone who knew their phone number. No password, no login, no code sent to the phone. You type a phone number into one request and the app replies with that person's full name, email address, user ID and referral code.

This is called a pre-authentication information leak. "Pre-authentication" means "before logging in". "Information leak" means private data is given out when it should not be. The word "PII" stands for Personally Identifiable Information: data that can be used to identify a specific person, such as a name, an email address or a phone number.

The researcher reported it through a bug bounty platform. A bug bounty programme is a scheme where companies invite outside people to test their systems and pay for real problems found. In this case the report was marked Informative because the part of the company's systems involved was considered out of scope, meaning it was not covered by the programme's rules. The bug was real, but the programme's rules did not cover that asset.

Below I walk through the whole thing from zero: what the product is, what an API is, what the request looked like, what came back, and why each step mattered.

The target

The target was a popular Indian deals and experiences platform, part of one of India's largest food-tech conglomerates. Think of a site where you buy vouchers and deals for restaurants, activities and experiences. Its mobile web app handled user login and signup through a JSON API.

A few terms first, because everything else depends on them:

  • Mobile web app: a website designed to look and behave like an app when opened on a phone's browser. You do not install it from an app store; you visit it in the browser.
  • API: Application Programming Interface. A way for one piece of software to talk to another. A useful everyday comparison is a restaurant. The menu is the list of things you can ask for, the waiter carries your order to the kitchen, and the kitchen sends back a dish. You never walk into the kitchen yourself. An API is the waiter: you send a defined request, and it sends back a defined answer. Apps and websites use APIs constantly, often without the person tapping the screen knowing it.
  • JSON: JavaScript Object Notation. A simple text format for structured data, built from labels and values in curly braces. It is the format the API used to send its answers. If you have ever seen something like {"name": "Alex"}, that is JSON: the label name paired with the value Alex.
  • Endpoint: a specific address inside an API that does one job. If the API is the restaurant, an endpoint is one particular dish on the menu. Each endpoint has a path, like a street address for a function.

The endpoint at the centre of the finding is the one that handles both login and signup in a single call:

Text
POST /mobile/api/user/loginOrSignupUser

Line by line:

  • POST is the type of request. Browsers and apps use different request types for different jobs. GET is normally used to fetch a page or data. POST is normally used to send data to the server, for example when you submit a form. Here the app sends the phone number to the server, so POST fits.
  • /mobile/api/user/loginOrSignupUser is the path. Reading it left to right: it lives under mobile (the mobile app's part of the service), then api (the programming interface), then user (user-related actions), and finally loginOrSignupUser, which is the name of the action itself. The name says it handles both logging in and signing up in one go.

Normally you would expect such an endpoint to take a phone number, send an OTP, verify it, and only then return anything about the user. An OTP is a One-Time Password: a short code, usually sent by SMS, that proves you control the phone number. It is the same idea as a code you get by text when you log in to your bank. The flow the researcher describes as the intended one is: send phone number, receive OTP, verify OTP, then get user data. The code is supposed to be a gate. You only get through once you have proved you own the number.

Setup

No special accounts, roles or tooling are described. The researcher was examining the authentication flow of the mobile web app and testing the login/signup endpoint directly. The only precondition that matters is network access to the API and a phone number to submit. The report does not describe any registration, any test account, or any particular client beyond a plain HTTP request.

"Authentication flow" simply means the sequence of steps a service uses to decide who you are: you give an identifier (a phone number or email), you prove you own it (an OTP or password), and the service gives you something that says "this person is logged in". The researcher's approach was to look at that sequence and ask: what does the service send back at each step, and does it wait for proof before sending anything sensitive?

Finding it

While poking around the authentication flow, the researcher focused on the endpoint that handles both login and signup. The endpoint accepts a phone number in the request body and immediately returns the associated user's PII in the response. No OTP is sent and no verification occurs: the data comes back before any authentication step.

The request body is the part of a request that carries the data you are sending, as opposed to the address you are sending it to. If the endpoint is the address on an envelope, the body is the letter inside. The response is what the server sends back.

The researcher then ran three negative controls to confirm this was not by design. A negative control is a check designed to rule out innocent explanations. In science, if you think a plant grew because of a fertiliser, you also grow one without it; if both grow the same, the fertiliser was not the cause. Here the question was: is this leak an accident, or is it how the system is meant to work? Three checks ruled out the innocent explanations:

  1. No authentication required. The endpoint works with zero headers beyond Content-Type. No cookies, no session, no API key.
  2. No OTP verification. In the normal flow the PII should only appear after the OTP is verified. Here it comes back at step one, before any OTP is even sent.
  3. Real data. The response returned a real name and a real email address. The researcher cross-referenced this with data from another finding on the same platform, an exposed Firestore database, and it matched. This was not test data.

Some of those terms need unpacking:

  • Headers: small pieces of information sent alongside a request, like the labels on a parcel saying what is inside and how to handle it. Content-Type is one such label. It tells the server what format the body is in, for example JSON.
  • Cookie: a small piece of data a website stores in your browser and sends back with later requests, so the site can remember who you are between page loads. It is like a wristband at an event: you show it once at the door, and after that staff can see you are allowed in.
  • Session token: a string of characters that acts as proof you are logged in, similar in purpose to a cookie but often sent in a header. Think of a cloakroom ticket: whoever holds the ticket can collect the coat. If someone else gets the ticket, they can pretend to be you.
  • API key: a secret string that identifies an application to a service, a bit like a membership card for software rather than a person.
  • Firestore database: a type of cloud database from Google. "Exposed" means it was reachable by people who should not have had access. The researcher used data from that separate finding to check that the names and emails coming back from this endpoint were genuine, not dummy records.

Exploitation

Step 1: Send a phone number with no credentials

The request needs nothing beyond a JSON content type and a phone number in the body:

HTTP
POST /mobile/api/user/loginOrSignupUserContent-Type: application/json
JSON
{"primaryPhoneNumber": "98XXXXXXXX"}

Line by line:

  • POST /mobile/api/user/loginOrSignupUser is the same endpoint as before: the action that handles login and signup together. The researcher chose it because it is the front door of the account system, and front doors are where a service has to decide what to show before it knows who you are.
  • Content-Type: application/json is a header telling the server that the body is JSON. It is the only header shown. There is no cookie, no session token and no Authorization header. An Authorization header is where a logged-in app normally puts its proof of identity, like showing your pass at a gate. Its absence is the point: the request carries no proof of anything.
  • {"primaryPhoneNumber": "98XXXXXXXX"} is the body. primaryPhoneNumber is the only field shown. The number in the report is masked, but the format is a 10-digit Indian mobile number. The X characters stand in for the hidden digits, the same way a form might show the last digits of a card number.

Why this step was taken: the researcher wanted to see what the server would do with the smallest possible request. If a service gives out data when you send almost nothing, then the data is not protected by anything. There are no cookies, no session token and no Authorization header: just a POST with a phone number.

Step 2: Read the PII straight out of the response

For a registered user, the response contains the full profile:

Line by line:

  • The outer curly braces hold one JSON object, the whole answer.
  • "user" is a label whose value is another object, nested inside the first. Everything inside its own braces describes the user.
  • "id" is the user ID, a unique identifier for the account. The value is redacted here because it identifies a real person.
  • "name" is the person's full name, also redacted.
  • "email" is the email address, redacted. The @[REDACTED].com part shows the shape of an address without revealing it.
  • "mobile" is the phone number, redacted.
  • "referralCode" is a code tied to that user's account. Referral schemes give you a code to share; when a friend signs up with it, you usually get a reward. The code is redacted here.
  • "isReferralAllowed" is a true or false setting saying whether referral use is allowed for this account. Here it is false.
  • "totalVouchersPurchased" is a count of vouchers bought. Here it is 0.
  • "existingCustomer": true sits outside the user object and says this phone number belongs to an existing customer.

So the user object carries the user ID, full name, email address, mobile number and referral code, plus the isReferralAllowed and totalVouchersPurchased fields. The top-level existingCustomer flag is true. All of that arrived in answer to a request that proved nothing about who was asking.

Step 3: Use the differential response to enumerate users

The response differs depending on whether the phone number belongs to an existing user. For an existing user it returns full PII: name, email, mobile, referral code and user ID. For a non-existing number it creates a skeleton account with null fields for name and email. That makes the endpoint a user enumeration oracle: you can tell exactly which phone numbers have accounts by checking whether the name and email fields are populated.

A differential response means the answer changes depending on the input in a way that reveals something. A user enumeration oracle is a way of asking a system "does this person have an account?" and getting a reliable yes or no. "Enumeration" means listing things one by one; "oracle" here means a source of answers. A skeleton account is a bare record created with almost nothing filled in, like opening a file with only a name on it and leaving the rest blank. Null means "no value at all", as opposed to an empty piece of text.

Why this matters: even without the name and email, the simple fact of whether an account exists is useful to an attacker. It tells them which phone numbers are registered, enabling targeted attacks. The everyday comparison is a shop assistant who says "yes, we have a customer by that name" versus "no, never heard of them". Even without giving out the address, the assistant has confirmed who shops there.

Step 4: Scale it

Indian phone numbers are 10 digits. The full space is large, but targeted ranges such as specific area codes and number series narrow it significantly. During the researcher's testing there was no rate limiting on the endpoint.

Rate limiting is a cap on how many requests a service will accept from one source in a period of time. It is like a bouncer who lets a few people in per minute; if someone tries to rush the door, they get slowed down or stopped. Without it, a script can send request after request as fast as the network allows. The researcher's point is arithmetic: ten digits is a lot of combinations, but phone numbers are not random. They follow patterns by region and operator, so an attacker can work through realistic ranges rather than every possible number. No rate limiting means nothing slows that down.

Root cause

The endpoint performs a user lookup and returns the profile before any authentication step has happened. The OTP is not a gate: the PII is served at step one, before an OTP is even sent. Likely the initial lookup exists to pre-populate the UI, and the developer did not treat the pre-auth stage as attacker-accessible. Nothing in the request path required a session, cookie or API key, so there was no defence in front of the lookup, and no rate limiting was observed to slow down iteration.

"Pre-populate the UI" means filling in fields on the screen before the person types anything. A familiar example: some sites show your name and profile picture as soon as you enter your email address, so the next screen feels personal. The report's takeaway is that developers often return user data in the initial lookup step to pre-populate the UI, forgetting that pre-auth means attacker-accessible.

Impact

The researcher lists four consequences:

  • Mass PII harvesting. Iterate phone numbers and extract names and emails for every customer. No rate limiting was observed.
  • User enumeration. The differential response reveals which phone numbers are registered, enabling targeted attacks.
  • Account correlation. User IDs are sequential integers, allowing cross-referencing with other API endpoints.
  • Referral fraud. Each user's referral code is exposed, potentially enabling abuse of the referral system.

In plain words:

  • Harvesting means collecting data in bulk, automatically. "Iterate" means going through a list one item at a time, here phone numbers.
  • Account correlation means linking the same person's records across different systems. If user IDs are sequential integers, they run 1, 2, 3, 4 and so on rather than being random strings. That makes it easy to guess other IDs and match records between endpoints. It is like house numbers on a street: if you know number 12, you can find number 13.
  • Referral fraud means misusing the referral scheme, for example by using codes in ways the scheme did not intend, to collect rewards that were not earned.

Outcome

The finding was reported through a bug bounty platform and marked Informative because the asset was considered out of scope for the program. The bug was real and the impact was real, but scope is scope.

"Out of scope" means outside the set of systems the programme has authorised people to test and pay for. Programmes define scope carefully, often because some systems belong to partners or are handled by other teams. A finding can be genuine and still fall outside those rules. "Informative" is a status some platforms use for reports that are acknowledged but not treated as eligible for a reward.

Fix

The report does not describe a fix being applied. The takeaway it gives is the design rule: check what the login/signup flow returns before authentication completes. Developers often return user data in the initial lookup step to pre-populate the UI, forgetting that pre-auth means attacker-accessible. The OTP should be a gate, not a formality that happens after the data has already been served.

In everyday terms: do not hand over the parcel until the person at the door has shown ID. The code should be checked first, and only then should any personal data be sent back.

Variants to test

If you want to look for the same kind of mistake elsewhere, these are the checks the researcher suggests. Each one is a question you can ask of a login or signup flow.

  • Login and signup endpoints on other targets. Submit a phone number or email with no session and see whether the response contains profile fields. A positive result is a name, email, user ID or similar data coming back before any OTP or password step.
  • Differential responses for existence checks. Compare the response for a known-registered identifier with one for an unregistered identifier. A positive result is a consistent difference, such as populated versus null name and email fields, or an existingCustomer style flag.
  • Account creation as a side effect. Send an unregistered identifier and check whether a skeleton account is created. A positive result is a new record with null profile fields.
  • Rate limiting. Repeat the request across a range of identifiers and watch for throttling. A positive result for an attacker is no throttling at all across a meaningful number of requests.
  • Sequential identifiers. Where the response exposes a numeric user ID, check whether IDs are sequential and whether other endpoints accept them. A positive result is a numeric user ID that is sequential and appears in other endpoints.
  • Referral codes in pre-auth responses. Look for referral codes returned before login. A positive result is a code that can be used to abuse the referral system.

Glossary

  • API: Application Programming Interface; a defined way for software to ask another system for data or actions, like a waiter carrying orders between you and the kitchen.
  • API key: a secret string that identifies an application to a service, like a membership card for software.
  • Authentication: the process of proving who you are, usually with a password or a code sent to your phone.
  • Authentication flow: the sequence of steps a service uses to identify you and let you in.
  • Authorization header: the part of a request where a logged-in app normally puts proof of identity.
  • Bug bounty platform: a scheme where companies invite outside researchers to test their systems and report real problems, sometimes for a reward.
  • Content-Type: a header that tells the server what format the request body is in, such as JSON.
  • Cookie: a small piece of data stored in your browser and sent back with later requests so a site can remember you.
  • Differential response: an answer that changes depending on the input in a way that reveals information.
  • Endpoint: a specific address inside an API that performs one job.
  • Enumeration: listing or checking items one by one, such as testing which phone numbers have accounts.
  • Firestore database: a type of cloud database from Google; "exposed" means it was reachable by people who should not have had access.
  • GET: a request type normally used to fetch a page or data.
  • Harvesting: collecting data in bulk, usually automatically.
  • Header: small pieces of information sent alongside a request, like labels on a parcel.
  • Informative: a report status some platforms use for findings that are acknowledged but not eligible for a reward.
  • JSON: JavaScript Object Notation; a text format for structured data made of labels and values in curly braces.
  • Mobile web app: a website built to look and behave like an app when opened in a phone's browser.
  • Negative control: a check designed to rule out innocent explanations for an observation.
  • Null: having no value at all, as opposed to an empty piece of text.
  • OTP: One-Time Password; a short code, usually sent by SMS, that proves you control a phone number.
  • Out of scope: outside the set of systems a bug bounty programme has authorised people to test and pay for.
  • PII: Personally Identifiable Information; data that can identify a specific person, such as a name, email address or phone number.
  • POST: a request type normally used to send data to a server, for example when submitting a form.
  • Pre-authentication: happening before a user has logged in or proved who they are.
  • Rate limiting: a cap on how many requests a service accepts from one source in a period of time.
  • Referral code: a code tied to a user's account that can be shared so that a friend signing up with it earns a reward.
  • Request body: the part of a request that carries the data being sent, as opposed to the address it is sent to.
  • Response: what a server sends back after receiving a request.
  • Sequential integers: numbers that run in order, 1, 2, 3 and so on, rather than being random strings.
  • Session token: a string of characters that acts as proof you are logged in, like a cloakroom ticket.
  • Skeleton account: a bare account record created with almost nothing filled in.
  • User enumeration oracle: a way of asking a system whether a given person has an account and getting a reliable yes or no.
  • User ID: a unique identifier for an account.

More by anshh.bohara

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.