Skip to content
IDOR Write-up Beginner

#BugBounty — ” Your details are saved into my account”-User info disclosure Vulnerability in Practo (India’s biggest healthcare app)

An IDOR vulnerability in the 'Send SMS' feature allowed changing a patient or staff ID to send SMS to other users and, after refreshing the dashboard, the targeted user's details were saved into the attacker's account. This exposed personal information of arbitrary users.

Avinash Jain Follow

Published on medium.com

#### Avinash Jain (@logicbomb1)

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

Context

Practo is described in the report as India's biggest healthcare app. The target of this research was a subdomain of it, ray.practo.com, which runs Practo Ray, a practice management product for doctors and clinics. As the report summarises it:

Practo Ray is a doctor software which simplifies practice management for doctors and clinics. Using Practo Ray software, doctors can schedule appointments, access digital health records, generate printed bills and prescriptions and access clinic and patients analytics.

The feature in scope is the Send SMS function. A logged-in user can send an SMS to users, patients or staff they have added, and has to supply the contact number of the recipient. The request that this feature issues carries an identifier for the patient or staff member, and that identifier is where the problem sits.

Setup

The only tooling the report mentions is subdomain enumeration, done with Sublist3r (https://github.com/aboul3la/Sublist3r), which is how ray.practo.com was found. The researcher worked from an ordinary account on that application, with at least one contact of their own added so that the Send SMS function could be exercised. No versions, roles beyond that, or other preconditions are given.

Finding it

After enumerating subdomains and landing on ray.practo.com, the researcher used the Send SMS functionality against a newly added contact number. The resulting HTTP request contained an identifier for the patient or staff member, and that identifier looked like a direct object reference. The report describes the reaction plainly: "I smelled an IDOR here".

Image for post
Send SMS functionality From the original on medium.com

The screenshot shows the Send SMS form, where the concerned contact number is supplied.

Exploitation

Step 1: capture the Send SMS request

Sending an SMS to the newly added contact number triggered the following request. The report shows it as an image rather than as text, so the exact request line, headers and parameter names are not reproduced in the write-up.

The screenshot shows the Send SMS HTTP request. What the report states about it is that it carries the patient id or staff id, and that those ids are incremental.

Step 2: change the identifier

With the identifier identified as incremental, the researcher changed the patient id or staff id in the request. The effect was that the SMS went to the mobile number linked to the other user. The report is explicit that this alone did not disclose anything: the HTTP response gave nothing back, and no user details could be seen in it.

Image for post
Send SMS HTTP Response From the original on medium.com

The screenshot shows the HTTP response to the manipulated Send SMS request, which the researcher describes as putting everything in vain because it contained no user details.

Step 3: refresh the dashboard

The disclosure did not happen in the response to the manipulated request. It happened as a side effect. Returning to the account dashboard and refreshing it showed that the other user had been added to the researcher's account.

Image for post
Other user information added to my account From the original on medium.com

The screenshot shows another user's information appearing in the researcher's own account after the parameter manipulation.

Step 4: enumerate further

The researcher then brute-forced the vulnerable parameter further, and other users' details were added in the same way. The report presents a sample of those records.

The screenshot shows details of some of the other users obtained through the IDOR.

The report's own summary of the outcome is that the researcher was able to access and save anyone's details into their account.

Root cause

The Send SMS request carried a patient or staff identifier that could be changed to another user's value. Because the identifiers are incremental, any value in the sequence could be supplied. After the manipulated request, the referenced user appeared in the researcher's own dashboard, where the details could be read. The report does not describe the server-side code, so the precise location of the missing check is not stated;

Impact

An authenticated user of Practo Ray could take the identifier of a patient or staff member belonging to another account, submit it through the Send SMS function, and have that person's details saved into their own account, where they could then be read. Two consequences are shown in the report: an SMS could be sent to the linked mobile number of a user the attacker does not own, and the linked user's information became visible in the attacker's dashboard. The researcher brute-forced the parameter further and details of some other users were added in the same way. The report does not quantify how many records were affected or which categories of data were exposed beyond calling it user information.

Fix

The report records that the bug was reported to the company on 14-Dec-2017 and marked fixed the same day, with a re-test confirming the fix on 20-Dec-2017, and a reward on 27-Dec-2017. It does not describe what the fix changed. The check that would address the issue is server-side authorisation of the referenced patient or staff id against the authenticated user's own records before the SMS is sent or the record is linked to the account.

Variants to test

  1. Incremental identifiers in write endpoints. Look for features that attach, invite, share or send to a record by id, and walk the id sequence. A positive result is another user's record appearing in your own account after a refresh, even when the response body is empty.
  2. Side effects rather than responses. When a manipulated request returns nothing useful, re-read your own dashboard, lists and notifications. A positive result is data you did not own showing up in a view that is rendered from your account's stored state.
  3. SMS, email and notification triggers. Any feature that contacts a stored phone number or address by record id is worth the same test. A positive result is a message delivered to a number or address you do not control, or the recipient's details becoming visible to you.
  4. Identifier types. Try both patient and staff style identifiers where a product has more than one kind of linked person, since the report found the issue through the patient id or staff id parameter. A positive result is the same cross-account linkage through either parameter.

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

What happened, in plain words

A security researcher found a way to make other people's personal details appear inside his own account on a healthcare website used by doctors in India. The site was Practo, described in the report as India's biggest healthcare app. The part he tested was a subdomain called ray.practo.com, which runs a product called Practo Ray.

A subdomain is a smaller site that sits under a main domain name. If the main site is practo.com, then ray.practo.com is a separate application that the company runs on its own address. Think of a large building with a main entrance and a side door with its own name plate: same organisation, different door, and often different software behind it.

Practo Ray is software for doctors and clinics. The report quotes a short description of it:

Practo Ray is a doctor software which simplifies practice management for doctors and clinics. Using Practo Ray software, doctors can schedule appointments, access digital health records, generate printed bills and prescriptions and access clinic and patients analytics.

In everyday terms, it is the back office of a clinic: appointments, health records, bills, prescriptions and statistics about patients. All of that is sensitive, which is why a flaw that moves one clinic's data into another person's account matters.

The feature involved is Send SMS. A logged-in user can send a text message to a patient, a staff member or another user they have added, and has to type in the contact number of the person who should receive it. Behind the scenes, the request that the browser sends for this feature also carries an identifier for the patient or staff member. An identifier is simply a label the software uses to tell records apart, usually a number. That identifier is where the problem sat.

The class of bug is called IDOR, short for Insecure Direct Object Reference. The idea is easy to picture. Imagine a cloakroom where you hand in your coat and get ticket number 41. If the attendant hands back whatever coat matches the number on your ticket without checking that the ticket is yours, you can write 42 on a scrap of paper and walk away with someone else's coat. In software, the ticket number is the identifier in the request, and the attendant is the server. When the server looks up the record by the number it was given but never checks that the record belongs to the person asking, that is an IDOR.

Two more terms are worth having before we start. A server is the computer that holds the data and answers requests; your browser is the client, the one asking. An API is the way the browser and the server talk to each other: the browser sends a structured request, the server sends back a structured answer, and the page you see is built from that answer. You never see most of this traffic, but it is there every time you click a button.

The researcher's summary of the outcome is that he was able to access and save anyone's details into his account. The rest of this article walks through how, step by step, in the order it happened.

Setup

The report mentions only one tool for the preparation stage: subdomain enumeration, done with a program called Sublist3r, available at https://github.com/aboul3la/Sublist3r. Subdomain enumeration means finding the smaller named sites that belong to an organisation. Companies often run dozens of them, and some are less polished than the main site, which makes them interesting to test.

Sublist3r works by taking a domain name and checking a long list of common subdomain names against it, and by collecting names from public sources. The researcher ran it and found ray.practo.com. That is how the target was chosen: not by guessing, but by looking at what the organisation actually exposes.

Beyond that, the setup was ordinary. The researcher had a normal account on the application and had added at least one contact of his own, so that the Send SMS function could be used at all. The report gives no software versions, no special roles and no other preconditions.

Finding it

After the enumeration, the researcher opened the Send SMS feature and used it against a newly added contact number. The form asks for the concerned contact number, meaning the phone number of the person who should receive the message.

Image for post
Send SMS functionality From the original on medium.com

The screenshot shows the Send SMS form, where that contact number is supplied.

When the message was sent, the browser fired off an HTTP request. HTTP is the language browsers and servers use to exchange requests and responses: the browser says what it wants, the server answers with a status and some content. The request for this feature contained an identifier for the patient or staff member, and that identifier looked like a direct object reference, the kind that can be swapped for another number. The report describes the reaction plainly: "I smelled an IDOR here".

The screenshot shows the Send SMS HTTP request. What the report tells us about it is that it carries the patient id or staff id, and that those ids are incremental. Incremental means the numbers go up one at a time, like 101, 102, 103, so if you know one valid number you can guess the neighbours. The report presents the request as an image rather than as text, so the exact request line, headers and parameter names are not written out in the write-up.

Exploitation

Step 1: capture the Send SMS request

Sending an SMS to the newly added contact number triggered the request shown above. Capturing it matters because you cannot tamper with what you cannot see. Normally the browser builds the request and sends it without showing you the details; a person testing a site needs to look at that traffic, either with the browser's own developer tools or with a proxy, which is a program that sits between the browser and the server and lets you read and edit what passes through.

The point of this step is to find the part of the request that names the record. Here it was the patient id or staff id, and the report notes that these ids are incremental.

Step 2: change the identifier

With an incremental identifier in hand, the researcher changed the patient id or staff id in the request to a different number. The effect was that the SMS went to the mobile number linked to the other user. The SMS went to the mobile number linked to the other user.

This alone did not disclose anything, though. The HTTP response gave nothing back, and no user details could be seen in it. The report is explicit about the disappointment.

Image for post
Send SMS HTTP Response From the original on medium.com

The screenshot shows the HTTP response to the manipulated request, which the researcher describes as putting everything in vain because it contained no user details.

This is a common moment in testing. A request that behaves wrongly but returns an empty or unhelpful answer looks like a dead end. The lesson from this report is that the answer is not always in the response.

Step 3: refresh the dashboard

The disclosure did not happen in the response to the manipulated request. It happened as a side effect. The researcher went back to his account dashboard and refreshed it, and saw that the other user had been added to his account.

A dashboard is the starting page of a logged-in account, built from the data the server has stored for that account. Refreshing it asks the server to render that stored state again. If something changed on the server as a result of the earlier request, the refresh is where you see it.

Image for post
Other user information added to my account From the original on medium.com

The screenshot shows another user's information appearing in the researcher's own account after the parameter manipulation.

So the manipulated request had two effects: an SMS was sent to the linked mobile number, and the referenced user appeared in the researcher's account dashboard. The write, not the read, is what turned the missing check into a disclosure.

Step 4: enumerate further

The researcher then brute-forced the vulnerable parameter further. Brute-forcing here means trying many values in sequence rather than a single guess, which is practical precisely because the identifiers are incremental. Other users' details were added in the same way, and the report presents a sample of those records.

The screenshot shows details of some of the other users obtained through the IDOR.

The report's own summary of the outcome is that the researcher was able to access and save anyone's details into his account.

Root cause

The Send SMS request carried a patient or staff identifier that could be changed to another user's value. Authenticated means the server knows who is asking, because the person is logged in. That is not the same as authorised, which means the server has checked that this particular person is allowed to touch this particular record. The bug is the gap between the two.

Because the identifiers are incremental, any value in the sequence could be supplied. After the manipulated request, the referenced user appeared in the researcher's own dashboard, where the details could be read. Persisted means it was saved on the server, not just shown once.

The report does not describe the server-side code, so the precise location of the missing check is not stated.

Impact

An authenticated user of Practo Ray could take the identifier of a patient or staff member belonging to another account, submit it through the Send SMS function, and have that person's details saved into their own account, where they could then be read.

Two consequences are shown in the report. First, an SMS could be sent to the linked mobile number of a user the attacker does not own, which is a message the attacker controls going to a phone number they do not control. Second, the linked user's information became visible in the attacker's dashboard.

The researcher brute-forced the parameter further and details of some other users were added in the same way. The report does not quantify how many records were affected, and beyond calling it user information it does not list which categories of data were exposed.

Fix

The report records the timeline:

Date Event
14-Dec-2017 Bug reported to the concerned company
14-Dec-2017 Bug marked fixed
20-Dec-2017 Re-tested and confirmed the fix
27-Dec-2017 Rewarded by the company

The report does not describe what the fix changed. The check that would address the issue is server-side authorisation of the referenced patient or staff id against the authenticated user's own records, before the SMS is sent or the record is linked to the account. In the cloakroom comparison, the attendant checks that the ticket matches the coat before handing it over, every time, no matter how convincing the ticket looks.

Variants to test

These are the same patterns applied to other features, useful once you understand the one above.

  1. Incremental identifiers in write endpoints. Look for features that attach, invite, share or send to a record by id, and walk the id sequence. A positive result is another user's record appearing in your own account after a refresh, even when the response body is empty.
  2. Side effects rather than responses. When a manipulated request returns nothing useful, re-read your own dashboard, lists and notifications. A positive result is data you did not own showing up in a view that is rendered from your account's stored state.
  3. SMS, email and notification triggers. Any feature that contacts a stored phone number or address by record id is worth the same test. A positive result is a message delivered to a number or address you do not control, or the recipient's details becoming visible to you.
  4. Identifier types. Try both patient and staff style identifiers where a product has more than one kind of linked person, since the report found the issue through the patient id or staff id parameter. A positive result is the same cross-account linkage through either parameter.

Glossary

  • API: the structured way a browser and a server exchange requests and answers; the page you see is built from those answers.
  • Authenticated: the server knows who is asking because the person is logged in.
  • Authorised: the server has checked that this particular person is allowed to touch this particular record.
  • Brute-forcing: trying many values in sequence instead of a single guess.
  • Client: the program asking for data, usually your browser.
  • Dashboard: the starting page of a logged-in account, built from the data the server has stored for that account.
  • Developer tools: the built-in panel in a browser that lets you inspect the requests a page makes.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • HTTP request: the message the browser sends to ask the server to do something.
  • HTTP response: the message the server sends back, with a status and some content.
  • Identifier (id): a label, usually a number, that the software uses to tell records apart.
  • IDOR (Insecure Direct Object Reference): a bug where the server looks up a record by an identifier from the request without checking that the record belongs to the person asking.
  • Incremental: numbers that go up one at a time, so neighbours of a known value can be guessed.
  • Parameter: a named value inside a request, such as an id or a phone number.
  • Persisted: saved on the server, not just shown once.
  • Proxy: a program that sits between the browser and the server and lets you read and edit the traffic.
  • Server: the computer that holds the data and answers requests.
  • Subdomain: a smaller named site under a main domain, such as ray.practo.com under practo.com.
  • Subdomain enumeration: finding the subdomains an organisation runs, often with a tool such as Sublist3r.
  • Write operation: a request that changes stored data, as opposed to one that only reads it.

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.