<?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 janlele91 on Medium]]></title>
        <description><![CDATA[Stories by janlele91 on Medium]]></description>
        <link>https://medium.com/@bugbounty0901?source=rss-942065d54a36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6fohzA6fIzV9vrPt</url>
            <title>Stories by janlele91 on Medium</title>
            <link>https://medium.com/@bugbounty0901?source=rss-942065d54a36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 02:32:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bugbounty0901/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[OAuth Authentication Bypass leading to PII disclosure]]></title>
            <link>https://medium.com/@bugbounty0901/oauth-authentication-bypass-leading-to-pii-disclosure-5d243b62d532?source=rss-942065d54a36------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d243b62d532</guid>
            <category><![CDATA[authentication-bypass]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[oauth2]]></category>
            <dc:creator><![CDATA[janlele91]]></dc:creator>
            <pubDate>Sun, 09 Nov 2025 06:19:06 GMT</pubDate>
            <atom:updated>2025-11-10T02:52:18.331Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi — I’m janlele91, an ethical hacker and pentester based in Vietnam, currently working at Viettel Cyber Security (VCS). I also hunt on bug bounty platforms in my spare time, mostly on <a href="https://bugcrowd.com/h/janlele91">Bugcrowd</a>.</p><p>Today i wanna share with all of you my biggest bounty about Authentication Bypass in a commercial platform. As a result, i can extract their customers’ PII and users in the application. This is a private program on Bugcrowd, so that let’s call it target.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMJfmwg0SvVEo-v7_0m4iQ.png" /></figure><h3>OAuth2 and client_credentials grant type</h3><p>🔹 <strong>OAuth2</strong></p><p>In a typical OAuth2 setup, there are four components working together:</p><p>1. <strong>User </strong>— a human trying to access something (for example, logging into a web app).<br>2. <strong>Client </strong>— the application acting on behalf of the user (e.g., your browser or mobile app).<br>3. <strong>Authorization Server</strong> — issues tokens after verifying the user’s identity and permissions.<br>4. <strong>Resource Server </strong>— the API or backend that hosts the actual data.</p><p>The usual sequence looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgpxKCEHx1cVZE50dnxEXQ.png" /><figcaption>Overall OAuth Workflow</figcaption></figure><p>1. The <strong>User</strong> requests access via the <strong>Client</strong>.<br>2. The <strong>Client</strong> redirects them to the <strong>Authorization Server</strong> for login and consent.<br>3. Once the user logs in, the server issues an <strong>authorization code</strong>.<br>4. The <strong>Client</strong> exchanges that code for an <strong>access token</strong>.<br>5. The <strong>Client</strong> then uses that token to access protected resources on the <strong>Resource Server</strong>.</p><p>➡️ In short, <strong>the user is involved</strong>, and the access token represents that <em>user’s consent</em> and <em>permissions</em>.</p><p>🔹 <strong>OAuth Grant Type: </strong><strong>client_credentials</strong></p><p>Now look at the <strong>second diagram</strong> — notice how <strong>there’s no User</strong> at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ezx46PV37a7kGOgjWrpe5g.png" /><figcaption>Client_credentials grant type workflow</figcaption></figure><p>This is the <strong>client_credentials</strong> flow, designed for <strong>machine-to-machine (M2M)</strong> communication — like a backend service calling another internal API. It has only <strong>three actors</strong>:</p><ol><li><strong>Client</strong> — the machine or service making the request.</li><li><strong>Authorization Server</strong> — issues the token after validating the client’s identity.</li><li><strong>Resource Server</strong> — accepts the token and returns protected data.</li></ol><p>The flow is simple:</p><ol><li>The <strong>Client</strong> sends its credentials (client_id and client_secret) to the <strong>Authorization Server</strong>.</li><li>The server validates the credentials and returns an <strong>access token</strong>.</li><li>The <strong>Client</strong> uses that token to call the <strong>Resource Server</strong> and fetch data.</li></ol><p>And that’s it — <strong>no user interaction</strong>, <strong>no login screen</strong>, <strong>no consent page</strong>.</p><h3>Back to the story …</h3><p>The target’s scope is wildcard *.target.com, so it takes me a lot of efforts to do my reconnaissance (subdomain enumeration, fuzzing, wayback machine, google dorking, …).</p><p>I used my custom tool to collect their subdomains/urls, but it was stucked because no vulnerability has been found after a long day. Until one day, I switched gears: broader dorking across multiple search engines (Google, Bing, DuckDuckGo, Baidu), manual review of JS bundles, and focused inspection of the app’s login behavior. That change in perspective is often where meaningful bugs hide.</p><p>I found an old subdomain sub.target.com on Duckduckgo, which can interestingly accessed directly via https://sub.target.com/sub/#/login instead of https://sub.target.com.</p><ol><li>It was a login page, and it used password grant type for OAuth flow. The request looks like:</li></ol><pre>POST /api/token HTTP/1.1<br>Host: sub.target.com<br>Content-Type: application/json<br>Content-Length: 29<br><br>grant_type=password&amp;username=abc&amp;password=abc</pre><p>2. After some tries, i came up with client_credentials grant type and figured out that the app missed client_id and client_secret validation. I just crafted the HTTP request as following:</p><pre>POST /api/token HTTP/1.1<br>Host: sub.target.com<br>Content-Type: application/json<br>Content-Length: 29<br><br>grant_type=client_credentials</pre><p>Sent it and got a pair of (access_token, refresh_token). It was easy af, right? Now, i have to know how to use this token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*v8s2RXKiBTesYuiIIZ_WUg.png" /></figure><p>3. Mapping the API surface from JS: This is actually the first thing we need to do.</p><ul><li>I inspected the frontend JS and discovered only a handful of backend endpoints (about 6 total).</li><li>Trying the issued token against each endpoint revealed only <strong>one</strong> endpoint accepted the token with Authorization: Bearer &lt;access_token&gt;: a search/list endpoint that uses a simple query parameter. The interesting thing was that i got approximately 12MB customer data with query=1 at the first hit. We could exfiltrate data by fuzzing query value.</li></ul><pre>GET /api/common/search/list?query=1 HTTP/1.1<br>Host: sub.target.com<br>Authorization: Bearer &lt;token&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9NstFIjYVqZ2sTbeVV_FA.png" /></figure><p>Got the PoC and submitted to the program. It was accepted and rewarded in the same day because of its urgent impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMJfmwg0SvVEo-v7_0m4iQ.png" /></figure><h3>Tips</h3><ul><li><strong>Never underrate dorking in Search Engines</strong>: Duckduckgo, Baidu, Yandex, Yahoo, etc.</li><li><strong>Focus on auth flows.</strong> If recon stalls, dig into authentication and authorization logic — token endpoints often hold critical bugs.</li><li><strong>Mutate parameters carefully.</strong> Small mutations (e.g., switching grant_type) can reveal misconfigurations — do it ethically and within scope.</li><li><strong>Map JS &amp; endpoints — </strong>trace frontend bundles and network calls to find hidden endpoints and parameters.</li></ul><p>Cheers,</p><p>janlele91 🙌.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d243b62d532" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>