How a simple IDOR impacted the data of thousands of customers of an Indian automotive giant
An invoice download request used a sequential invoice number that was not checked against the logged-in user, so anyone could pull other customers' invoices. Because the registration and reset one-time codes were also returned in the response, the researchers could reset a victim's password and take over the account.
Published on medium.com
Cybersecurity
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
On 9 August 2022, Kushal Jain and Ashutosh Mahajan were testing a production Android application as part of their practice. The application belonged to an EV company: EV users use it to locate charging stations and pay for the facility. The report refers to the app only as XYZ.
Payments in the app ran through two wallets, a PayTm wallet and the application's own built-in wallet. Whenever a user topped up their wallet, an invoice was created for that transaction, and the app exposed a request for downloading that invoice.
Setup
No tooling, versions or build details are given. The testing was done against the production application. For the demonstration the researchers created two accounts, Test1 and Test2, with Test1 acting as the attacker and Test2 as a normal customer.
Finding it
The first issue appeared within the first minute of testing. The OTP sent at registration and at password reset was returned in the response itself. The report notes that this plays a crucial role later on.

The screenshot shows the OTP disclosed in the response.
Exploitation
Step 1: Read the OTP from the response
The OTP sent at registration and password reset was returned in the response itself. No interception of SMS is needed.
Step 2: Enumerate invoices through the invoiceNo parameter
The request responsible for downloading an invoice carried an invoiceNo parameter that was vulnerable to IDOR.

The screenshot shows the invoice download request with its invoiceNo parameter.
Changing invoiceNo to the value belonging to the researchers' other testing account returned a valid response, and the invoice of that account could be downloaded.

The screenshot shows the invoice that was downloaded this way.
Each invoice contained the customer's Name, GST No. Address, Mobile No. Customer ID and transaction details.
Step 3: Chain the two findings into account takeover
- Log in as
Test1and enumerateinvoiceNovalues until one belonging toTest2is found. - Download that invoice and read
Test2'smobileNofrom it. - Go to the login page, enter
Test2'smobileNoand choose the forgot password option to reset the password. - The OTP arrives in the response, and the application is also vulnerable to response manipulation, so the password of
Test2can be changed without their consent. - On
Test2's side nothing is visible: they are unaware that the password has been changed and the account compromised.
Step 4: Scale the enumeration
On 24 October 2022 the researchers were able to obtain invoices of more than 25,000 customers.

The screenshot shows the enumerated invoices.
Root cause
The request responsible for downloading an invoice had an invoiceNo parameter that was vulnerable to IDOR. That is a classic object-level authorisation failure: the identifier is guessable or enumerable, and the server performs no ownership check on it.
The takeover depends on a second design mistake: the OTP for registration and password reset is included in the response, so the secret that should only reach the phone's owner is handed to whoever makes the request. The report also lists response manipulation as a vulnerability of the app, which the researchers used to complete the password change. The report does not describe why these issues were not caught.
Impact
By chaining the two issues, the researchers took over the account of Test2.: the invoice discloses the mobile number, and the mobile number plus the leaked OTP plus response manipulation is enough to reset the password. The report states that the impact is high and affects both the company and the customer, and that it could be escalated to monetary loss for customers and harm to the nature of the app, since no strict security policies were implemented to keep the app safe.
The report also lists further severe issues: response manipulation, no proper validation of phone number (which could be exploited to create multiple bot accounts), clear text transmission of credentials, no rate limit, and others.
Fix
The report does not describe the individual fixes. It states that as of 1 March 2023 all reported issues had been fixed.
Variants to test
- Change an object identifier in any download or detail endpoint (invoice, receipt, statement, order) to another account's value. A positive result is a valid response containing the other account's data.
- Trigger registration and password reset for an account you control and inspect the full response body and headers for the OTP or a reset token. A positive result is the code appearing in the response.
- Attempt response manipulation on verification and reset flows, for example altering a success flag or status field in the response. A positive result is the server accepting the altered state and completing the action.
- Enumerate identifiers sequentially or by predictable pattern to see whether records of other customers are reachable at scale. A positive result is a steady stream of valid records belonging to other users.
- Check whether credentials are sent over clear text and whether authentication endpoints enforce rate limits. A positive result is credentials visible on the wire or unlimited attempts against the login and OTP endpoints.
What happened, in plain words
Two security researchers, Kushal Jain and Ashutosh Mahajan, spent some time testing an Android app made by an Indian electric vehicle (EV) company. The app helps EV owners find charging stations and pay for charging. The report calls the app XYZ.
While testing, they found two separate mistakes in how the app was built. The first was that the app handed back the one-time password (OTP) in its own reply. The second was that the app let anyone download any customer's invoice just by changing a number in the request. An invoice is the receipt you get after a payment, and this one contained the customer's name, address, mobile number and other details.
By putting the two mistakes together, the researchers took over the account of their second test account: they downloaded its invoice to learn its mobile number, then used the leaked OTP to reset its password. On 24 October 2022 they were able to pull invoices belonging to more than 25,000 customers. The report states that as of 1 March 2023 all reported issues had been fixed.
This article walks through the same story step by step, explaining each technical idea from scratch as it comes up.
The app and the setup
On 9 August 2022, Kushal Jain and Ashutosh Mahajan were testing a production Android application as part of their practice. "Production" means the real, live version that actual customers use, not a test copy. The application belonged to an EV company: EV users use it to locate charging stations and pay for the facility. The report refers to the app only as XYZ.
Payments in the app ran through two wallets, a PayTm wallet and the application's own built-in wallet. A wallet here is simply a stored balance of money inside the app, a bit like a prepaid card: you put money in, and later you spend it. Whenever a user topped up their wallet, an invoice was created for that transaction, and the app exposed a request for downloading that invoice.
A request is what your phone sends to the company's computer (the server) when you tap a button. The server replies with data, and the app shows it on screen. The part of the server the app talks to is often called an API, short for Application Programming Interface. Think of an API as a service counter: you hand over a slip with your order written on it, and the person behind the counter hands back what you asked for. The slip is the request, the item handed back is the response.
No tooling, versions or build details are given. The testing was done against the production application. For the demonstration the researchers created two accounts, Test1 and Test2, with Test1 acting as the attacker and Test2 as a normal customer. Having two accounts you control is a standard way to test safely: you attack your own second account instead of a stranger's.
Finding it
The first issue appeared within the first minute of testing. The OTP sent at registration and at password reset was returned in the response itself. The report notes that this plays a crucial role later on.
An OTP, or one-time password, is a short code (usually a few digits) that is valid only once and only for a short time. Companies send it to your phone by SMS to prove that the person typing really holds that phone. It is a second lock on the door, separate from your normal password. If the code is supposed to arrive only by SMS, then only the phone's owner should ever see it.

The screenshot shows the OTP disclosed in the response. In other words, the server's reply to the app contained the code. No interception of SMS is needed.
Exploitation
Step 1: Read the OTP from the response
Because the one-time code for registration and password reset is delivered in the response body, anyone who can trigger the flow for a given account receives the code that is meant to prove control of that account's phone number. A "flow" here means the sequence of screens: you type your mobile number, tap "forgot password", the app asks the server to send a code, and then you type the code back.
The important point is that the code was not kept secret between the server and the phone. It travelled back to whoever asked for it, inside the same reply the app received. So the attacker does not need to steal the victim's phone or read their text messages; they just need to start the reset process and read the answer.
Step 2: Enumerate invoices through the invoiceNo parameter
The request responsible for downloading an invoice carried an invoiceNo parameter that was vulnerable to IDOR.
Let us unpack that sentence. A parameter is a named value attached to a request, like the "To" field on an envelope: it tells the server which specific item you want. Here the parameter was called invoiceNo, short for invoice number. IDOR stands for Insecure Direct Object Reference. It means the server takes an identifier supplied by the client (here, the invoice number) and hands back the matching record without checking whether that record belongs to the person asking. The comparison: a hotel clerk who gives you the key to any room whose number you say, without checking that the room is actually booked in your name.

The screenshot shows the invoice download request with its invoiceNo parameter. The request is the app asking the server "please send me invoice number such-and-such".
Changing invoiceNo to the value belonging to the researchers' other testing account returned a valid response, and the invoice of that account could be downloaded. In plain terms: they logged in as Test1, sent the download request with Test2's invoice number, and the server happily returned Test2's invoice. The server never asked "does this invoice belong to the logged-in user?".

The screenshot shows the invoice that was downloaded this way. Each invoice contained the customer's Name, GST No. Address, Mobile No. Customer ID and transaction details. GST No. is the Indian tax registration number of a business. The mobile number is the key piece: it is what the login and password reset use to identify a customer.
Step 3: Chain the two findings into account takeover
"Chaining" means using one small weakness to enable the next, like a row of dominoes. Neither mistake alone gives full control of an account; together they do. The steps were:
- Log in as
Test1and enumerateinvoiceNovalues until one belonging toTest2is found. To enumerate means to try numbers one after another, for example 1001, 1002, 1003, and see which ones come back with real data. If invoice numbers are simple and sequential, this is quick. - Download that invoice and read
Test2'smobileNofrom it. The invoice itself tells the attacker which phone number belongs to the account they just reached. - Go to the login page, enter
Test2'smobileNoand choose the forgot password option to reset the password. This is the normal, legitimate feature that any customer uses when they forget their password. - The OTP arrives in the response, and the application is also vulnerable to response manipulation, so the password of
Test2can be changed without their consent. Response manipulation means the app trusts a value in the server's reply that the client can alter, for example a flag that says "code correct". If the app believes that flag rather than checking with the server, an attacker can flip it and skip the check. - On
Test2's side nothing is visible: they are unaware that the password has been changed and the account compromised. They did not receive a warning, and their old password simply stops working.
Step 4: Scale the enumeration
On 24 October 2022 the researchers were able to obtain invoices of more than 25,000 customers. "Scale" is the important word: one wrong invoice is a bug, but walking through thousands of invoice numbers and collecting every valid one turns it into a mass data leak.

The screenshot shows the enumerated invoices, the long list of records collected by stepping through invoice numbers.
Root cause
The request responsible for downloading an invoice had an invoiceNo parameter that was vulnerable to IDOR. "Authenticated" means the server knew who was asking (the user had logged in), but it still did not compare that identity with the owner of the invoice. That is a classic object-level authorisation failure: the identifier is guessable or enumerable, and the server performs no ownership check on it.
The takeover depends on a second design mistake: the OTP for registration and password reset is included in the response, so the secret that should only reach the phone's owner is handed to whoever makes the request. The report also lists response manipulation as a vulnerability of the app, which the researchers used to complete the password change. The report does not describe why these issues were not caught.
A session is the server's memory of "this person is logged in right now". When you log in, the server gives your app a small piece of data, often called a session cookie or token, and the app sends it back with every request so the server can recognise you. A correct design would look at that session, work out which customer it belongs to, and refuse to return an invoice belonging to anyone else.
Impact
By chaining the two issues, the researchers took over the account of Test2.: the invoice discloses the mobile number, and the mobile number plus the leaked OTP plus response manipulation is enough to reset the password. The report states that the impact is high and affects both the company and the customer, and that it could be escalated to monetary loss for customers and harm to the nature of the app, since no strict security policies were implemented to keep the app safe.
The report frames this as a possible escalation rather than a demonstrated theft.
The report also lists further severe issues: response manipulation, no proper validation of phone number (which could be exploited to create multiple bot accounts), clear text transmission of credentials, no rate limit, and others. Clear text transmission means data travels without encryption, so anyone able to watch the network can read it, like sending a postcard instead of a sealed letter. A rate limit is a cap on how many attempts are allowed in a given time; without one, an attacker can try thousands of numbers or passwords without being slowed down.
Fix
The report does not describe the individual fixes. It states that as of 1 March 2023 all reported issues had been fixed.
Variants to test
If you ever test an app yourself, these are the same ideas applied more generally. Each one is a small experiment with a clear "this is a problem" signal.
- Change an object identifier in any download or detail endpoint (invoice, receipt, statement, order) to another account's value. A positive result is a valid response containing the other account's data.
- Trigger registration and password reset for an account you control and inspect the full response body and headers for the OTP or a reset token. A positive result is the code appearing in the response.
- Attempt response manipulation on verification and reset flows, for example altering a success flag or status field in the response. A positive result is the server accepting the altered state and completing the action.
- Enumerate identifiers sequentially or by predictable pattern to see whether records of other customers are reachable at scale. A positive result is a steady stream of valid records belonging to other users.
- Check whether credentials are sent over clear text and whether authentication endpoints enforce rate limits. A positive result is credentials visible on the wire or unlimited attempts against the login and OTP endpoints.
Glossary
- API: the part of a company's server that an app talks to; you send a request, it sends back a response.
- Authentication: proving who you are, usually by logging in with a password or a code.
- Authorisation: deciding what a logged-in person is allowed to see or do.
- Bot account: an account created automatically by a script rather than by a real person.
- Clear text transmission: sending data without encryption, so anyone watching the network can read it.
- Credential: the username, password or code you use to log in.
- Endpoint: a specific address on a server that handles one kind of request, such as downloading an invoice.
- Enumerate: to try values one after another (for example invoice numbers) to discover which ones exist.
- EV: electric vehicle.
- GST No.: an Indian tax registration number for a business.
- IDOR (Insecure Direct Object Reference): a bug where the server returns a record based on an identifier you supply, without checking that the record belongs to you.
- Invoice: a receipt listing what was paid and to whom, often including personal details.
- OTP (one-time password): a short code valid once and for a short time, usually sent by SMS to prove you hold a phone number.
- Parameter: a named value attached to a request, telling the server which item or option you want.
- Production: the live version of an app that real customers use.
- Rate limit: a cap on how many requests or attempts are allowed in a period of time.
- Request: the message your app sends to a server asking for something.
- Response: the server's reply to a request, containing the data or a status.
- Response manipulation: altering a value in the server's reply (such as a success flag) so the app accepts a state the server never actually approved.
- Session: the server's record that you are currently logged in, usually kept via a cookie or token sent with each request.
- Token: a piece of data proving you are logged in, sent with requests in place of your password.
- Wallet: a stored money balance inside an app, topped up in advance and spent later.