<?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 Ritwik Mishra on Medium]]></title>
        <description><![CDATA[Stories by Ritwik Mishra on Medium]]></description>
        <link>https://medium.com/@ritwikm?source=rss-8b5131c219c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MkVHUBXL-PG8Ub9u</url>
            <title>Stories by Ritwik Mishra on Medium</title>
            <link>https://medium.com/@ritwikm?source=rss-8b5131c219c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:39:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ritwikm/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[Inadvertent Data Leaks by Indian Government: Episode 2 | Vehicle Details]]></title>
            <link>https://ritwikm.medium.com/inadvertent-data-leaks-by-indian-government-episode-2-vehicle-details-d30a4ec2645c?source=rss-8b5131c219c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d30a4ec2645c</guid>
            <category><![CDATA[indian-government]]></category>
            <category><![CDATA[data-leak-prevention]]></category>
            <category><![CDATA[vehicle-tracking-system]]></category>
            <category><![CDATA[data-leak]]></category>
            <dc:creator><![CDATA[Ritwik Mishra]]></dc:creator>
            <pubDate>Tue, 29 Dec 2020 09:29:37 GMT</pubDate>
            <atom:updated>2020-12-29T09:29:37.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK2JvGQCDANiF_EOdCe-Tg.jpeg" /></figure><p>When a system is modeled, or a website is made, there are some primary security concerns. Still, the developers also need to make the website easy to use. Taking care of both at the same time is not easy.</p><p>What will be a primary security concern? There can be many, but let us stick to a simple security concern, “<em>Nobody should collect my data</em>.” It implies a website should detect and stop data scraping.</p><blockquote><strong>What is data scraping?</strong></blockquote><p>It is a name for a process in which coders write a small computer program to download data from a website. Since these small computer programs are not humans, they don’t get tired, and hence they can collect data 24x7. Suppose the programmer is smart enough to spot the magic commands (which we call HTTP requests or API requests). In that case, the programmer can do scrapping without even loading the website. The computer program will directly fetch the data from the website using those magic commands.</p><blockquote><strong>How to make the website easy to use?</strong></blockquote><p>Again, there can be many answers, but consider a minimal website (no fancy graphics) made just to show data. One way to achieve this is to allow people to enter their query (say, a vehicle number). The website displays all the information related to the query, but this is a nightmare for the security aspect. Data scraping is easy in this case. A better way would be to add a password for each query. But remembering passwords is challenging, hence defeating the ‘ease of access’ purpose.</p><p>A middle ground would be to add a captcha for each query. Generally, a captcha is simple to enter, and a new captcha comes whenever you reload the webpage. Hence, easy to use and stops data scraping. Theoretically, it sounds flawless, but practically it has its limitations.</p><p>Take the example of Rahul. When he requests a webpage from our website, the server sends him the webpage and the captcha. At the same time, our server note down the answer to the captcha, and a unique ID given to Rahul. This unique ID is (generally) called VIEWSTATE. Every time Rahul makes a new request, a new captcha is given to him, and a fresh VIEWSTATE is created for him.</p><p>This VIEWSTATE makes sure that Rahul (or anyone pretending to be Rahul) is not using an old webpage to access the data repeatedly. Captcha makes sure that Rahul is a human.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3jDlrXIVcE2SsIX-X8dhgg.png" /><figcaption>Typical interaction between Rahul (User) and the website (Server)</figcaption></figure><p>A typical interaction between Rahul (User) and the website (Server)<br>As I told you, theoretically, it is fine, but the issue is in practicality. In reality, the server needs to wait for some time while Rahul solves the captcha and submit the query. It can be 2 minutes or 20 minutes, or 20 hours. The issue is in this wait time. Generally, servers wipe all their VIEWSTATES once a day, so wait time becomes a maximum of 24 hours. In these 24 hours, I can request data from the website using the magic commands, which contain the same VIEWSTATE and the same captcha answer I entered the first time. Hence Rahul (User) can use the Data scraper to download data repeatedly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYXGDyS9WAWPawUKgvRT3Q.png" /><figcaption>This is when Rahul (User) decides to use the Data scraper to download data repeatedly.</figcaption></figure><blockquote><strong>The leak</strong></blockquote><p>Ministry of Road Transport &amp; Highways under the Government of India started an initiative of digitizing the records of all the vehicles registered in India. Not only they digitized it, but they made access to the data public via their <a href="https://vahan.nic.in/nrservices/faces/user/searchstatus.xhtml">website</a>. Their website does what I wrote above. Their server resets all the VIEWSTATES (and captcha) at 1:04 am every day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_PxuqqRgbvE0-O8SbqBSrw.gif" /><figcaption>A typical example of catching the magic commands (HTTP requests)</figcaption></figure><p>Anyone can write a computer program using selenium, beautifulSoup, and urllib libraries of python to get new VIEWSTATES (and captcha) at 1:04 am every day. Then a simple data scraper can check for all possible values of vehicle numbers in India. And hence it can download the data of some of those vehicles for the next 24 hours. Then at 1:04 am, new VIEWSTATE (and captcha) are fetched. And this process goes on until all the possible values of vehicle numbers are exhausted.</p><p>If you are wondering how the new captcha will be solved, then there are some ways. Either the programmer can himself solve the captcha every day at 1:04 am, or there are some python libraries that uses AI to solve a captcha (like tesseract). Just remember, this captcha solving has to be done only once in 24 hours.</p><p>One data download hardly takes 0.5 seconds. So for 24 hours, a data scraper can download details of more than 1.7 lacs vehicles in a day. And suppose the programmer has a good computer and decides to run 100 such data scrapers in parallel. In that case, it is 1.7 crores vehicles in a day.</p><p>But maybe it is an exaggerated number. The developers of the website will notice sudden massive traffic from one address. There is a term for this kind of attack, and it is called DoS (Denial of Service) attack. Most probably, it is illegal. Developers will notice this DoS attack and immediately block that address. However, suppose the programmer uses multiple addresses. In that case, it might create an illusion that many people over the world suddenly got interested to see Indian vehicle details. This is called a DDoS (Distributed DoS) attack. It is definitely illegal. Recognizing this attack takes time; enough time to leak vehicle details of all the vehicles from a metropolitan like Delhi or Mumbai.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4bUVdlIYzZZnH2SFkx61OQ.png" /><figcaption>Previously it used to give away names of car owner as well. Thankfully they are now hiding some characters in the name, to preserve some privacy.</figcaption></figure><p>The government might have thought that releasing vehicle details will help traffic authorities to look up details of vehicles on the spot. Or they might have thought it would help the public to check the authenticity of car papers when they are buying a second-hand car. Whatever their intentions were, the data they released can be misused for a variety of purposes.</p><p>Taking the context of <a href="https://ritwikm.medium.com/data-leaks-by-indian-government-episode-1-traffic-fines-and-phone-numbers-936ae6c3007">my previous blog</a>, someone with malicious intent can track a vehicle in Delhi through its traffic fines, get the owner’s phone number, and now all the details of the car. Even worse, there could be an underground data harvesting company doing the same thing for their clients and generating profit out of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*uxVBOjsbe6Im0ZwigLHKlA.png" /><figcaption>My email correspondence with the developers of this website. They didn’t reply.</figcaption></figure><blockquote><strong>Solution</strong></blockquote><p>It is relatively simple for the developers of the website. The website should reset their VIEWSTATE after 15–20 minutes instead of once in a day. Plus, using a tougher captcha will significantly deter the AI motivated attacks.</p><p>For the general public of Delhi, you can write an email to info@delhitrafficpolice.nic.in and share <a href="https://ritwikm.medium.com/data-leaks-by-indian-government-episode-1-traffic-fines-and-phone-numbers-936ae6c3007">my last blog</a> with them to take note of it.</p><p>For India’s general public, you can write an email to <a href="https://vahan.nic.in/nrservices/faces/user/contact.xhtml">these people</a> from the ministry and share this blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d30a4ec2645c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Leaks by Indian Government: Episode 1 | Traffic fines and Phone numbers]]></title>
            <link>https://ritwikm.medium.com/data-leaks-by-indian-government-episode-1-traffic-fines-and-phone-numbers-936ae6c3007?source=rss-8b5131c219c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/936ae6c3007</guid>
            <category><![CDATA[e-challan]]></category>
            <category><![CDATA[phone-number]]></category>
            <category><![CDATA[road-traffic-offences]]></category>
            <category><![CDATA[data-leak]]></category>
            <category><![CDATA[india]]></category>
            <dc:creator><![CDATA[Ritwik Mishra]]></dc:creator>
            <pubDate>Fri, 30 Oct 2020 10:05:13 GMT</pubDate>
            <atom:updated>2020-10-30T15:04:05.030Z</atom:updated>
            <content:encoded><![CDATA[<h3>Inadvertent Data Leaks by Indian Government: Episode 1 | Traffic Fines and Phone numbers</h3><p>If you belong to the 12% of the Indian population that lives in metropolitan areas and are well off to own a vehicle, then I suppose you must have gotten a little careless on the road and gotten the ticket at some point in time. In India, the term for traffic violation receipts is ‘<em>challan</em>’.</p><p>Today many Indian cities use automated ways to identify traffic violations. These automated system uses artificial intelligence with deep learning and computer vision to locate the vehicles and judge whether there is a traffic violation or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*KdsloZntPAW12bRn.jpg" /><figcaption>Taiwanese traffic monitoring system deployed in Las Vegas <a href="https://www.traffictechnologytoday.com/news/traffic-management/ai-powered-traffic-management-system-to-launch-at-isc-west-2020.html">(source)</a></figcaption></figure><h3><strong>Coming to the crux of this article, the Data Leaks</strong></h3><p>Traffic management websites of many Indian cities contain this portal for displaying your recent traffic fines. They also have an interface through which you can pay your traffic fines. Such portals are built with minimal designs which just asks vehicle number. And it spits out the traffic fines committed by that vehicle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*bIj3EiVpNQNzsLql.gif" /><figcaption>To get traffic violations of any vehicle from Ahemdabad, India.</figcaption></figure><p><a href="https://mahatrafficechallan.gov.in/payechallan/PaymentService.htm?_qc=640dca8b5564347f84caa575894a2873">Some Indian states</a> have traffic management portals that need authentication to ensure that the request is coming from a human. For e.g.: a CAPTCHA. <a href="https://kolkatatrafficpolice.net/SearchChallan.aspx">Some</a> have the compulsion to enter the last 4 digits of chassis number along-with the vehicle number. The chassis number is a 17 digit identification number of your vehicle. <a href="https://www.acko.com/car-guide/find-chassis-number-vin-and-engine-number-of-your-car/">You can find it</a> in the documents of your car or actually on the body of your car. Asking chassis number makes sure that the user has physical access to the vehicle.</p><p>Theoretically, both the authentication can be broken with modern computers. But alone, chassis number increases the search space (the difficulty) by 10⁴ times, so even this minimal authentication layer effectively prevents brute-force attacks on the portal.</p><p>However, there are some traffic portals, like <a href="https://delhitrafficpolice.nic.in/notice/pay-notice/">Delhi</a>, <a href="http://www.bangaloretrafficpolice.gov.in/default.aspx">Bangalore</a>, and <a href="https://payahmedabadechallan.org/">Ahmedabad,</a> which don’t have any authentication layer on its website. As a result, one can quickly write a python script (a small computer program) to try every possible permutation and combination of vehicle numbers to download their traffic fines.</p><p>The search can be made faster by directly hitting the server through an API call instead of using an automated browser like Selenium. One just needs to copy the headers of the POST request that is generated by submitting any random vehicle number on the portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*byBynuIfxQHllxAd.gif" /><figcaption>Explained: How to capture header variables from one random request to the server.</figcaption></figure><p>In simple words, copying the secret lines from the browser and using them to directly fetch data from the server is called an API call. By parallel API calls, one can download the entire database in a week.</p><h3>Our altruistic research</h3><p>We downloaded 4 million traffic fines from Delhi and 3 million from Ahmedabad. Our intent was to find patterns in the traffic fines to recommend some measures to the authorities to curb the traffic fines. We saw many interesting patterns and wrote a research paper on it. The <a href="https://ieeexplore.ieee.org/document/9232615">paper is published</a> as a workshop paper at the IEEE International Conference on Multimedia Big Data (BigMM) 2020.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*l57NmzA4sjbmwh53Wk2REw.png" /><figcaption>Brief description of the traffic violations by Mishra et al. 2020.</figcaption></figure><p>Our analysis showed that the majority of paid e-challans (in Ahmedabad) consist of lower fine amounts. Also, the fine amount is likely to affect the payment behavior of users in Ahmedabad. People generally pay smaller fines first.</p><blockquote><strong>Once caught, most of the people becomes careful</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*MNO-e7ukhZ6malNfTr4jJQ.png" /><figcaption>Percentage of unique vehicles with given number of e-challan receipts by Mishra et al. 2020.</figcaption></figure><p>A significant portion of the unique vehicles has more than 1 violation (57% in Ahmedabad and 42% in Delhi). Still, as seen from the figure, it decreases with an increasing number of <em>challans</em>.</p><blockquote><strong>Ahmedabad drivers break red light, Delhi drivers breaks everything</strong></blockquote><p>The top 2 traffic violations in both cities account for 68.94% and 98.37% of all the issued electronic traffic violations (<em>e-challan</em>) in the city, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*oibB55XxCU4MpFdNDu_jMA.png" /><figcaption>Five most frequent (top 5) electronic traffic violation types by Mishra et al. 2020.</figcaption></figure><blockquote><strong>Sometimes the fault is in our location</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Jjdt_1750XXPTpK0U5nPig.png" /><figcaption>Heatmaps for Improper Parking (left) and Red Light Violation (right) in Ahmedabad by Mishra et al. 2020.</figcaption></figure><p>We also observed that some traffic violations are concentrated on a specific region of the city of Ahmedabad. As shown in the figure above, improper parking is focused on the east side of the Sabarmati river in Ahmedabad. In contrast, red-light violations are concentrated on the west side. Thus, specific targeted measures can be taken to reduce the number of such violations.</p><blockquote><strong>Motor Vehicles (Amendment) Act 2019</strong></blockquote><p>We used these traffic violations to analyze the effectiveness of the September 2019 amendment in the Motor Vehicles Act, India. The new amendment was passed by the <a href="https://www.tutorialspoint.com/indian_polity/indian_polity_federal_system.htm">center</a>, which increased the traffic violation fines to 2,3,5 times. But under the seventh schedule of the Indian constitution, road transport comes in the <a href="https://economictimes.indiatimes.com/blogs/et-editorials/welcome-opening-up-of-road-transport/">concurrent list</a>, i.e. it belongs to both state and center. Hence, it was on the discretion of the state as to how much they want to increase the fine amount. Delhi increased it to the greatest degree, whereas in Ahemdabad, it was <a href="https://is.gd/bCKyFL">raised</a> but not so much.</p><p>The data we collected showed that the increased traffic fines in Delhi were immediate but not long-lasting. In contrast, the effect persisted in Ahmedabad but took time to take effect. Even previous research also shows that increasing traffic fines doesn’t necessarily decrease traffic violation unless people are afraid to get caught. To read the complete analysis, please refer to our paper (<a href="http://precog.iiitd.edu.in/pubs/2020_Aug_traffic_violations.pdf">PDF</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*fD_ZS6emuZavefwYIGf5Cw.png" /><figcaption>Change in average number of e-challans with respect to August 2019 by Mishra et al. 2020.</figcaption></figure><h3><strong>Coming back to Data Leaks</strong></h3><p>Releasing such amount of personal information — which included vehicle number and location of that vehicle at that time — is problematic in the first place. One can use this information to track the vehicle in time, hence the owner of the vehicle.</p><p>There is a reason that criminal record is not made public. When a citizen breaks the law, it should be dealt with between the citizen and the state. When such data goes into the public domain, it can be used to track the individual (sorry for repeating myself), judge the individual, or show targeted advertisements to the user.</p><p>But the leaky-buck doesn’t stop here. To add an authentication layer, the Delhi traffic management portal committed a blunder. What they did was, adding an unsafe OTP-based authentication layer for the vehicles that have an active (unpaid) <em>challan</em>.</p><p>I figured out that the OTP window can be easily bypassed if I just pass the following additional variable along-with my previous request.</p><pre>isOtpVerified=true</pre><p>It is like you hire a big tough security guard to protect your privacy, but the guard lets anyone in if they say ‘please’ or, in this case, <em>‘isOtpVerified=true.’</em></p><p>But the leaky-buck doesn’t stop here as well. The OTP window, which Delhi Traffic Police added as an authentication layer, has a significant flaw. Usually, to remind the user as to which phone number the OTP has been sent, the OTP windows generally show starting 3–4 digits of the phone number to the user. The rest of the digits are obfuscated or hidden.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/0*04Sv_hCnhHhmH8pq" /><figcaption>OTP window from IndiaMart (for illustration)</figcaption></figure><p>If you are not a computer science person, then always remember that whatever the server sends to the user is highly vulnerable. A user can easily see what the server sent to him/her by basic digging into the browser memory. This communication (server-to-user and user-to-server) is so vulnerable that anyone can tap the messages if they have access to the channel and the right tools.</p><blockquote><strong>The blunder</strong></blockquote><p>What Delhi Traffic Police website did in this case, is exactly what websites shouldn’t do at all. They sent the sensitive information i.e., phone number (on which OTP was sent) in plaintext to the user. It was the responsibility of the browser (to be precise javascript in the browser) to hide the phone number. And as I told you, browsers are not very strong in hiding such secrets.</p><p>As a result, along-with the traffic fines, Delhi traffic management website was giving away phone numbers of Delhi citizens like candies in Halloween. I collected some phone numbers for proof of concept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*pPK4VLWdZ3QuD7-tuL3-1A.png" /><figcaption>Censored snapshot of the dataset.</figcaption></figure><p>Our intent was to collect data for research purposes only. In doing so, we found this vulnerability, which might be existing in other websites that this developer made.</p><p>While I was conducting my research, I mailed the Delhi traffic police handle about my intentions. Moreover, I mailed them about the vulnerability on their website before publishing this post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*ptObj-zv-1EuBZwksFbppw.png" /><figcaption>My correspondence with info@delhitrafficpolice.nic.in</figcaption></figure><h3><strong>Solutions</strong></h3><p>As a government authority… You should hire penetration testers as well. Or in your tender, make sure those companies are selected that have a separate penetration testing team.</p><p>As a citizen… I don’t know what you can do in your capabilities to solve this issue. Maybe share this article so that authorities can get a note of it.</p><blockquote>Thanks</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=936ae6c3007" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>