Skip to content
IDOR Write-up Beginner

#BugBounty — How I was able to read chat of users in an Online travel portal

An IDOR vulnerability in an online travel portal's chat feature allowed an attacker to read other users' chat histories by manipulating customer and chat IDs. The attacker found customer IDs in blog post URLs and brute-forced incremental chat IDs to access conversations.

Avinash Jain Follow

Published on medium.com

{{media:0}}

Avinash Jain (@logicbomb_1), 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. 4 min read.

Context

An Indian online travel company ran a customer support chat on its website. Customers used it to ask the support team about bookings, payments, refunds and similar matters, so the conversations held there could contain sensitive personal data. The researcher, Avinash Jain (@logicbomb_1), was browsing the site during routine bug hunting when he found the chat feature and started asking himself how he could read other users' conversations.

Setup

The report does not describe any accounts, roles or tool versions beyond the use of Burp to brute force a value. The report describes the chat feature, the login and profile pages, and the public traveller's blog section as the places visited.

Finding it

Triggering the online chat functionality fired an HTTP request, and its response contained the conversation messages exchanged during the chat. The request is shown in the report as an image rather than as text:

Image for post
Chat Request From the original on medium.com

Chat Request

Image for post
Chat Response From the original on medium.com

Chat Response

The values marked in yellow in the chat request picture were the ones to play with. Two of them stood out. The first, hari013903158, was the customer id. The second, FL-132756, turned out to be the chat id, which on further analysis was found to be incremental. An incremental chat id next to a customer id supplied in the request is the shape of an IDOR: changing the values returned another user's chat.

The remaining hurdle was finding valid customer ids. In this case the customer id was a 13 character long alphanumeric id, so guessing was not practical. The login page and the profile section offered nothing useful. The blog section did: the traveller's blog page, where people share their travel stories, exposed the user id in the URL of each published blog. Opening one blog was enough to read a user id straight from the address.

Exploitation

Step 1: Capture the chat request

Open the online chat and observe the request the page sends, together with the response carrying the conversation messages. The two values of interest are the customer id (hari013903158 in the example) and the chat id (FL-132756).

Step 2: Harvest a valid customer id

Browse the traveller's blog section and open a blog post. The author's user id appears in the URL of the post, so a valid customer id can be collected without any authentication or guessing.

Step 3: Substitute and brute force

Copy the harvested user id, replace the customer id in the chat request with it, and brute force the chat id with Burp. The first attempt returned nothing, most likely because that user had never had an online chat with the support team. The researcher then opened 10 to 20 more blogs, repeated the process, and got a hit with one particular user id:

Image for post
User’s Chat History From the original on medium.com

User's Chat History

With that request and response, the entire chat history of the user was accessible.

Root cause

The chat lookup appears to have keyed on the customer id and chat id supplied in the request. Because the chat id was incremental, the only unknown left was the customer id, and the blog section leaked those in URLs. The customer id was long and alphanumeric, so guessing was impractical, but the blog section exposed valid values and the chat id was incremental. The report does not describe the server-side code, so the exact check that was missing is inferred rather than shown.

Impact

An attacker who could obtain a valid customer id could read that user's complete chat history with the support team. Since the chat covers bookings, payments and refunds, the exposed conversations can contain sensitive personal data. The attack required a valid customer id, which the blog section supplied. The report does not quantify how many users were affected.

Fix

The report records the timeline rather than the code change: the bug was reported to the company on 09-Nov-2017, marked fixed on 29-Nov-2017, and the fix was re-tested and confirmed on 30-Nov-2017. A reward and hall of fame followed on 21-Dec-2017. The natural remedy is to authorise each chat request against the session's own customer id and to stop exposing sequential chat ids, but that is a recommendation, not something the report confirms.

Variants to test

  1. Swap the customer id in a chat or messaging endpoint for one harvested from a public profile, blog or review page. A positive result is another user's conversation in the response.
  2. Walk an incremental chat id while holding a valid customer id fixed. A positive result is a sequence of distinct conversations rather than an error.
  3. Check whether the customer id is accepted from a request parameter, header or cookie rather than derived from the session. A positive result is a response that changes when only that value changes.
  4. Look for other features that expose user ids in URLs, such as public profiles, comments or shared itineraries, and use them as an id oracle for the same endpoint.
  5. Test the same pattern on support tickets, order histories and refund status pages, where the same customer id and an incremental record id are likely to appear together.

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

What happened, in plain words

An Indian online travel company ran a customer support chat on its website. Customers used it to ask the support team about bookings, payments, refunds and similar matters, so the conversations held there could contain sensitive personal data. The researcher, Avinash Jain (@logicbomb_1), was browsing the site during routine bug hunting when he found the chat feature and started asking himself how he could read other users' conversations.

Avinash Jain (@logicbomb_1)
Avinash Jain (@logicbomb_1) From the original on medium.com

To follow this, you only need to know a few ideas. A website is a program running on a computer somewhere else, and your browser talks to it by sending small messages called requests. The server answers each request with a response. When you click a button on a page, your browser usually sends a request in the background and puts the answer on the screen without reloading the whole page. That back-and-forth is often called an API (application programming interface): a set of addresses the website uses to fetch and change data. Think of it like a restaurant: the menu is the list of addresses, the waiter carries your order (the request) to the kitchen (the server), and the kitchen sends back a plate (the response).

A cookie or token is a small piece of data your browser stores and sends back with each request so the server can recognise you, the way a wristband at an event tells staff you already paid. An identifier (or id) is a name for a thing in a database: a number or string that uniquely points to one user, one order, one conversation. An IDOR (Insecure Direct Object Reference) is a vulnerability where the server accepts an id from the browser and hands back whatever that id points to, without checking that you are allowed to see it. In the restaurant comparison: you ask for table 12's bill, and the waiter gives it to you without checking that table 12 is yours.

Setup

The report does not describe any accounts, roles or tool versions beyond the use of Burp to brute force a value. The report describes the chat feature, the login and profile pages, and the public traveller's blog section as the places visited.

Finding it

Triggering the online chat functionality fired an HTTP request, and its response contained the conversation messages exchanged during the chat. The request is shown in the report as an image rather than as text:

Image for post
Chat Request From the original on medium.com

Chat Request

Image for post
Chat Response From the original on medium.com

Chat Response

The values marked in yellow in the chat request picture were the ones to play with. Two of them stood out. The first, hari013903158, was the customer id. The second, FL-132756, turned out to be the chat id, which on further analysis was found to be incremental. An incremental chat id next to a customer id supplied in the request is the shape of an IDOR: changing the values returned another user's chat.

Why does "incremental" matter? Many databases hand out ids in order: 1, 2, 3, and so on. If you can see one id, you can guess the next ones. It is like hotel room numbers: once you know room 101 exists, you know 102 and 103 probably do too. A long random id is hard to guess; a short sequential one is easy to walk through.

The remaining hurdle was finding valid customer ids. In this case the customer id was a 13 character long alphanumeric id, so guessing was not practical. The login page and the profile section offered nothing useful. The blog section did: the traveller's blog page, where people share their travel stories, exposed the user id in the URL of each published blog. Opening one blog was enough to read a user id straight from the address.

A URL is the address in your browser's address bar. When a site puts an id in the URL, anyone who can see the page can read that id. That is what made the blog section useful: it was a public page that quietly published valid customer ids.

Exploitation

Step 1: Capture the chat request

Open the online chat and observe the request the page sends, together with the response carrying the conversation messages. The two values of interest are the customer id (hari013903158 in the example) and the chat id (FL-132756).

Why do this? You cannot change a request you have not seen. The goal is to find which parts of the request the server uses to decide which conversation to return. Those parts are the levers you will pull later.

Step 2: Harvest a valid customer id

Browse the traveller's blog section and open a blog post. The author's user id appears in the URL of the post, so a valid customer id can be collected without any authentication or guessing.

Why do this? The chat request needs a real customer id to return anything. Guessing a 13 character alphanumeric id is hopeless, but the blog section hands out real ones for free. This is a common pattern: one public feature leaks the ids that another feature trusts.

Step 3: Substitute and brute force

Copy the harvested user id, replace the customer id in the chat request with it, and brute force the chat id with Burp. The first attempt returned nothing, most likely because that user had never had an online chat with the support team. The researcher then opened 10 to 20 more blogs, repeated the process, and got a hit with one particular user id:

Image for post
User’s Chat History From the original on medium.com

User's Chat History

With that request and response, the entire chat history of the user was accessible.

What is brute forcing? It means trying many values in a row, automatically, instead of typing them by hand. Burp is a tool that sits between your browser and the website, lets you see and edit requests, and can send the same request many times with one value changed each time. Think of it as a machine that fills in a form over and over, changing one field each round. Here the field being changed was the chat id, because it was incremental and therefore predictable.

Why did the first attempt return nothing? A valid customer id does not guarantee a conversation exists. If that user never chatted with support, there is nothing to return. That is why the researcher tried more blogs: each one supplied another real customer id, and eventually one of those users had a chat history.

Root cause

The chat lookup appears to have keyed on the customer id and chat id supplied in the request. Because the chat id was incremental, the only unknown left was the customer id, and the blog section leaked those in URLs. The customer id was long and alphanumeric, so guessing was impractical, but the blog section exposed valid values and the chat id was incremental. The report does not describe the server-side code, so the exact check that was missing is inferred rather than shown.

In plain words: the server trusted the browser to say whose chat it wanted. A safe design would look up the logged-in user's own customer id from the session (the wristband) and ignore any customer id sent in the request. Entropy here just means unpredictability: a long random id has a lot of it, a sequence like 1, 2, 3 has almost none.

Impact

An attacker who could obtain a valid customer id could read that user's complete chat history with the support team. Since the chat covers bookings, payments and refunds, the exposed conversations can contain sensitive personal data. The attack required a valid customer id, which the blog section supplied. The report does not quantify how many users were affected.

Fix

The report records the timeline rather than the code change: the bug was reported to the company on 09-Nov-2017, marked fixed on 29-Nov-2017, and the fix was re-tested and confirmed on 30-Nov-2017. A reward and hall of fame followed on 21-Dec-2017. The natural remedy is to authorise each chat request against the session's own customer id and to stop exposing sequential chat ids, but that is a recommendation, not something the report confirms.

Variants to test

  1. Swap the customer id in a chat or messaging endpoint for one harvested from a public profile, blog or review page. A positive result is another user's conversation in the response.
  2. Walk an incremental chat id while holding a valid customer id fixed. A positive result is a sequence of distinct conversations rather than an error.
  3. Check whether the customer id is accepted from a request parameter, header or cookie rather than derived from the session. A positive result is a response that changes when only that value changes.
  4. Look for other features that expose user ids in URLs, such as public profiles, comments or shared itineraries, and use them as an id oracle for the same endpoint.
  5. Test the same pattern on support tickets, order histories and refund status pages, where the same customer id and an incremental record id are likely to appear together.

Glossary

  • API: a set of addresses a website uses behind the scenes to fetch and change data; the menu of requests the browser can send.
  • Brute force: trying many possible values automatically until one works, instead of guessing by hand.
  • Burp: a tool that sits between your browser and a website so you can inspect, edit and repeat requests.
  • Cookie: a small piece of data your browser stores and sends back with requests so the server can recognise you.
  • Customer id: the identifier the site uses to point at one customer's account.
  • Chat id: the identifier the site uses to point at one support conversation.
  • Endpoint: one specific address on a server that accepts requests, such as the chat lookup.
  • Entropy: unpredictability; how hard a value is to guess.
  • Header: an extra line of information attached to a request or response, such as what kind of data is being sent.
  • HTTP request: the message your browser sends to a server asking for something.
  • HTTP response: the message the server sends back, containing the answer.
  • IDOR (Insecure Direct Object Reference): a vulnerability where the server accepts an id from the browser and returns the matching object without checking that you are allowed to see it.
  • Identifier (id): a value that uniquely names one record in a database, such as a user or a conversation.
  • Incremental id: an id that increases in order (1, 2, 3), making the next values easy to predict.
  • Parameter: a named value sent with a request, such as a customer id or chat id.
  • Session: the server's memory of who you are across several requests, usually tied to a cookie or token.
  • Token: a piece of data, similar to a cookie, that proves who you are to the server.
  • URL: the address of a page or resource, shown in your browser's address bar.

More by Avinash Jain

View all

29 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.