<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahil Bhansali on Medium]]></title>
        <description><![CDATA[Stories by Rahil Bhansali on Medium]]></description>
        <link>https://medium.com/@rahilbhansali?source=rss-ea158d9cf610------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qsqlTVPoYhaB3SsE.</url>
            <title>Stories by Rahil Bhansali on Medium</title>
            <link>https://medium.com/@rahilbhansali?source=rss-ea158d9cf610------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:53:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahilbhansali/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[You Flew — I Knew]]></title>
            <link>https://rahilbhansali.medium.com/you-flew-i-knew-0d5c04d0b6b4?source=rss-ea158d9cf610------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d5c04d0b6b4</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Rahil Bhansali]]></dc:creator>
            <pubDate>Wed, 21 Aug 2024 04:49:49 GMT</pubDate>
            <atom:updated>2024-08-21T05:23:20.641Z</atom:updated>
            <content:encoded><![CDATA[<h3>You Flew — I Knew</h3><p>Imagine the below scenario:</p><p>You took a flight last week. Suddenly, you received a call — ‘Dear Rahil, did you fly from Singapore to Bangalore last week with XYZ on Vistara? You seemed to have forgotten something on the aircraft. Please share your email so we can send you a link to upload your KYC documents and courier you.’</p><p>You share your documents and soon you are the target of spam calls / phishing scams.</p><p><strong><em>Discovery by:</em></strong> Rahil Bhansali</p><p><strong><em>Disclaimer</em></strong><em>: What you’ll read below and in the series of blog posts are simple but massive security vulnerabilities that exist in some of the most popular brands. My approach in each case has always been (&amp; will continue to be) to understand the extent of the loophole, exhaust every connect to try and bring it to the company’s notice, have them fix it and then write about it so consumers and companies alike can focus on improving their defences in protecting consumer data, privacy and security. In cases where I’ve not been able to reach the company, the post serves as a last ditch effort to alert the company so that they can fix the issue. Please do note — I have no particular affinity to any brand of companies, and some of the brands mentioned in the series — I am a subscriber of / customer of and admire the leadership and what they do for my country &amp; world as well.</em></p><p><strong>Background: </strong>I happened to be on Vistara’s website (<a href="https://www.airvistara.com/">https://www.airvistara.com/</a>) to check if I had earned miles for my flight from the summer. Upon discovering that I hadn’t, I tried to find the claims form to submit my claim. I entered my ticket number and clicked submit and had my miles credited.</p><p>However, I realised the claim process was so simple that the product manager in me wondered how they solved issues like mapping the logged in user with the ticket. I went ahead and changed the last two digits of the ticket number and realised I could suddenly see flight details of a flight from AMD (ahemdabad) to BOM (mumbai) — a flight I had NOT taken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ha0X31_byX2BvJNKGPcvoA.png" /></figure><p>Here’s when I suddenly found my 1st red flag. Inquisitive, I quickly found out the URL that was being hit for fetching claim details and looked at the same in postman. I realised I was getting the passenger’s first name and last name — 2nd red flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nve7OrDRLeb9caT_J7GeFA.png" /></figure><p>I wanted to test the extent of this — was it possible for someone to theoretically build a chronological flight manifest? To my surprise, a simple script would allow me to hit the URL numerous times simultaneously with sequential ticket numbers (3rd red flag) and download flight details and names of passengers. Putting that sample set in something as simple as excel, you could build a chronological flight manifest sorted by date and flight number.</p><p><strong>Scale: </strong>While I assume this hasn’t been exploited thus far, I can only imagine the consequences of having access to such specific date, flight and passenger names and its use in running phishing scams.</p><p>Its easy to find public databases or social media handles basis city and people’s names and to then call and mention something so specific, its very possible to have people share other information that you could use to your own benefit.</p><p><strong>Issues &amp; Resolution:</strong></p><ol><li>Auto-Incrementing Ticket IDs — Simple, auto-incremented ticket numbers made it very easy to scan through flight details for recent dates. This would make writing and targeting a script to bulk download very easy. Randomising this would be great.</li><li>Product Flow — Sometimes, in an interest to make things very user friendly, we unrealisingly expose data that should be private. Sure enough, the form was very easy. I was super happy as a consumer to get my claim credited with just a ticket number. However, other airlines have taken a step further by asking for origin, destination and date which makes the process a bit more cumbersome but a lot more secure.</li><li>Bulk Server Calls — API rate limiting is the need of the hour. I’ve seen this in all the discoveries I’ve made so far — most companies haven’t configured this well. I could (theoretically) put a 100 workers simultaneously working on different incremented ticket numbers and access results instantly. Rate Limiting and Third Party Tools like Cloudflare can come in very handy.</li><li>Simpler Feedback Loops — It took me over 1 week to get in touch with someone at Vistara and bring the issue to their notice. Emails to customer care, cold emailing &amp; cold messaging on Linkedin — Vinod Kannan (Vistara’s CEO), didn’t seem to help — I don’t blame them — I could very well come across as someone running a phishing scam too. It took persistence on my part, for something I don’t get paid to do — to bring it to their notice. A last ditched effort to bring the issue up as a post on LinkedIn seemed to help. I received an email from Sharad from the infosec team who quickly understood the issue and got the teams to atleast remove the names from the response. Thank you Sharad &amp; Team Vistara!! I’d highly suggest having dedicated emails for security vulnerabilities. In the world &amp; AI world we are about to enter, I expect this to only increase. Training the customer care teams for the same would help as well.</li><li>Ethical Hacking — Countries &amp; Companies should really encourage, support and use tools like Hackerone (<a href="https://hackerone.com/">https://hackerone.com/</a>) and encourage security enthusiasts to stress test their systems. While an expense, it can save from a serious PR nightmare incase of a major breach.</li></ol><p><strong>Recommendations: </strong>I’d seriously urge engineering teams to read the issues above and take authorisation seriously, prevent use of ids in get api calls, and ensure you have ways to investigate anomalies, security breaches, and even block such bulk scripts proactively. The recommendation in my first post (<a href="https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30"><strong>here</strong></a>) still apply.</p><p>I sincerely hope we all focus on cyber-security and data privacy — it’s going to be one of the most important teams we build out as nations and companies over the course of the upcoming decade — to maintain customer trust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d5c04d0b6b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your medical information = For your eyes only]]></title>
            <link>https://rahilbhansali.medium.com/your-medical-information-for-your-eyes-only-89a18153adce?source=rss-ea158d9cf610------2</link>
            <guid isPermaLink="false">https://medium.com/p/89a18153adce</guid>
            <category><![CDATA[data-privacy]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <dc:creator><![CDATA[Rahil Bhansali]]></dc:creator>
            <pubDate>Tue, 22 Feb 2022 13:23:59 GMT</pubDate>
            <atom:updated>2022-02-22T13:23:59.554Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine you do a medical test at home and someone else gets a real-time feed of your results? No — not the company that’s meant to process your sample, but someone else who just has backdoor access to their data.</p><p>Recently, I made a startling discovery that got me concerned enough to dig deeper and work with the companies to have them resolved.</p><p><strong><em>Discovery by:</em></strong> Rahil Bhansali</p><p><strong><em>Disclaimer</em></strong><em>: What you’ll read below and in the series of blog posts are simple but massive security vulnerabilities that exist in some of the most popular brands. My approach in each case has always been (&amp; will continue to be) to understand the extent of the loophole, exhaust every connect to try and bring it to the company’s notice, have them fix it and then write about it so consumers and companies alike can focus on improving their defences in protecting consumer data, privacy and security. In cases where I’ve not been able to reach the company, the post serves as a last ditch effort to alert the company so that they can fix the issue. Please do note — we have no particular affinity to any brand of companies, and some of the brands mentioned in the series — we are subscribers / customers of and admire the leadership and what they do for our country as well.</em></p><p><strong>Background: </strong>I happened to be a close contact of friends who tested positive for covid-19. My first go-to was to order different brand of rapid antigen kits to check if I was indeed positive as well. After collecting my swab and uploading my result for Coviself by Mylab and Covifind by Meril Lifesciences, the engineer in me decided to dig deeper into the security for both the iOS applications of these companies.</p><p>A preliminary search exposed URLs that were being called upon every time a test result was fetched. Here’s where I thought a vulnerability may exist.</p><p><strong>Scale: </strong>Before I jump into the issues I discovered, It’s important to understand what this means. Theoretically, if I had malicious intent, I could build a database of a lot of private information of citizens in India. These details included Name (full names), Addresses, Phone Numbers, Emails, Passwords (in plain text), Aadhar card details, Passport Numbers, Covid Test Results, Images of the Swab Test Done, etc. This was available on a real-time basis (meaning I could see the tests done in the last minute) until I worked with both the companies to have the issues fixed. This was over 6L Indian citizens data — easily downloadable by anyone.</p><p>With email and passwords — I could probably enter into someone’s email inbox (a lot of people surprisingly use similar passwords), I could send phishing messages with personal details of customers to collect more personal, medical or financial information.</p><p><strong>Issues: </strong>If an issue were to be found, I knew it may be one of open apis. I pinged the apis for Coviself and Covifind to see if I could retrieve my result. And I indeed did. But here’s where things got a little interesting (sadly) and I found simple yet important issues that we should all be aware of as we build our products:</p><ol><li>Simple Identifiers — one of the apps used a patient-id to identify me. That seemed to be the only key you needed to get past results. The other app used a test id to identify my test result.</li><li>Auto-Incrementing IDs — both apps used an auto-increment value for their patient and test id which basically meant that I could just increase my patient or test id by one to see someone else’s result. This would make writing a script to bulk download very easy.</li><li>Authorisation Headers Missing — In one of the apps — there was no authorisation whatsoever. You could access the url directly as an anonymous user and get the result. The other app had implemented oAuth 2.0, but sadly due to a programming error, it was not validating my bearer token against the test result to check if I am indeed the person who did the test.</li><li>Bulk Server Calls — In the same app where authorisation wasn’t in place — nor was there anything (like Cloudflare) to prevent me from hitting their servers and getting results in bulk. I could (theoretically) put a 100 workers simultaneously working on different incremented patient ids to access results instantly. At one point, you could literally see a test done in the last 30 seconds in a random town in India. The other company was behind a cloudflare implementation — but I was still allowed to hit it one api at a time to download results (theoretically) if I wanted.</li><li>Plain-Text Data — Even though there was a lot of private information being saved in the database, this was saved in plain text. With passwords not saved in a hash form or aadhar numbers being plain text, it did not require any sophisticated engineer to even build a customer profile.</li></ol><p><strong>Resolution:</strong> (This may help others who find similar discoveries but don’t know how to reach out to the company concerned).</p><p>This was the most challenging piece of this discovery. Trying to work with the companies to have this fixed was the easy part, reaching out to them was the harder part.</p><p>I tried numerous ways — reached out to the publicly available email addressees on the company websites but while I got a response, it was a rather slow way to get the right people on board.</p><p>I also tried to reach out to ICMR (via phone calls and emails), UIDAI (on twitter) and other ways to reach the company including scanning for responsible people on LinkedIn without much luck.</p><p>At last, I resorted to trying to find the promoters names for these companies and trying my luck at reverse searching the earliest ids to see if they used their own products in the early days. This approach worked and I was able to get in touch with both companies promoters. (A lesson however — people often are taken aback — understandably — and how you position yourself matters).</p><p><strong>Recommendations: </strong>I’d seriously urge engineering teams to read the issues above and take authorisation seriously, prevent use of ids in get api calls, and ensure you have ways to investigate anomalies, security breaches, and even block such bulk scripts proactively. The recommendation in my first post (<a href="https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30"><strong>here</strong></a>) still apply.</p><p>I sincerely hope we all focus on cyber-security and data privacy — it’s going to be one of the most important teams we build out as nations and companies over the course of the upcoming decade — to maintain customer trust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89a18153adce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customer Data is the Customer’s (private) Data — It should not be open for all — Part 2— Croma]]></title>
            <link>https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-2-croma-d342928b259f?source=rss-ea158d9cf610------2</link>
            <guid isPermaLink="false">https://medium.com/p/d342928b259f</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Rahil Bhansali]]></dc:creator>
            <pubDate>Wed, 20 Jan 2021 11:53:37 GMT</pubDate>
            <atom:updated>2021-01-21T07:03:33.531Z</atom:updated>
            <content:encoded><![CDATA[<h3>Customer Data is the Customer’s (private) Data — It should not be open for all — Part 2— Croma</h3><p><strong><em>Discovery by:</em></strong> Rahil Bhansali &amp; Ankit Pandey</p><p><strong><em>Disclaimer</em></strong><em>: What you’ll read below and in the series of blog posts are simple but massive security vulnerabilities that exist in some of the most popular brands. My approach in each case has always been (&amp; will continue to be) to understand the extent of the loophole, exhaust every connect to try and bring it to the company’s notice, have them fix it and then write about it so consumers and companies alike can focus on improving their defences in protecting consumer data, privacy and security. In cases where I’ve not been able to reach the company, the post serves as a last ditch effort to alert the company so that they can fix the issue. Please do note — we have no particular affinity to any brand of companies, and some of the brands mentioned in the series — we are subscribers / customers of and admire the leadership and what they do for our country as well.</em></p><p>This is the second post in a series of posts that detail out security vulnerabilities. The first post can be found <a href="https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30"><strong>here</strong></a>. Some of the information may not be repeated since its detailed in the previous post.</p><p><strong>Part 2: Croma</strong></p><p><strong><em>Summary of Findings:</em> </strong>Croma on <a href="https://www.croma.com/">https://www.croma.com/</a>— inadvertently exposed its customers’ data including:</p><ul><li>Name</li><li>Registered Mobile Number</li><li>Address</li><li>Offline &amp; Online Transaction History for all previous purchases (including but not limited to): invoice #, amount, item name, image, item price, qty purchased, addressed shipped, delivery status, etc.</li></ul><p>The data accessible included names, phone numbers &amp; addresses of celebrities, popular business people, doctors, among others.</p><p><strong><em>Scale: </em></strong>The above data for <strong>ALL </strong>Croma Customers was accessible by any one who knows how to hit an API (any developer to be honest). The data above is accessible for their current and old customers who’ve walked into a store or shopped online.</p><p><strong><em>IMPORTANT: </em></strong>If you are connected to any senior executive to Croma, kindly bring this to their notice so they can fix it immediately. You can also have them contact me.</p><blockquote><strong><em>UPDATE: I have this morning received confirmation and verified that the issue is temporarily fixed. Appreciate the promptness and the candid acknowledgement of the Croma team in resolving the vulnerability discussed. Thank you to everyone who has helped connect with their network to help patch the vulnerability.</em></strong></blockquote><p><strong><em>Possible Malicious Uses of Data: </em></strong>Data acquired from such vulnerabilities could theoretically be used for a lot of different malicious plays — some posing risks to consumer privacy, security while others that could be a business risk to the company itself. Here are some ways:</p><ul><li>Sale / Use of Sensitive Information — Equipped with a large database of Personally Identifiable Information (PII), an attacker could use the data to pretend to be the user across various corporate call centers in India (Croma has a lot of customers across major metros).</li><li>Consumer Targeting by Competitors — Any other portal could use this information to target consumers by finding the highest value consumers or inactive consumers and targeting them (legally or otherwise by writing scrapers).</li><li>Phishing and Credit Card Details — Given the sensitivity of the information, KYC update or Warranty Renewal phishing emails/SMS could be easily devised which would look realistic and sent to the customer. A customer could be taken to a look-alike warranty renewal page and be requested to enter their credit card details there by helping the attacker get even more information on the customer and cause a financial loss. Example of possible phishing campaigns that I could have theoretically run if I had to think of malicious uses:</li></ul><pre>1. Hi {{ name }}, your samsung refrigerator warranty is set to expire. Please click &lt;a href=&quot;www.google.com&quot;&gt;here&lt;/a&gt; to renew to stay protected for another year.</pre><pre>2. Hi {{ name }}, you can still buy apple care for your recently purchased iPhone 12 Pro. Please click &lt;a href=&quot;www.google.com&quot;&gt;here&lt;/a&gt; to purchase it.</pre><pre>3. Hi {{ name }}, your KYC needs to be updated. Is this still a valid contact number: {{ mobile number }} and address: {{ address}}? Please click &lt;a href=&quot;www.google.com&quot;&gt;here&lt;/a&gt; to update.</pre><p><strong><em>Backstory:</em></strong> On December 28/29th, I found vulnerabilities in Tatasky (detailed <a href="https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30"><strong>here</strong></a>). Given the scale of the discovery, I spent some more time in the following days trying to look at Starbucks, Croma, Taj Hotels and other Tata Group entities to check if they used similar levels of programming patterns. To my surprise (rather sad) — Croma used a similar weak level of security for a critical data interface that allowed any attacker to theoretically get all the data detailed above.</p><p><strong><em>Discovery (Technical Explanation):</em></strong> With my tech capabilities, I was able to see under the hood and realised that an API (what gets the data from a database) being called was open and even though it is behind authentication — a basic mistake exposed the entire customer base. (Won’t be sharing the API since its still not fixed due to inability to contact the company even via customer care — detailed in the section below — but I’m hoping its fixed soon).</p><p>After finishing the work required to get the Tatasky vulnerability detailed, on Jan 1st, I wrote a script to start accessing the Croma API to understand the extent of the vulnerability.</p><p>When I saw the API structure, even though the header accepted an access token (which is a form of authenticating which user is accessing the data), the developer who wrote this api decided to ignore such a token and chose to pass the mobile number as a parameter to the API. What that (assuming unknowingly — since it’s an amateur developer mistake) did was that I could now pass any mobile number without logging in as the customer and access the customer’s data.</p><p><strong><em>Replicating at Scale (Technical Explanation): </em></strong>In under 2 hours, I was able to write a simple script that would get this information for any mobile number in a consumable format.</p><p>This was important so that I could bring the extent of the vulnerability to the Croma team’s notice without much back and forth (this after-all was an probono discovery).</p><p>Now the question was — can you get this data at scale for the entire customer base without having to input one mobile number at a time? After all, a sophisticated attacker would have to do that to really make use of the information.</p><p>To solve the problem of which mobile number to pass, we used a <a href="https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India"><strong>wikipedia article</strong></a> to understand mobile number formats in India. We also used the oldest series like 9820, 9821, etc. from Vodafone and in the Mumbai circle so that we could quickly test our script out. The assumption was, if we take any 4 digit series and sequentially went through the last 6 digits (000000 to 999999), we’d have a million hits on the open APIs and be able to pull data for whichever number returned a match.</p><p>But to do this at scale so that the process would not take time, my dear friend and ex-colleague, <strong>Ankit Pandey’s </strong>help with the Tatasky script came in handy. I could now run the process on multiple threads and write it to a CSV. With that, in another hour or two, we now had a script that we could theoretically run for all the mobile numbers in India and see if the person was a Croma customer and get the users order history.</p><p>We then tried this with a few 4 digit series just to check if our script was working and our assumption was correct.</p><p>To our surprise (rather sad it actually worked) — we were able to pull data for random mobile numbers. Additionally, without any API rate limiting, you could keep hitting the APIs (infinite times) in a few hours and it would return data. With that understanding, it was time we reached out to Croma so that this could be fixed.</p><p><em>Note: We have not pulled the entire database because we have no use of it, just tested whether it was technically possible. My intention is and never will be to trespass, just understand what someone with malicious intention can possibly do. I do not understand the legality of it and my intent has and will always be to have the issue patched by the company!</em></p><p><strong><em>Company Interaction &amp; Fix: </em></strong>At the time of this writing, the issue still exists.</p><p>I have tried various ways to reach the company between December 30/31st, 2020 and January 20th, 2020 (until the time of this writing).</p><p>My first obvious choice was to find out company leadership names and connect with them on LinkedIn. I have tried connecting with the CEO, CMO &amp; other senior executives to no success. Don’t blame them — no reason to accept my invite on LinkedIn — however — I did send a note explaining I’ve found a major vulnerability.</p><p>I’ve also tried contacting and finding various ways to contact the leadership at Tatasons, including calling their landline of a corporate office (but was unanswered assuming because of Covid-19).</p><p>I’ve also tried contacting security teams and reached my network to see if someone knew anyone at Croma — to no avail. I’ve tried calling Croma stores near me — but since they’ve switched to a centralised call center number, that doesn’t help either.</p><p>Another effort has been to post on Croma’s page on LinkedIn with my findings (screenshot below). Basis their message, I dropped an email to customer care — who didn’t seem to understand the severity and has so far not escalated and help resolve the vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*hR2fknWaBoYQ4fplW_gzaQ.jpeg" /></figure><p><strong>IMPORTANT:</strong> This blog post is a last ditch effort to not only spread awareness to customers and other companies on the severity of cyber-security and privacy, but also hoping it gets the traction required to reach the right people at Croma who’ll get the issue fixed. As I mentioned — this is a probono finding and a lot of effort and time has been invested by us in bringing awareness to all the stakeholders.</p><blockquote><strong><em>UPDATE: I have this morning received confirmation and verified that the issue is temporarily fixed. Appreciate the promptness and the candid acknowledgement of the Croma team in resolving the vulnerability discussed. Thank you to everyone who has helped connect with their network to help patch the vulnerability.</em></strong></blockquote><p><strong><em>Recommendations for Interaction with Security Researchers / Developers: </em></strong>Unfortunately, we’ve not heard back from the company as discussed above. As developers ourselves, we understand that issues exist in any tech product — but we do hope issues when discovered can be reported easily. A few suggestions for companies:</p><ol><li>Do publish on your website a non customer-care email that can be used to report such issues / train customer-care to escalate these. Train customer care to understand and escalate such issues.</li></ol><p>You can check other recommendations in <a href="https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30"><strong>Post 1</strong></a><strong>.</strong></p><p><strong><em>Recommendations for Developers &amp; General Basic API Security Tips (please research further and ensure best-in-class security): </em></strong>Below are some recommendations for ensuring security for your digital products:</p><ol><li>You can check recommendations in <a href="https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30"><strong>Post 1</strong></a><strong>.</strong></li><li>One other learning from this discovery — maybe its time companies think of limiting order history data available easily to a few months instead of it being available since first purchase. Archive some order history in cold storage after crunching data to understand how much is relevant.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d342928b259f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customer Data is the Customer’s (private) Data — It should not be open for all — Part 1 — Tatasky]]></title>
            <link>https://rahilbhansali.medium.com/customer-data-is-the-customers-private-data-it-should-not-be-open-for-all-part-1-tatasky-d9b793350e30?source=rss-ea158d9cf610------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9b793350e30</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Rahil Bhansali]]></dc:creator>
            <pubDate>Wed, 20 Jan 2021 10:51:01 GMT</pubDate>
            <atom:updated>2021-01-20T16:53:52.456Z</atom:updated>
            <content:encoded><![CDATA[<h3>Customer Data is the Customer’s (private) Data — It should not be open for all — Part 1 — Tatasky</h3><p><strong><em>Discovery by:</em></strong> Rahil Bhansali &amp; Ankit Pandey</p><p><strong><em>Disclaimer</em></strong><em>: What you’ll read below and in the series of blog posts are simple but massive security vulnerabilities that exist in some of the most popular brands. My approach in each case has always been (&amp; will continue to be) to understand the extent of the loophole, exhaust every connect to try and bring it to the company’s notice, have them fix it and then write about it so consumers and companies alike can focus on improving their defences in protecting consumer data, privacy and security. In cases where I’ve not been able to reach the company, the post serves as a last ditch effort to alert the company so that they can fix the issue. Please do note — we have no particular affinity to any brand of companies, and some of the brands mentioned in the series — we are subscribers / customers of and admire the leadership and what they do for our country as well.</em></p><p><strong>Part 1: Tatasky</strong></p><p><strong><em>Summary of Finding:</em> </strong>Tatasky on <a href="https://www.tatasky.com/my-account">https://www.tatasky.com/</a>(thanks to basic coding mistakes) inadvertently exposed its customers’ data including:</p><ul><li>Name</li><li>Gender</li><li>DOB</li><li>Email</li><li>Registered Mobile Number</li><li>Alternate Phone Number</li><li>Address</li><li>Subscriber ID</li><li>Subscription Balance</li><li>Subscription Start Date</li><li>Subscription End Date</li><li>Transaction History since first subscription</li><li>Service Requests since first subscriber complaint</li><li># of Boxes — active &amp; inactive</li></ul><p>The data accessible included names, phone numbers &amp; addresses of celebrities, popular business people, doctors, among others.</p><p><strong><em>Scale: </em></strong>The above data for <a href="https://www.tatasky.com/dth/press-releases/tata-sky-continues-extend-lead-dth-sector#:~:text=Tata%20Sky%20currently%20serves%2022%20million%20subscribers%20in%20India."><strong>22 million+ subscribers</strong></a> was accessible by any one who knows how to hit an API (any developer to be honest). The data below was not only accessible for their active subscribers but even for subscribers who have been inactive since a few years (so in my opinion — far higher than 22 million subscribers).</p><p><strong><em>Possible Malicious Uses of Data: </em></strong>Data acquired from such vulnerabilities could theoretically be used for a lot of different malicious plays — some posing risks to consumer privacy, security while others that could be a business risk to the company itself. Here are some ways:</p><ul><li>Sale / Use of Sensitive Information — Equipped with a large database of Personally Identifiable Information (PII), an attacker could use the data to pretend to be the user across various corporate call centers in India (The company had a lot of users across major metros at one point in time).</li><li>Consumer Targeting by Competitors — Any DTH or Telecom company wanting to target subscribers for their offering could potentially target subscribers who’ve recently deactivated their membership or spend a lot with the company. They could also understand the top paying customers and target them (legally or otherwise by writing scrapers).</li><li>Phishing and Credit Card Details — Given the sensitivity of the information, KYC update or Subscription Renewal phishing emails/SMS could be easily devised which would look realistic and sent to the customer. A subscriber could be taken to a look-alike quick recharge page and requested to enter their credit card details there by helping the attacker get even more information on the subscriber and cause a financial loss. Example of possible phishing campaigns that I could have theoretically run if I had to think of malicious use:</li></ul><pre>1. Hi {{ name }}, your Tatasky balance for subscriberId: {{ subscriberId }} is under Rs. 100. Please click &lt;a href=&quot;www.google.com&quot;&gt;here&lt;/a&gt; to renew to avoid any service interruptions</pre><pre>2. Hi {{ name }}, switch to XYZFiber and get a 4K setup box for FREE. Please click &lt;a href=&quot;www.google.com&quot;&gt;here&lt;/a&gt; to setup a new connection</pre><pre>3. Hi {{ name }}, your KYC needs to be updated. Is this still a valid contact number: {{ mobile number }} and address: {{ address}}? Please click &lt;a href=&quot;www.google.com&quot;&gt;here&lt;/a&gt; to update.</pre><p><strong><em>Backstory:</em></strong> On December 28/29th, I decided to recharge our Tatasky account (which had been lying inactive since a few months). Basis my conversation with customer care, I went to the website and added my phone number to do a quick recharge. To my surprise, it showed me my name, subscriber id, balance and subscription end date without even any form of login. I finished my recharge and was about to sleep when something seemed to bother me about my interaction with the website.</p><p>I opened my laptop and tried the same flow again for a friend’s number and a family member’s number. To my surprise, I could see the same details for their accounts as well <em>(which btw — is still easily accessible by anyone who uses the website — in my opinion it needs to be behind a login mechanism and I’ve already communicated the same to the company)</em>.</p><p><strong><em>Discovery (Technical Explanation):</em></strong> With my tech capabilities, I was able to see under the hood and realised that the APIs (what gets the data from a database) being called were open and not behind any sort of authentication. Basis this discovery, I tried to see if other apis were open (lacking authentication).</p><p>An initial probe showed that I had to enter an OTP to access pages like transaction / recharge history &amp; my profile. The api which gave me basic subscriber details had masked the phone number and email address. I felt comforted that not a lot of exposed (but it lasted only a few minutes).</p><p>When I saw the API structure for the my profile apis, transaction history apis, service requests, etc. I realised that the header accepted an access token (which is a form of authenticating which user is accessing the data). However, the developer who wrote this api — decided to ignore such a token and chose to pass the mobile number as a parameter to the API. What that (assuming unknowingly — since its an amateur developer mistake) did was that I could now pass any mobile number without logging in as the user and access the user’s unmasked address, email, recharge history, # of boxes &amp; service requests.</p><p><strong><em>Replicating at Scale (Technical Explanation): </em></strong>In under 2 hours, I was able to write a simple script and build a webpage that on inputting any phone number would return all the open data in a table format. This was important so that I could bring the extent of the vulnerability to the company’s notice without much back and forth (this after-all was an probono discovery). This also worked for random subscriber IDs that were reported on LinkedIn complaints and twitter complaints to the company’s customer care team.</p><p>Now the question was — can you get this data at scale for the entire subscriber base without having to input one mobile number at a time? After all, a sophisticated attacker would have to do that to really make use of the information.</p><p>To solve the problem of which mobile number to pass, we used a <a href="https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India"><strong>wikipedia article</strong></a> to understand mobile number formats in India. We also used the oldest series like 9820, 9821, etc. from Vodafone and in the Mumbai circle so that we could quickly test our script out. The assumption was, if we take any 4 digit series and sequentially went through the last 6 digits (000000 to 999999), we’d have a million hits on the open APIs and be able to pull data for whichever number returned a match.</p><p>But to do this at scale so that the process would not take time, my dear friend and ex-colleague, <strong>Ankit Pandey</strong>, came in and helped me write code to run the script on multiple threads and write it to a CSV. With Ankit’s help, in another hour or two, we now had a script that we could theoretically run for all the mobile numbers in India and see if the user was a subscriber. On new years eve, December 31st, 2020, we tried this with a few 4 digit series just to check if our script was working and our assumption was correct.</p><p>To our surprise (rather sad it actually worked) — we were able to pull data for random mobile numbers. Additionally, without any API rate limiting, you could keep hitting the APIs (infinite times) in a few hours and it would return data. If there was a 403 error, just changing the IP solved the issue (again disheartening that it was so simple). With that understanding, it was time we reached out to Tatasky so that this could be fixed.</p><p><em>Note: We have not pulled the entire database because we have no use of it, just tested whether it was technically possible. My intention is and never will be to trespass, just understand what someone with malicious intention can possibly do. I do not understand the legality of it and my intent has and will always be to have the issue patched by the company!</em></p><p><strong><em>Company Interaction &amp; Fix: </em></strong>Between December 30/31st, 2020 and January 4th, 2020, I tried various ways to reach the company. My first obvious choice was to find out company leadership names and connect with them on LinkedIn. I tried connecting with the CEO, CIO &amp; another senior executive.</p><p>To my happiness, Harit Nagpal (the CEO) was very quick in accepting the request. However, I couldn’t get his work email to have confidence in sending such sensitive findings. So I reached out to a mutual connect (leaving his name anonymous since I haven’t asked him but I am extremely thankful since his introduction helped fix the issue in a timely manner) who introduced Harit and me on email.</p><p>We sent Harit and his team the findings on email (with Ankit in cc). A few hours later, the authentication was quickly working on the APIs and most of the issues were resolved. Basic rate limiting was also added (however changing the IP would circumvent it). <strong><em>Thankfully the Tatasky team was prompt in the fixes and ensured all the authorised APIs were behind the authorisation check.</em></strong></p><p>However, one issue still remains — where the subscribers name is still accessible for any mobile number — the communication I’ve received is that its for the user experience to be better. My take — I’d sincerely request the leadership to re-consider, because it allows sophisticated attackers the ability to build a database of verified mobile numbers to use in phishing scams — like 1 &amp; 2 in the phishing examples above (more and more common in India today). I’ve spent time in checking other providers as well like Jio, Vodafone, Airtel — and they’ve all prevented from implementing such user experiences presumably because of similar security risks as detailed in the article. If you are a reader or subscriber — whats your take on this flow?</p><p><strong><em>Recommendations for Interaction with Security Researchers / Developers: </em></strong>As developers ourselves, we understand that issues exist in any tech product — but we do hope issues when discovered are handled through dialogue. A few suggestions for companies:</p><ol><li>Do engage with people who are trying their best to ethically bring a vulnerability to your notice. It may also help you control the rhetoric of the finding when its in the public domain.</li><li>Do publish on your website a non customer-care email that can be used to report such issues / train customer-care to escalate these. In my next post — you’ll realise that customer care just failed to understand and escalate a massive issue.</li><li>It doesn’t hurt to have a bug bounty program or enlist on websites like hackerone.com so that these can be discovered quickly.</li><li>Do an audit &amp; check the logs to see when this issue started (my guess is its since the initial codebase) and how many unauthorised people have accessed the data in the last few years. Would seriously suggest companies to invest in anomaly detection.</li></ol><p><strong><em>Recommendations for Developers &amp; General Basic API Security Tips (please research further and ensure best-in-class security): </em></strong>Below are some recommendations for ensuring security for your digital products:</p><ol><li>Open APIs are dangerous. Ensure APIs are always behind a bearer token when accessing any sort of consumer data. Middleware for authentication can go a long way in ensuring any authorised api is always checked. If there is an issue, it can be fixed right there. Having a user session service that interacts only with such middleware to return data can also help.</li><li>Never pass user-sensitive data as parameters to fetch information unless its a login / registration / profile update form: Always trust the session service or the token to get details of the authorised user. Sending parameters like mobile number, always leaves yourself open for attacks.</li><li>Invest in API testing &amp; Monitoring: Ensure APIs are tested individually and in different sequences to prevent attackers from finding vulnerabilities. Writing API tests and periodically running the automated tests can help in the long run.</li><li>Rate Limit: Ensure sensitive (actually all) apis cannot be hit beyond a certain number of times from a public interface. Ensure the same also blocks random IPs. If you have a business in India catering to Indian consumers, see that you have geographic-specific rate limiting as well.</li><li>Encryption: Encrypting or hashing sensitive parameters go a long way. During my research, Vodafone was doing this very well.</li><li>Client Side vs. Server-Side Applications: Understand the basic architectural differences of both applications. Dish TV has also implemented a similar flow as Tatasky. However, because they are using a .net server-side rendered application that from the cursory look is not api driven, it was not easy to replicate the same findings. However, you can still see the name against any mobile number on their website as well — but its a smaller security risk since bulk scripts cannot be written and executed.</li><li>Implement Captchas on Open Forms: Captchas on open forms are absolutely important to ensure other types of attacks like SQL injection don’t take place via scripts.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9b793350e30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>