<?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[Security blog]]></title><description><![CDATA[Security blog]]></description><link>https://blog.soloboy.me</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 17:47:02 GMT</lastBuildDate><atom:link href="https://blog.soloboy.me/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Chain of Three Client-Side Vulnerabilities Leads to One-Click Account Takeover]]></title><description><![CDATA[Hello, hackers. Last year, Mehrad and I discovered an account‑takeover vulnerability by chaining three client‑side vulnerabilities. Let’s dive in.
Understanding the Target
Target was a single web application; the scope was https://redacted.com, so we...]]></description><link>https://blog.soloboy.me/chain-of-three-client-side-vulnerabilities-lead-to-one-click-account-takeover</link><guid isPermaLink="true">https://blog.soloboy.me/chain-of-three-client-side-vulnerabilities-lead-to-one-click-account-takeover</guid><category><![CDATA[account takeover]]></category><category><![CDATA[csrf]]></category><category><![CDATA[XSS]]></category><category><![CDATA[CORS]]></category><dc:creator><![CDATA[Ali Alishan]]></dc:creator><pubDate>Thu, 13 Nov 2025 21:43:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1763069822171/554cb00e-7f98-4bb3-b59e-1850f719bfe5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello, hackers. Last year, <a target="_blank" href="https://x.com/m3hradd">Mehrad</a> and I discovered an account‑takeover vulnerability by chaining three client‑side vulnerabilities. Let’s dive in.</p>
<h2 id="heading-understanding-the-target"><strong>Understanding the Target</strong></h2>
<p>Target was a single web application; the scope was <a target="_blank" href="https://redacted.com"><code>https://redacted.com</code></a>, so we focused on it and started our recon. First of all, we checked the target’s authentication mechanism. When a user wants to log in, they send credentials and the site returns an initial access cookie. After login, the user sends a request to <a target="_blank" href="http://redacted.com/xxx/?action=get-token"><code>redacted.com/xxx/?action=get-token</code></a> with the cookie and gets an access token. This token is then used to perform user activities. Also, the initial cookie had a <code>SameSite=Strict</code> policy, so our requests from third parties to this website couldn’t contain this cookie.</p>
<p>Website authentication flow:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763069724195/5978f529-0da0-47ff-9f45-84b54abd3776.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-cors-implementation-detection">CORS Implementation Detection</h2>
<p>By analyzing the token‑receiving behavior, we noticed that the endpoint <a target="_blank" href="http://redacted.com/xxx/?action=get-token"><code>redacted.com/xxx/?action=get-token</code></a> has a CORS policy that only allows <code>*.redacted.com</code> origins. If we send a request from a different origin, the endpoint does not return the token in the response. Even if it did return a token, we could not exploit it due to the cookie’s <code>SameSite</code> flag.</p>
<p>So far, we have an endpoint that returns a JWT token via cookie, and CORS is enabled for all subdomains.</p>
<h2 id="heading-selfxss-detection">Self‑XSS Detection</h2>
<p>While exploring the website, we found that the <code>first_name</code> parameter was vulnerable to XSS. We tried to escalate it to something impactful but couldn’t, since the site doesn’t show the first name to other users (it might appear in the admin panel, but we didn’t test that). There are a few general ways self‑XSS could be escalated for example, abusing caches or chaining with CRLF/CSRF but I’m not going into those here. Quickly, I had the idea to log the victim into our account (the one whose display name contained the XSS payload) and trigger the XSS. That didn’t have any impact either, since the payload only executed in our own account. In other words, we were just exploiting ourselves. So far, we’ve got a useless self‑XSS that couldn’t be made impactful, plus an endpoint that returns a JWT via a cookie and has a CORS policy allowing all subdomains.</p>
<h2 id="heading-different-approach-amp-csrf">Different approach &amp; CSRF</h2>
<p>We stopped there. We didn’t have any idea how to proceed, so we tested the site from a different angle. We performed subdomain enumeration and saved subdomains with active HTTP services. One of them caught our attention: <code>dev.redacted.com</code>. We opened it immediately; it looked similar to the production app, so we registered there. During testing we discovered the <code>first_name</code> parameter was also vulnerable to XSS, as on the main site. We wondered what would happen if we logged a user into our account on the dev subdomain and executed an XSS payload against them.</p>
<p>Attack flow:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763069750203/07b2985c-014d-41bb-8909-a62da349c9ea.png" alt class="image--center mx-auto" /></p>
<p>Let’s explain steps one by one:</p>
<ol>
<li><p>The attacker sends a CSRF link to the victim. When the victim opens it, they are automatically logged into the attacker’s account on <code>dev.redacted.com</code>.</p>
</li>
<li><p>The attacker had previously set an XSS payload in the <code>first_name</code> parameter. After the victim logs in, the payload executes in the victim’s browser.</p>
</li>
<li><p>The XSS payload sends a request to <code>redacted.com/xxx/?action=get-token</code> with the victim’s cookie to retrieve an authentication token. Because the request originates from <code>dev.redacted.com</code>, the <code>SameSite</code> attribute does not prevent the cookie from being sent. Since the production and development sites use distinct authentication systems, the victim remains logged into their own account on <code>redacted.com</code>.</p>
</li>
<li><p>The exploit extracts the authentication token from the response and sends it to the attacker’s server.</p>
</li>
<li><p>The attacker replaces the token on the website and logs into the victim’s account.</p>
</li>
</ol>
<h2 id="heading-the-end">The end</h2>
<p>When you find something that seems useless or without impact, don’t stop there be more curious, explore further, think differently, and approach the target website from a new angle. I hope this write-up was helpful to you.</p>
<p>You can follow me and Mehrad on X (formerly Twitter): @<a target="_blank" href="https://x.com/alial1shan">alial1shan</a> and @<a target="_blank" href="https://x.com/m3hradd">m3hradd</a></p>
]]></content:encoded></item></channel></rss>