<?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 Mostafa on Medium]]></title>
        <description><![CDATA[Stories by Mostafa on Medium]]></description>
        <link>https://medium.com/@mostvvfv?source=rss-0a3b80b4c96f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wRfRHlokDgv7Km-PVK-yEA.jpeg</url>
            <title>Stories by Mostafa on Medium</title>
            <link>https://medium.com/@mostvvfv?source=rss-0a3b80b4c96f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:49:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mostvvfv/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[When Pre-Account Takeover Actually Means Pre-Account Takeover]]></title>
            <link>https://medium.com/@mostvvfv/when-pre-account-takeover-actually-means-pre-account-takeover-84ee9dd2263c?source=rss-0a3b80b4c96f------2</link>
            <guid isPermaLink="false">https://medium.com/p/84ee9dd2263c</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[pre-account-takeover]]></category>
            <category><![CDATA[email-verification-bypass]]></category>
            <category><![CDATA[account-takeover]]></category>
            <dc:creator><![CDATA[Mostafa]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 16:13:10 GMT</pubDate>
            <atom:updated>2026-09-08T19:49:00.600Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sYH7n_rRg0vvTjDK_vbVQ.png" /></figure><p><strong>بِسْمِ اللَّهِ رَبِّ الْعَالَمِينَ، وَالصَّلَاةُ وَالسَّلَامُ عَلَى رَسُولِنَا الْأَمِينِ.</strong></p><blockquote>Hello mate! I’ve been putting the writing off forever, but I finally bit the bullet and wrote my first writeup. Today, we’re walking through a business logic flaw to see how a simple design choice has multiple consequences.</blockquote><p>When people describe a vulnerability as a <em>Pre-Account Takeover (Pre-ATO)</em>, the term itself often fails to convey what is actually happening under the hood. In many cases, the underlying issue is simply an email verification bypass: an attacker can register an account using an email address they do not control before its legitimate owner does. While this can certainly be undesirable, labeling it as “Pre-ATO” does not inherently make the vulnerability more severe. In its more common forms, the practical impact may remain limited to account squatting or premature account creation, often resulting in a Medium-severity finding. Calling such a vulnerability Pre-ATO can therefore be somewhat misleading, and in some cases feels more like severity-driven terminology than a precise description of the security impact.</p><p>The case discussed in this write-up, however, is different.</p><p>Here, the attacker is not merely registering an account with someone else’s email address. The platform actually provisions the identity that the legitimate user is expected to adopt, establishes it as an active platform account, and grants the attacker authenticated access to that identity before the legitimate owner has ever interacted with the platform. In other words, the attacker gains control of the account <strong>before its legitimate owner even begins using it</strong>.</p><blockquote>That distinction is what makes this a genuine Pre-Account Takeover scenario — and not simply an email verification bypass wearing a more impressive name.</blockquote><h3>The Bug Some People Would Call Pre-ATO</h3><p>The investigation initially started with something much more straightforward.</p><p>The registration flow accepted an arbitrary email address and immediately provisioned an account for it:</p><pre>POST /api/user?projectId=...<br>    &amp;login_url=https://api.target.com/org/login/session<br>Host: login.target.com<br><br>{<br>  &quot;email&quot;: &quot;email_we_dont_own@tar.com&quot;,<br>  &quot;password&quot;: &quot;&lt;any&gt;&quot;,<br>  &quot;username&quot;: &quot;email_we_dont_own@tar.com&quot;<br>}</pre><p>The response returned a signed session token for the newly created identity:</p><pre>HTTP/2 200<br><br><br>{<br>  &quot;login_url&quot;: &quot;https://api.target.com/org/login/session?token=eyJ...&amp;is_new=1&quot;<br>}</pre><p>In the normal browser flow, the user is then taken to the email-verification page. That is the point at which the platform expects the user to prove ownership of the email address.</p><p>But the session token is already sitting in the registration response.</p><p>Intercept the request, take the token, and open the returned login_url directly — and the account opens without any email verification taking place.</p><p>The important detail is what happens <strong>after</strong> the account is opened. The platform does not treat this as an unverified session that still needs to prove email ownership. The token is accepted as an authenticated session, and the account is handled as though the verification step has already been satisfied.</p><p>So the actual bypass is straightforward:</p><pre>Register account<br>      ↓<br>JWT returned in response<br>      ↓<br>Intercept JWT<br>      ↓<br>Open account with JWT<br>      ↓<br>Authenticated access without email verification</pre><p>What makes this interesting is the verification boundary itself.</p><p>The platform formally enforces email verification for registered accounts; a newly registered user is sent to the email-confirmation flow and is not supposed to gain normal account access until that step is completed. The assumption appears to be that a session token capable of granting normal account access would only be issued after the user had completed the verification flow.</p><p>But that assumption breaks at the registration endpoint.</p><p>The session token is issued <strong>before email ownership has been established</strong> and is exposed in the registration response. If the request is intercepted and that token is used directly, the account opens normally and is treated as though the email has already been verified.</p><p>The application is therefore accepting possession of a token issued <strong>before verification</strong> as sufficient authentication for a state that is supposed to exist <strong>after verification</strong>.</p><blockquote>That is the entire bypass, and this behavior was in fact already represented by a <strong>Medium-severity duplicate</strong>.</blockquote><p><strong><em>Using someone else’s email to create an account does not make this a Pre-ATO, because the legitimate owner was never meant to use that account. The account was created by the attacker, rather than provisioned for the legitimate email owner to adopt.</em></strong></p><p><strong><em>A true Pre-ATO is different. The platform creates the identity that the legitimate user is actually expected to use, while the attacker gains control of that identity before the legitimate user ever establishes control of it.</em></strong></p><p><strong><em>That distinction is what matters here.</em></strong></p><h3>What an Actual Pre-ATO Looks Like</h3><p>The answer was sitting in the organization invitation flow.</p><p>An Owner could invite an email address that did not have an existing platform account.</p><h4><strong>The usual invitation model in a RBAC system</strong></h4><p>An invitation normally works as an authorization mechanism for an identity that is established by the recipient:</p><pre>Invitation link<br>      ↓<br>Recipient accepts<br>      ↓<br>Recipient establishes their identity<br>      ↓<br>Account is created / activated<br>      ↓<br>Identity joins the organization</pre><p>The platform does not need to create an account for an email address before its owner has interacted with the invitation.</p><h4>The invitation model here</h4><p>The invitation flow here operates at the <strong>platform identity</strong> level rather than simply issuing an invitation link.</p><p>When an Owner invites an email address that is not yet registered, the platform first needs that identity to exist so it can invite it to the organization. That immediately creates a design requirement: the platform needs to provision the account first and only then sends the invitation.</p><p>The implementation handled this by having the inviter’s browser trigger the same account-provisioning mechanism used by the normal registration flow.</p><p>When an unregistered email was invited, the browser first performed in the background:</p><pre>POST /api/user?projectId=...<br>    &amp;login_url=https://api.target.com/org/login/session<br>Host: login.target.com<br><br>{<br>  &quot;email&quot;: &quot;email_we_dont_own@target.com&quot;,<br>  &quot;password&quot;: &quot;&lt;attacker-controlled-password&gt;&quot;,<br>  &quot;username&quot;: &quot;email_we_dont_own@target.com&quot;<br>}</pre><p>The platform created the identity through the normal registration flow and returned an authenticated session for it.</p><p>The browser then associated that newly created identity with the Owner’s organization:</p><pre>POST /org/current/org/{id}/users<br>Host: api.target.com<br>Authorization: Bearer &lt;owner JWT&gt;<br><br>{<br>  &quot;email&quot;: &quot;email_we_dont_own@target.com&quot;,<br>  &quot;role&quot;: &quot;ROLE_WHATEVER&quot;,<br>  &quot;permission_to_refund&quot;: true,<br>  &quot;privileges&quot;: []<br>}</pre><pre>HTTP/2 204</pre><p>Only after those operations was the invitation sent to the email address.</p><p>That ordering is the important part:</p><pre>Owner invites unregistered email<br>              ↓<br>Platform provisions the identity<br>              ↓<br>Inviter establishes its credentials<br>              ↓<br>Identity is associated with the organization<br>              ↓<br>Invitation is sent</pre><p>The platform had effectively reversed the trust boundary of an invitation.</p><p>An invitation normally represents an offer:</p><p><em>We have an organization account. Come here and establish yourself as this invited user.</em></p><p>Here, the platform was doing something fundamentally different:</p><p><em>We will establish the identity for you first, then tell you to join .</em></p><p>And because the provisioning request was being executed in the inviter’s browser, the inviter was the party controlling the credentials established for that identity.</p><p>That is the point where the finding becomes fundamentally different from the registration bug.</p><p>With the registration issue, the attacker says:</p><p><em>I am going to register an account using an email address I don’t own.</em></p><p>With the invitation issue, the platform says:</p><p><em>I will create the platform identity associated with this email address,</em></p><p>and the attacker is the one who establishes its initial credentials.</p><p>The legitimate owner of the email address has not registered anything, has not authenticated, has not accepted anything, and has not interacted with the platform yet.</p><p>Yet their platform identity already exists — and someone else has established control over it.</p><p>That is a genuine <strong>Pre-Account Takeover</strong>. The real impact here is not just that the attacker gains initial access — it’s that the victim will receive the invitation, accept it, and start using the account completely normally. they will join other organizations, accumulate privileges, and build their presence on the platform, all while the attacker retains the original credentials from day one. The bigger the account grows, the more the attacker benefits — without ever needing to do anything again.</p><p>And that design decision had consequences beyond the initial takeover.</p><p>The newly created identity was a platform-level identity, not something permanently confined to the organization that created it. The identity could subsequently participate in other organizations and receive additional privileges there.</p><p>When that identity is later invited into another organization and granted a higher role — even an Owner-level role — the original credentials remain valid and under the attacker’s control for that same underlying identity.</p><p>The attacker therefore retains a foothold in an identity whose privileges can grow independently of the organization to which it was originally invited.</p><p>The same architectural decision also creates another problem in the opposite direction.</p><p>The attacker can provision arbitrary unregistered email addresses simply by inviting them.</p><p>That means the attacker can occupy those email addresses as existing platform identities before their legitimate owners arrive. Even if the identity is later removed from the attacker’s organization, the email remains associated with the existing platform identity rather than becoming available for a clean registration.</p><h3>But Wait — MFA Was Enforced</h3><p>There is one more detail that makes the first exposed session token especially interesting.</p><p>In this case, our target had MFA enforced by default for account login. So even if an attacker somehow obtained the credentials of the newly provisioned identity, that alone would not normally be enough to access the account. The attacker would still have to pass the MFA challenge required by the platform.</p><p>But there was nothing to worry about — the provisioning flow had already handed us a valid authenticated session.</p><p>The session token returned when the identity was provisioned could be used directly to establish an authenticated session, without going through the normal login flow. As a result, no MFA challenge was ever required.</p><p>This is important because the token was not merely allowing access to the account before email verification. It effectively provided an already-authenticated session outside the authentication flow where MFA was enforced.</p><p>So, in this target, the attacker did not just end up with credentials for an unverified account. The provisioning flow gave them <strong>attacker-controlled credentials and a ready-to-use authenticated session</strong>, completely sidestepping the MFA enforcement that would otherwise have protected the account. This is where the two issues meet.</p><p>And in the actual invitation scenario, this meant that before the legitimate owner had ever interacted with the platform, the attacker already had everything needed to use the newly provisioned identity: credentials they controlled, an authenticated session, and no MFA challenge standing in the way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84ee9dd2263c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>