<?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 Akash Karmakar on Medium]]></title>
        <description><![CDATA[Stories by Akash Karmakar on Medium]]></description>
        <link>https://medium.com/@akashkarmakar787?source=rss-9c0affa516d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*byCcemJsu03azrGYnYmi5A.jpeg</url>
            <title>Stories by Akash Karmakar on Medium</title>
            <link>https://medium.com/@akashkarmakar787?source=rss-9c0affa516d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:26:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akashkarmakar787/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[An Interesting Case of Instagram Authentication on Android]]></title>
            <link>https://medium.com/@akashkarmakar787/instagram-authentication-flaw-in-android-app-cf2a59e6a175?source=rss-9c0affa516d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf2a59e6a175</guid>
            <category><![CDATA[instagram]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[login]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Akash Karmakar]]></dc:creator>
            <pubDate>Tue, 18 Feb 2025 06:18:02 GMT</pubDate>
            <atom:updated>2026-09-27T09:52:58.806Z</atom:updated>
            <content:encoded><![CDATA[<p>There is an authentication flaw in the Instagram password-based login in the Android App.</p><p>Instagram allows login using Facebook(OAuth Flow) and password-based login.</p><h4>Instagram login using the Facebook OAuth Flow:</h4><p>In the Facebook login flow users get redirected to the Facebook page to enter their <strong>Facebook</strong> <strong>username</strong>/<strong>email</strong> and the <strong>Facebook</strong> <strong>Password.<br></strong>Once Authenticated on the Facebook side the user gets logged in on Instagram (OAuth Flow).</p><h4>Instagram login using Instagram’s password(Which has an Auth flaw in the Android App):</h4><p>In this login flow a user needs to provide the Instagram username/email and the Instagram Password to login into the Instagram Account.</p><p>One important thing to observe in this Authentication Flow is if the user uses a Facebook password instead of an Instagram Password the user won’t be able to log in to the web App. It will throw an incorrect password error.</p><h3>The flaw in the Instagram Android App:</h3><p>Let’s a user has Instagram’s password as <strong>X</strong> and the same user has Facebook’s password as <strong>Y</strong>.</p><p>In the Instagram Android App if we do password-based login using <strong>Instagram’s username/email</strong> and the password of Facebook(<strong>Y</strong>). The user will get an incorrect password error. <strong>But if it is repeated multiple times the user gets logged in</strong>.</p><p>Android App version that I used: 366.0.0.34.86 (Latest as of 3rd Feb 2025)</p><p>To debug the issue further I did a proxy setup with the Burpsuite to check the network calls (<a href="https://portswigger.net/burp/documentation/desktop/mobile/config-android-device">https://portswigger.net/burp/documentation/desktop/mobile/config-android-device</a>)<br>Once the setup was successful I was able to capture the request of many Android apps like chrome, Gmail etc but not Instagram. Instagram App was not even working. Upon checking I found out that Instagram uses Certificate Pinning. These mechanisms are designed to raise the barrier of entry for an attacker seeking to break the integrity and confidentiality of the traffic sent from the client (user device) to the server. These measures enhance the security of the data in transit, but they also make it harder for our Whitehat researchers to test our mobile apps for server-side security vulnerabilities.</p><p>To bypass these restrictions Facebook allows whitehat researchers to bypass these restrictions: <a href="https://www.facebook.com/whitehat/bugbounty-education/261571715763453/?helpref=topq">https://www.facebook.com/whitehat/bugbounty-education/261571715763453/?helpref=topq</a></p><p>Upon doing all the configuration(<a href="https://www.facebook.com/whitehat/bugbounty-education/261571715763453/?helpref=topq">https://www.facebook.com/whitehat/bugbounty-education/261571715763453/?helpref=topq</a>) I was able to disable restrictions in the Facebook App but was not able to do it in the Instagram(Whitehat settings were not showing up for me in the Instagram App).</p><h4>Proof of concept:</h4><p><strong>Video1:</strong> <a href="https://drive.google.com/file/d/1HZO3YPisX4sweCoOxekedRIR8E2s0HQV/view?usp=drive_link">https://drive.google.com/file/d/1HZO3YPisX4sweCoOxekedRIR8E2s0HQV/view?usp=drive_link</a></p><p><strong>Video2: </strong><a href="https://drive.google.com/file/d/1TZU_QjNvrbqwX2CfE7ScRuORFq1LxWPL/view?usp=drive_link">https://drive.google.com/file/d/1TZU_QjNvrbqwX2CfE7ScRuORFq1LxWPL/view?usp=drive_link</a></p><h3>Why this is a security issue?</h3><p>1. Facebook Account’s password compromise can result in Instagram Account compromise.(The product behavior show facebook password cannot be used in Instagram as we get incorrect password (as show in the video attached) but when trying continuously it logs in).</p><p>2. Say a user keeps his Instagram and facebook password the same. Say there is some unusual activity in his account and Instagram recommends changing the password. After changing the Instagram’s password the user may believe that he has changed his password and his account is safe, but didn’t change facebook password. This can result in compromise as hackers can still use Facebook password to login into victim’s Instagram Account.</p><p>3. This authentication mechanism (use of facebook password in Instagram) users are not aware. It is like 2 keys to open the door, while the user believes there is only one key.</p><p>4. Hackers who are having facebook passwords of users will be able to login to Instagram account as well.</p><p>5. The Apps that use Instagram OAuth for authentication will also be impacted. <a href="https://developers.facebook.com/docs/instagram-platform/reference/oauth-authorize/">https://developers.facebook.com/docs/instagram-platform/reference/oauth-authorize/</a></p><h4>Facebook Bugbounty report:</h4><p>I have reported this as a security vulnerability in their bug bounty program (<a href="https://bugbounty.meta.com/">https://bugbounty.meta.com/</a>)<br>case-id: <strong>3954632524769857</strong></p><h4>And here is their predefined response:</h4><p>“<em>Thank you for reaching out. A member of Meta’s security team has reviewed your report, and concluded that it does not describe a security/privacy vulnerability, or the reported behavior does not meet the bar for a reward under the program. As such, we are closing this report for now.</em>”</p><p>They describe this behaviour as not a <strong>Security vulnerability</strong>. <br>But this behaviour I believe is indeed a security issue as using Facebook password throws incorrect password error in first place, but if used repeatedly it logs in(only in Android App and not in the web App) and also allowing this has other security implications as mentioned under(Why this is a security issue?).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf2a59e6a175" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ReDos — The killer stuff]]></title>
            <link>https://medium.com/@akashkarmakar787/redos-the-killer-stuff-7a28b14d80e?source=rss-9c0affa516d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a28b14d80e</guid>
            <category><![CDATA[regex]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[dores]]></category>
            <category><![CDATA[denial-of-service]]></category>
            <dc:creator><![CDATA[Akash Karmakar]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 16:03:05 GMT</pubDate>
            <atom:updated>2023-03-30T11:50:01.093Z</atom:updated>
            <content:encoded><![CDATA[<h3>ReDos — The killer stuff</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*T8uN744yIZDEe43CyKr9qg.jpeg" /></figure><p>The denial of service attack in which program execution enters an extreme situation then hangs for a long time and even can crash the system.</p><h3><strong>How the regex match works</strong></h3><p>Consider the regex: <strong>/^(A | A)*/</strong><br>and the string: <strong>“AAAAAAAAAAA”</strong></p><p>The regex engine can choose the first A in ( /^(<strong>A</strong> | A)* /), consume all the characters ‘A’ in the given string, and finally return a <strong>match</strong> as it is able to consume all the ‘A’ s in the first go.</p><p>The regex is declared functional, the code is shipped to production, and the system is ready to explode.</p><h3>Why does the system crash with Evil Regex?</h3><p>Consider the same regex: <strong>/^(A | A)*/</strong><br>but with a different string: <strong>“A”*50+”!”</strong></p><p>In the first run, the regex engine matches all the <strong>‘A’</strong> characters of the string with the first <strong>A</strong> of the regex(<strong>/^(A | A)*/</strong>) and finally finds out it cannot match the character ‘<strong>!</strong>’ of the string. So it backtracks.</p><p>If you observe the regex carefully for each character ‘<strong>A’ </strong>of the string we have 2 choices <strong>(A | A)</strong></p><p>For example, if the given string is <strong>“A!”</strong><br>The regex engine needs to run twice to finally confirm it cannot match the “<strong>!</strong>” after consuming <strong>“A”</strong>s of the string by all possible paths.</p><p>If the given string is <strong>“AA!”</strong><br>As for each ‘A’ in the string, the regex engine has 2 choices <strong>(A | A)*</strong>, it needs to loop 4 times to finally conclude it cannot consume ‘<strong>!</strong>’ of the string.</p><p>Clearly, the time-complexity is exponential here, as for each character <strong>‘A’</strong>, the regex engine has 2 choices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*QRgcXl7hD2rJcYRl4vEElQ.jpeg" /><figcaption>For string <strong>“AAA!”</strong> possible paths regex goes through before concluding it cannot match <strong>‘!’</strong></figcaption></figure><p>A string of length 31 will be sufficient to hang your system <strong>“a”</strong>.repeat(30)+<strong>”!” , </strong>If not try to increase the length of the string.</p><p>To get a taste of it in ruby you can try<strong> /^(a|a)*$/ =~ “a”*30+”z”</strong></p><p><strong>Possible remediations:</strong></p><ol><li>Building better regular expression(The above-mentioned regex can be used as<strong> /^a*/</strong>). You can get the payload that can succumb to your regex (<a href="https://devina.io/redos-checker">https://devina.io/redos-checker</a>)</li><li>Filter, Sanitize Inputs, string length restriction.</li><li>Using Timeout for regex operations.</li><li>Test your regexes for efficiency and security before deploying them in a production environment.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a28b14d80e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>