<?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 Ahmed Mahmoud  on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Mahmoud  on Medium]]></description>
        <link>https://medium.com/@ahmed.mahmoud.infosec?source=rss-5f48a0a68c12------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SuITA53p9lE9PgfR</url>
            <title>Stories by Ahmed Mahmoud  on Medium</title>
            <link>https://medium.com/@ahmed.mahmoud.infosec?source=rss-5f48a0a68c12------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:32:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahmed.mahmoud.infosec/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 a Race Condition Broke an Organization’s Member Limit]]></title>
            <link>https://medium.com/@ahmed.mahmoud.infosec/how-a-race-condition-broke-an-organizations-member-limit-b07e1c2cacd1?source=rss-5f48a0a68c12------2</link>
            <guid isPermaLink="false">https://medium.com/p/b07e1c2cacd1</guid>
            <category><![CDATA[race-condition]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ahmed Mahmoud ]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 19:08:11 GMT</pubDate>
            <atom:updated>2026-11-25T19:23:07.293Z</atom:updated>
            <content:encoded><![CDATA[<p>Business logic vulnerabilities aren’t always caused by a flawed validation rule. Sometimes, the rule itself is correct, but the way the application enforces it under concurrent execution makes it possible to bypass it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*o52eJRsCadcC2qMCUW5m2w.png" /></figure><p>During an authorized security assessment, I was investigating an organization’s invitation functionality, where an account was restricted to inviting only one additional member. Under normal conditions, the application appeared to enforce this limit correctly, so I decided to investigate how it behaved when multiple invitation requests were processed simultaneously.</p><p>I logged in as the organization owner, verified the configured member allowance, and captured an invitation request using Burp Suite Repeater. I then prepared multiple requests targeting different invitees and used Repeater’s Single Packet Attack to synchronize their execution, allowing them to reach the application within the same time window.</p><p>The application processed multiple invitations despite the account’s restriction. To verify that this wasn’t limited to the creation of pending invitations, I accepted the invitations through the invited accounts and checked the resulting organization membership.</p><p>The result was clear: multiple invited accounts successfully joined the organization, exceeding the original member allowance.</p><h3>Understanding the Race Condition</h3><p>This behavior is consistent with a Time-of-Check to Time-of-Use (TOCTOU) race condition, in which multiple concurrent operations interact with shared state before a security-critical restriction is effectively enforced.</p><p>Conceptually, the workflow may look like this:</p><pre>[Request A]                  [Request B]<br><br>Check member limit           Check member limit<br>Limit available              Limit available<br>Create invitation            Create invitation</pre><p>If both requests evaluate the same shared state before either operation updates the state in a way that affects the other, both may pass the validation.</p><p>The problem isn’t that the application lacks a member-limit check. It’s that the enforcement of this constraint doesn’t appear to be atomic under concurrent execution.</p><h3>Impact</h3><p>The demonstrated impact was the ability to exceed the organization’s intended member invitation restriction.</p><p>Depending on how membership limits are tied to subscription plans, licensing, or organizational policies, this type of vulnerability may undermine server-side enforcement of account restrictions.</p><p>In this case, I verified that multiple invited accounts successfully joined the organization despite the original allowance, confirming that the restriction could be exceeded through concurrent invitation requests.</p><h3>Remediation</h3><p>The member-limit validation and the operation that modifies the relevant membership or invitation state should be protected by an atomic enforcement mechanism.</p><p>Depending on the application’s architecture, this could be achieved through database transactions with appropriate locking, atomic reservation of member slots, or other mechanisms that ensure concurrent requests cannot independently pass the same restriction.</p><p>The enforcement should also remain consistent across the invitation and acceptance workflows, preventing concurrent operations from collectively violating the member limit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b07e1c2cacd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turning a GraphQL Aliasing Quirk into a Fully Reproducible Denial-of-Service Attack]]></title>
            <link>https://medium.com/@ahmed.mahmoud.infosec/turning-a-graphql-aliasing-quirk-into-a-fully-reproducible-denial-of-service-attack-03efec109a5a?source=rss-5f48a0a68c12------2</link>
            <guid isPermaLink="false">https://medium.com/p/03efec109a5a</guid>
            <category><![CDATA[dos-attack]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Ahmed Mahmoud ]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 14:45:57 GMT</pubDate>
            <atom:updated>2026-09-28T19:56:05.330Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>الحمد لله رب العالمين، والصلاة والسلام على نبينا المجاهد الشهيد، وعلى آله وصحبه ومن جاهد جهاده إلى يوم الدين</strong></p><h3>Summary</h3><p>While testing the “Forgot Password” flow on New Balance’s site, I found that its GraphQL API allowed the commerce_requestPasswordResetEmail mutation to be repeated multiple times within a single HTTP request, using GraphQL&#39;s built-in aliasing feature. Each alias was resolved as a fully independent server-side operation — no batching, no deduplication, no cost limiting. By modeling the relationship between alias count and response time, I was able to calculate — not guess — the exact request size needed to exceed the server&#39;s upstream timeout, and reliably reproduce a full outage of the endpoint (503 Service Unavailable) on demand, as an unauthenticated user.</p><p>This write-up walks through the process the way it actually happened — including the moments where I wasn’t sure the finding would go anywhere, and the reasoning that got it from “interesting” to “provable.”</p><p>Here’s the finding as it appears on Bugcrowd, accepted with a P2 classification:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEn9Jq-FG3zqxSi02_Pf5g.jpeg" /></figure><p><strong>Target:</strong> <strong>New Balance</strong></p><h3>Background: what is mutation aliasing?</h3><p>GraphQL allows a client to request the same field or mutation multiple times in a single operation, as long as each instance is given a unique alias:</p><p>graphql</p><pre>mutation {<br>  r1: commerce_requestPasswordResetEmail(email: &quot;attacker@example.com&quot;)<br>  r2: commerce_requestPasswordResetEmail(email: &quot;attacker@example.com&quot;)<br>  r3: commerce_requestPasswordResetEmail(email: &quot;attacker@example.com&quot;)<br>}</pre><p>This is a legitimate, documented feature — it exists so a client can fetch or mutate several distinct resources in one round trip. Nothing about it is inherently dangerous. The question that started this whole investigation was much simpler than “is this a vulnerability”: it was just <em>“what happens if I alias the same mutation instead of different ones?”</em></p><h3>Step 1 — Poking at the password-reset flow</h3><p>I started, like most people testing a password-reset feature, by just intercepting the normal request in Burp Suite. Nothing unusual on the surface: a POST /graphql request carrying the commerce_requestPasswordResetEmail mutation, completing in a fairly ordinary <strong>~376 ms</strong>.</p><p>At that point I had no specific hypothesis about DoS. I was mainly curious whether the API validated <em>how</em> a mutation was structured, or only <em>what</em> it contained. Aliasing was the natural thing to try — it’s one of those GraphQL features that quietly extends what a “single request” can actually do, and APIs don’t always account for that.</p><h3>Step 2 — The first sign something was off</h3><p>I sent a request with five aliases of the same mutation, all pointing at the same email. Response time: <strong>~1,307 ms</strong>. That alone didn’t excite me — plenty of things add latency for harmless reasons, and one data point proves nothing.</p><p>What made me pay attention was doing it again at 10 and 15 aliases and watching the number climb in a way that didn’t look random:</p><ul><li><strong>1 alias:</strong> ~376 ms</li><li><strong>5 aliases:</strong> ~1,307 ms</li><li><strong>10 aliases:</strong> ~2,313 ms</li><li><strong>15 aliases:</strong> ~3,553 ms</li></ul><p>At this point the thought in my head shifted from “huh, that’s slower” to “this looks like it might scale in a predictable way — and if it does, that changes everything about how strong this finding can be.”</p><h3>Step 3 — Turning a hunch into a model</h3><p>This is the step I think matters most, and it’s the one that’s easiest to skip if you’re in a hurry to write up a report. Instead of just describing the delay, I treated it as a cost function:</p><pre>response_time ≈ base_time + (aliases × cost_per_alias)</pre><p>Fitting the four measured points gives a <strong>base_time of roughly 150–200 ms</strong> and a <strong>cost_per_alias of roughly 220–230 ms</strong>, and the fit is close to perfectly linear across every point I measured.</p><p>The reason I cared so much about linearity specifically: a linear, unbounded cost function has no ceiling. If the model held, there had to exist some alias count <em>n</em> large enough that response_time would exceed whatever timeout sat upstream of this service. And if I could predict <em>n</em> mathematically, I wouldn&#39;t need to stumble onto the failure by accident — I could go looking for it directly.</p><p>That was the moment this stopped feeling like a “maybe” and started feeling like something I could actually prove.</p><h3>Step 4 — Testing the prediction</h3><p>Using the model, I picked a much larger alias count — 100 — expecting it to land well past the threshold where things would start to break.</p><p>The result matched what the numbers had been suggesting the whole time:</p><ul><li><strong>Response time:</strong> ~15,838 ms</li><li><strong>Result:</strong> HTTP/2 503 Service Unavailable</li><li><strong>Upstream response:</strong> first byte timeout</li></ul><p>Seeing that response come back was the clearest moment in the whole process. Up until then, everything was “slower than before.” This was the server refusing to answer at all. That’s the exact line between “elevated latency” and an actual denial of service.</p><h3>Step 5 — The question I couldn’t skip: is this real execution?</h3><p>Right after getting the 503, the obvious follow-up question was whether the server was really <em>running</em> the mutation 100 times, or just spending time parsing a large query document without doing anything meaningful per alias. If it was the latter, the finding would be much weaker — a parsing cost issue, not a business-logic execution issue.</p><p>To settle this cleanly, I sent a single request with 50 aliases of the mutation, all pointing at an email address I controlled, and watched the inbox.</p><p><strong>50 separate password-reset emails arrived — one per alias.</strong></p><p>That was the confirmation I needed. Each alias wasn’t just counted or parsed; it was fully executed as its own independent operation, with its own side effect. At that point I was confident this was a complete, reproducible finding rather than a theoretical concern.</p><h3>Impact</h3><ul><li><strong>Single-request amplification</strong> — one HTTP request was enough to produce the full effect; this isn’t a volumetric, many-requests attack, which is exactly what makes it easy to miss with request-count-based defenses.</li><li><strong>Resource exhaustion</strong> — each alias independently consumed backend CPU cycles and thread allocation on the password-reset resolver.</li><li><strong>Availability impact</strong> — sustained exploitation could deny password-reset functionality to legitimate users, and potentially degrade other operations sharing the same backend resources.</li></ul><h3>Remediation guidance</h3><p>For teams running GraphQL APIs, the practical mitigations here are well established:</p><ol><li><strong>Cap the number of aliases</strong> allowed per operation — most GraphQL servers and gateways support this natively.</li><li><strong>Enforce query cost analysis</strong>, not just query depth limits — assign a computational cost to each field/mutation and reject requests exceeding a budget.</li><li><strong>Rate-limit at the operation level</strong>, not just the HTTP-request level, since a single HTTP request can contain many logical operations.</li><li><strong>Apply the same scrutiny to unauthenticated mutations</strong> as authenticated ones — this endpoint required no login, which removed the usual friction of per-account rate limits.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03efec109a5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>