<?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 Hussein Mahmoud on Medium]]></title>
        <description><![CDATA[Stories by Hussein Mahmoud on Medium]]></description>
        <link>https://medium.com/@hussein-mahmoud7?source=rss-14502f37c5f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oOhc8aABAgE4uMWvS3GgCw.jpeg</url>
            <title>Stories by Hussein Mahmoud on Medium</title>
            <link>https://medium.com/@hussein-mahmoud7?source=rss-14502f37c5f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:46:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hussein-mahmoud7/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[CVE-2026–82019: How a Random Ad Led to DOM XSS While Testing chess.com]]></title>
            <link>https://hussein-mahmoud7.medium.com/cve-2026-82019-how-a-random-ad-led-to-dom-xss-while-testing-chess-com-f043584e1e68?source=rss-14502f37c5f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f043584e1e68</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Hussein Mahmoud]]></dc:creator>
            <pubDate>Sat, 12 Sep 2026 11:38:09 GMT</pubDate>
            <atom:updated>2026-09-12T11:38:09.394Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-q72iGxLOL9oHd1ZPGJWw.png" /><figcaption>XSS POC</figcaption></figure><h3>Introduction</h3><p>I play a lot of chess on <a href="http://chess.com/">Chess.com</a>, with a rating around 2000, so I already spend a lot of time on the website.<br>At that time, I had just finished studying postMessage vulnerabilities on PortSwigger Web Security Academy, and I wanted to practice what I learned on a real target.</p><p>I was using this regex to quickly find message handlers inside JavaScript files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wli8iveJxCcXM-MLSByqbA.png" /><figcaption>Postmessege Regex</figcaption></figure><p>While testing <a href="http://chess.com/">Chess.com</a>, an advertisement loaded and one script appeared: video-bundle.js<br>The script belonged to TripleLift.<br>I was not hunting the vendor. The ad simply appeared while I was testing postMessage.<br>I searched the script for message handlers, found an interesting one, and started following the data. That was the beginning of the bug.<br>The interesting part was that this advertisement had to win the ad auction first. On another page load, the script might never have appeared.</p><h3>Chapter 1: Finding the Vulnerable Handler</h3><p>Inside the vendor script, I found this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lj3QEp5nUSlXMG4ucI7s5A.png" /><figcaption>Vulnerable Code</figcaption></figure><p>The first thing I checked was event.origin. There was no validation.<br>The handler checked what the message contained, but not where the message came from. So an attacker-controlled page could send a message to it.<br>Then I followed e.data and reached the important sink:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wTonCFxqW2UnqLWqr2cFhw.png" /><figcaption>Vulnerable Sink</figcaption></figure><p>The message data was placed directly inside a script element and appended to the document. So the flow was simple:</p><p><strong>Attacker page -&gt; postMessage() -&gt; No origin validation -&gt; event.data -&gt; script.textContent -&gt; JavaScript execution.</strong></p><p>The handler required one of a few expected strings, so a harmless PoC was enough (using the string get_ext). Finding the XSS was simple. Making it reliable was harder.</p><h3>Chapter 2: Why the PoC Worked Randomly</h3><p>At first, sometimes the PoC worked and sometimes nothing happened. The problem was not the payload. It was the ad lifecycle. The vulnerable environment was only available after the affected ad won the auction:</p><p><a href="http://chess.com/"><strong>Chess.com</strong></a><strong> loads -&gt; Ad auction starts -&gt; Affected ad wins -&gt; Frame is created -&gt; Message listener becomes active.</strong></p><p>I also noticed that using a US IP made the required advertisement appear more often during my testing. There was another important condition where only the first matching message would be processed.</p><p>I could not know exactly when the vulnerable frame and listener were ready. So instead of trying to guess the timing, I repeatedly sent the same harmless message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOjzR3Uw0TQN3r9X12-geg.png" /><figcaption>Race Condition POC</figcaption></figure><p>This was not a bypass for thirdPartyMessage. I was simply keeping the payload ready until the correct frame existed and the listener became active. Once that happened, one of the messages reached the handler.</p><h3>Chapter 3: The Same XSS, Different Impact</h3><p>After confirming the issue, I started checking the same script on other publisher integrations. One of the affected places I observed was the Yahoo homepage.<br>This was interesting because the same vulnerable script did not always have the same impact. Some publishers isolated advertisements using SafeFrame or sandboxed iframes. In those cases, the JavaScript execution stays isolated.</p><p>The environment I observed while testing <a href="http://chess.com/">Chess.com</a> behaved differently. The JavaScript execution could reach the publisher page context instead of staying only inside an isolated advertisement environment.<br>The bug was inside a third-party advertising script, not <a href="http://chess.com/">Chess.com</a>’s own code, but the way each publisher integrated the script affected the final impact. That was a good example of defense in depth.</p><h3>Chapter 4: The Root Cause</h3><p>There were two problems. The first was trusting postMessage without validating the sender. A message handler should validate the expected origin.</p><p>But origin validation was only part of the problem. The more dangerous design was turning trusted message data directly into executable JavaScript.<br>So the fix needed both: Validate the sender and never directly execute message-controlled data.</p><h3>Chapter 5: Reporting It Without a Bug Bounty Program</h3><p>Finding the vulnerability was only one problem. I also had no idea where to report it. The company did not have a public Bug Bounty program, and I could not find a security contact or a clear security email.<br>So I went to LinkedIn, searched for the company, and contacted three employees. One of them replied and gave me the correct security email.</p><p>I sent the vulnerability details to the security team. Even though they did not operate a Bug Bounty program, they appreciated the research and decided to reward the report.<br>On April 14, 2026, I received a $500 bounty. It became my first paid bug bounty.<br>The fix was deployed to production on April 28, 2026.<br>Then, a few months later, on August 28, 2026, the vulnerability was assigned: <strong>CVE-2026–82019</strong>.</p><p>The issue was classified as:</p><ul><li>DOM-based Cross-Site Scripting — CWE-79</li><li>CVSS 3.1: 4.2 — Medium</li></ul><h3>Conclusion</h3><p>What I like most about this bug is how it started. I had just studied postMessage on PortSwigger, and instead of moving immediately to another topic, I spent time applying what I learned on real websites.<br>That is probably the biggest lesson I took from it: <strong>After studying a vulnerability, apply it immediately.</strong> Don’t study XSS today, move to CSRF tomorrow, then SSRF the day after.</p><p>Spend a week or two on one vulnerability. Learn different techniques, hunt for it on real targets, read JavaScript, build PoCs, and keep testing until the idea becomes natural.<br>That is how the things you study actually stay in your head. And sometimes, a random advertisement is enough to turn that practice into your first bounty and a CVE..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqM7sa4_emBb9QM3mNxCDQ.png" /><figcaption>Bounty</figcaption></figure><p><strong>Researcher:</strong> Hussein-Mahmoud7<br><strong>CVE:</strong> CVE-2026–82019</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f043584e1e68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escalating an Out-of-Scope HTML Injection to a Critical 9.3 XSS (WAF Bypass)]]></title>
            <link>https://hussein-mahmoud7.medium.com/escalating-an-out-of-scope-html-injection-to-a-critical-9-3-xss-waf-bypass-12b194d6a1df?source=rss-14502f37c5f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/12b194d6a1df</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Hussein Mahmoud]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 20:05:09 GMT</pubDate>
            <atom:updated>2026-03-14T20:05:09.517Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWM8w7OWOWEJsn0qCQXKOQ.png" /></figure><h4>How keeping a browser tab open for 2.5 months helped me bypass a strict WAF using WebKit and String Concatenation.</h4><h4>Introduction</h4><p>In Bug Bounty, patience is your best weapon. Sometimes you find a bug, but it is useless. You have to push harder to make it count. This is the story of how I found a simple, out-of-scope bug, got blocked by a strict WAF, waited for 2.5 months to learn new skills, and finally escalated it to a Critical 9.3 Reflected XSS.</p><h4>Chapter 1: The Out-of-Scope Bug &amp; The WAF Wall</h4><p>It started in mid-December. I was hunting on a government VDP (target.com). I tested an endpoint and noticed the q.LIKE parameter was reflecting my input.</p><p>A quick test showed that <strong>HTML Injection</strong> was possible. But there was a big problem: The program policy clearly stated that HTML Injection is <strong>Out of Scope</strong>. To get a valid report, I had to escalate it to Cross-Site Scripting (XSS).</p><p>I tried a simple &lt;script&gt;alert(1)&lt;/script&gt;. <em>Blocked.</em> The target was protected by a very aggressive AWS WAF. Worse, the WAF had a strict ban system. Every time it caught a bad payload, it blocked my IP for 5 minutes. Back then, I didn&#39;t know how to use IP rotation. Testing manually with 5-minute bans was impossible.</p><p>I hit a wall. But I didn’t close the tab. I left it open in my browser and went to study.</p><h4>Chapter 2: The 2.5 Months Break &amp; Leveling Up</h4><p>For two and a half months, that tab stayed open. During this time, I focused on learning. I studied advanced XSS techniques and, most importantly, I learned how to set up <strong>IP Rotation</strong> in Burp Suite.</p><p>With IP rotation, the 5-minute WAF ban would no longer stop me. I was ready to go back to my target.</p><h4>Chapter 3: The PortSwigger Methodology</h4><p>I decided to test the WAF step by step, using the methodology I learned from PortSwigger’s Web Security Academy.</p><p><strong>Step 1: Fuzzing HTML Tags</strong> First, I needed to know what tags the WAF allowed. I sent the request to Burp Intruder with a list of HTML tags (&lt;svg&gt;, &lt;body&gt;, &lt;a&gt;, &lt;video&gt;, etc.). The WAF was strict, but it allowed the &lt;video&gt; tag.</p><p><strong>Step 2: Fuzzing Event Handlers</strong> Having a tag is not enough. I used Burp Intruder again to fuzz JavaScript event handlers inside the &lt;video&gt; tag (like onload, onerror).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4v9TXyvr_oylGBpofx1bbg.png" /><figcaption>Burp intruder</figcaption></figure><p>Almost all of them were blocked. But suddenly, I got a 200 OK response on one specific event handler: onwebkitpresentationmodechanged. The WAF developers blocked standard handlers but forgot this WebKit-specific (Safari) event!</p><h4>Chapter 4: The Final Bypass (String Concatenation)</h4><p>I had the &lt;video&gt; tag and the onwebkitpresentationmodechanged event. Now, I needed to run JavaScript.</p><p>But the WAF was still checking my code. If I wrote window.location or javascript:alert(1), I got blocked. To bypass this, I used <strong>String Concatenation</strong>. I split the blocked words into smaller pieces so the WAF couldn&#39;t read them.</p><p>Instead of window.location, I wrote: window[&#39;loca&#39;+&#39;tion&#39;].</p><p>To make the real payload completely hidden from the WAF, I used the window.name trick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*rqP_bieNPICoa8SmiNDvkA.png" /><figcaption>xss.report</figcaption></figure><p><strong>The Final Attack Chain:</strong></p><ol><li>I created a malicious HTML page that sets: window.name = &quot;javascript:alert(document.domain)&quot;.</li><li>My page redirects the victim to the vulnerable URL.</li><li>The injected payload looked like this: ...&lt;video/controls/src=&quot;...&quot;/onwebkitpresentationmodechanged=&quot;window[&#39;loca&#39;+&#39;tion&#39;]=window[&#39;na&#39;+&#39;me&#39;]&quot;&gt;&lt;/video&gt;...</li><li>When a Safari user plays the video or enters Picture-in-Picture mode, the WebKit event triggers.</li><li>The browser executes the payload hidden inside window.name.</li></ol><h4>Conclusion</h4><p>I submitted the full report to YesWeHack. The triage team validated the WAF bypass and accepted the report with a <strong>Critical Severity (CVSS 9.3)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWM8w7OWOWEJsn0qCQXKOQ.png" /></figure><p><strong>The Lesson:</strong> If you find a bug that is Out of Scope, don’t give up. If you hit a WAF, take a step back, learn new skills, and come back stronger. Never close that tab!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12b194d6a1df" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>