<?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 m_kamal on Medium]]></title>
        <description><![CDATA[Stories by m_kamal on Medium]]></description>
        <link>https://medium.com/@elkpir666?source=rss-4ec3e427877e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by m_kamal on Medium</title>
            <link>https://medium.com/@elkpir666?source=rss-4ec3e427877e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:26:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elkpir666/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[Interesting Bug Bounty Findings I found in Android Application]]></title>
            <link>https://medium.com/@elkpir666/interesting-bug-bounty-findings-i-found-in-android-application-3fa75b69cb19?source=rss-4ec3e427877e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fa75b69cb19</guid>
            <category><![CDATA[android-pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[m_kamal]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 00:52:01 GMT</pubDate>
            <atom:updated>2025-12-16T11:07:32.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oo_jgHW7kq6cQypWe2kQ9g.png" /></figure><p>Hi, I’m <strong>Mohamed Kamal</strong>, Offensive Security Engineer and bug bounty hunter</p><p>In this write-up, I’ll walk through three Android security vulnerabilities I discovered during various bug bounty programs. These findings show how small implementation mistakes in deep links, biometric flows, and Intent extra handling can create high-impact issues such as Account Takeovers, authentication bypasses, and open redirects.</p><h3><strong>1- Biometric Authentication Bypass</strong></h3><p>Many Android applications use biometric authentication as an additional security layer on top of the standard login flow. After the user logs in once, the app usually stores an <strong>authorization token</strong> inside Secure Storage (EncryptedSharedPreferences, Keystore-backed storage, etc.).<br> From the user’s perspective, this makes login effortless — every time they open the app, they simply pass a fingerprint or face scan instead of entering credentials again.</p><p>This convenience, however, becomes a security risk when the application trusts the stored token <strong>before</strong> validating the biometric check.</p><h4>Vulnerability Exploitation</h4><p>One of my targets was a <strong>banking application</strong> that offered a biometric “quick login” feature. After enabling biometric authentication, I bypassed SSL certificate pinning so I could observe all API calls in cleartext.</p><p>When I opened the app again, I immediately noticed something unusual:</p><p><strong>The application was sending authenticated API requests using the stored authorization token <em>before</em> showing the biometric prompt.</strong></p><p>In other words:</p><p>1- The app fetched the token from secure storage</p><p>2- It used that token to make authenticated API calls</p><p><em>3- </em>before confirming local biometric/passcode auth</p><p>This completely defeated the purpose of the biometric layer.<br> Even though the UI showed a fingerprint prompt, the backend already considered the user authenticated.</p><h4><strong>What Should Have Happened</strong></h4><p>The expected, secure behavior is:</p><ol><li>App launches</li><li>App <strong>first</strong> performs a biometric check</li><li>Only after successful biometric authentication, the app retrieves the token from secure storage</li><li>Then it uses the token to make authenticated requests</li></ol><p>In this vulnerable implementation, steps 2 and 3 were reversed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*6Fr2wVwGbcuSaR9HCZxEsw.png" /></figure><h3>2- Account Takeover via Deep Link Hijacking</h3><p><strong>Android deep link hijacking</strong> is a security vulnerability that occurs when an unauthorized application intercepts deep link requests intended for another application.</p><p>When the applications expose a deep link handler (<strong><em>Exported Login Activity</em></strong>) associated with a sensitive functionality (e.g., <strong>authentication</strong>), Upon a user clicking the malicious application’s option to handle the deep link, the application captures the authentication token embedded within the link.<br>The malicious application subsequently exfiltrates the authentication token to an attacker-controlled server. With the stolen token, the attacker authenticate himself as the victim, leading to full account takeover.</p><h4>Vulnerability Exploitation</h4><p>During my analysis, I noticed that the app declares a LoginSelectorActivity in the manifest with a deep-link intent filter.</p><pre>&lt;activity<br>    android:name=&quot;com.target.library.activities.LoginSelectorActivity&quot;<br>    android:exported=&quot;true&quot;<br>    android:configChanges=&quot;screenSize&quot;&gt;<br>    &lt;intent-filter&gt;<br>        &lt;data android:scheme=&quot;scheme&quot;/&gt;<br>        &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;<br>        &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;<br>        &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;<br>    &lt;/intent-filter&gt;<br>&lt;/activity&gt;</pre><p>In the code I observed the activity reading an authToken value from the incoming Intent</p><pre>// Illustrative: vulnerable pattern<br>Uri data = getIntent().getData();<br>if (data != null) {<br>    <br>    String authToken = data.getQueryParameter(&quot;authToken&quot;);<br>    if (authToken != null) {<br>        SessionManager.getInstance().setAuthToken(authToken);<br>        navigateToMain(); <br>        return;<br>    }<br>}<br>showLoginScreen();</pre><p><strong>The app use a custom URI scheme (</strong><strong>scheme://) instead of Android App Links, and any other app on the device could register the exact same scheme.</strong></p><p>So I built a PoC app that registered the same schema, and I made my PoC app forward the authToken from the incoming intent to my server.</p><p>When the victim completed signin in the browser, Android displayed a chooser asking which installed app should handle the deep link. the victim could accidentally select it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*ATWpCCz69nicWC3OEWHHtg.png" /></figure><p>Because the deep link contained an actual authentication token, the malicious app would receive the uri data.</p><p>That means the attacker-controlled app could simply parse the incoming Intent and extract the token and send it to his server. <br><strong>resulting in a full account compromise.</strong></p><h4>Mitigation</h4><ol><li><strong>Secure OAuth flows with PKCE</strong><br> Always use Proof Key for Code Exchange (PKCE). After the OAuth server issues an auth_code, validate the code_verifier when exchanging it for an access token. This prevents interception or replay of the code even if a malicious app receives the redirect.</li><li><strong>Use verified App Links instead of custom schemes</strong><br> Replace custom URI schemes with Android App Links tied to your domain. This ensures that only the legitimate app can receive authentication callbacks, preventing other apps from hijacking deep links.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*DcazdyNoPcAASLx7vITR1w.png" /></figure><h3>3- Insecure Intent Extra → Open Redirect in Login Activity</h3><p>the exported LoginSelectorActivity was found to process an external intent and automatically open a URL supplied by another application. The activity retrieves a value from the intent extra orig_uri and directly passes it to startActivity() without validation.</p><pre>// Extract untrusted input<br>String origUri = intent.getStringExtra(&quot;orig_uri&quot;);<br>this.onDemandUrl = origUri;<br><br>// Triggered when user taps &quot;Rejoin now&quot;<br>public void lambda$showDialog$1(DialogInterface dialogInterface, int i) {<br>    startActivity(<br>        new Intent(Intent.ACTION_VIEW, Uri.parse(this.onDemandUrl))<br>    );<br>}</pre><p>There are no restrictions or validation here — whatever string is supplied inside orig_uri becomes a browser navigation target. Since this activity is fully exported, <em>any malicious app</em> can start it and inject an arbitrary URL.</p><p>This makes it possible to craft a convincing phishing flow. The attacker simply triggers the LoginSelectorActivity with a fake orig_uriand the legitimate app displays its normal UI like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*5lzFRoFJCN8ye7hH1SadXQ.png" /></figure><p>The user taps the button, assuming they are returning to a video visit or login, and the app redirects them to any site chosen by the attacker.</p><h4>Impact</h4><p>The redirect happens <em>inside the trusted app’s flow</em>, which significantly increases the chance of the victim interacting with attacker‑controlled content.</p><ul><li>A fake login page can be opened and framed as part of the app’s normal process.</li><li>The redirect can be used to push the victim to harmful pages, malware, or fake SSO endpoints.</li><li>Because the redirect is triggered from within the app, the user is unlikely to suspect malicious behavior.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*PoaqMwOCblClT1OH5ZhIjw.png" /></figure><h4>Conclusion</h4><p>I hope this write-up provides useful insights into real-world Android bug bounty scenarios. If there are any questions or further clarifications needed, feel free to reach out.</p><p><a href="https://www.linkedin.com/in/mohamed-kamal-aa1991282/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fa75b69cb19" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>