<?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 Ali Saadi on Medium]]></title>
        <description><![CDATA[Stories by Ali Saadi on Medium]]></description>
        <link>https://medium.com/@ali_saadi?source=rss-8051e3982aa9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ncV3tms0-n7egyjjh2_01g.jpeg</url>
            <title>Stories by Ali Saadi on Medium</title>
            <link>https://medium.com/@ali_saadi?source=rss-8051e3982aa9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 05:02:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ali_saadi/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[Zero-Click Account Takeover: The Power of JavaScript Analysis]]></title>
            <link>https://medium.com/@ali_saadi/zero-click-account-takeover-the-power-of-javascript-analysis-4f1d4fc36a00?source=rss-8051e3982aa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f1d4fc36a00</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Ali Saadi]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 14:42:13 GMT</pubDate>
            <atom:updated>2025-07-22T17:23:57.458Z</atom:updated>
            <content:encoded><![CDATA[<p>Since this is my first article here, let me quickly introduce myself: <br>I’m Ali Saadi, a full-stack web developer, web security researcher, and a law student from the land of the first written letters.</p><p>Alright, that’s enough about me, let’s talk about how I managed to take over any user’s account on a highly sensitive web application without the user clicking a single thing.</p><p>For the most part, I’m not really a recon guy, I only do recon when I absolutely have to. Usually, I just like to hop on the main domain and start hacking. And guess what? Most of the time, I actually find some pretty cool stuff.</p><p>This time, my target was a highly sensitive web application. But keep in mind, while the vulnerability has been fixed since February, the report hasn’t been publicly disclosed yet, so I can’t share the program’s name. The program had a bunch of domains, so, as usual, I picked one and started messing around with the main domain.</p><p>While going through requests in Burp history, trying to understand the authentication mechanism, I noticed the web app was encrypting the request body for important actions like login, sign-up, reset-password, etc., before sending it to the backend. Maybe to stop script kiddies, who knows?</p><p>Since the encryption was done client-side, I downloaded some JavaScript files and spent hours digging through minified JS like a freak, trying to understand the encryption algorithm and maybe even find the encryption key.</p><p>After hours of sifting through thousands of lines of minified JS, I found a very interesting piece of code…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUi6qV2VqmiZoBPzS2PJOA.png" /><figcaption>lookin scary?…</figcaption></figure><p>Voila! Now, you might be thinking, “Ali, what the hell is even that?”<br>So let me break it down for you…</p><p>This code handles password resets. It’s triggered when you visit the password reset page at:<br>“<a href="https://www.redacted.com/some-path/resetpassword?uuid=password-reset-token`"><strong>https://www.redacted.com/some-path/resetpassword?uuid=password-reset-token</strong></a><strong>”</strong> and submit the form with a new password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZPGM0SYi1FYD4HLYLu1gw.png" /></figure><p>Now, let’s take a closer look at this part of the code:</p><pre>const z = v.password;<br>const xe = localStorage.getItem(&quot;loggedInApplicantUser&quot;); <br>this.userInfo = JSON.parse(xe); <br>const je = this.userInfo?.userName;</pre><h4>Here’s what’s happening:</h4><ul><li>“<strong>v.password</strong>” is just pulling the new password value from the form, then saving it in a variable called “<strong>z</strong>”.</li><li>Then it grabs a value from “<strong>localStorage</strong>” called <br>“<strong>loggedInApplicantUser</strong>”. That value is expected to be a JSON string, so it gets parsed.</li><li>And finally, it pulls out the “<strong>userName</strong>” field from that parsed object and stores it in a variable called “<strong>je</strong>”.</li><li>After some digging, I found out that “<strong>userName”</strong> here actually refers to the email of the account, not a traditional username.</li></ul><p>Keep “<strong>z</strong>” and “<strong>je</strong>” in mind, you’ll need them to understand the next part.</p><h4>Now for the juicy part “null == this.uUID ? … : …”</h4><p>This is where things get interesting…</p><p>In <strong>JavaScript</strong>, this is called a ternary operator, basically a mini if-else. It checks if “<strong>this.uUID”</strong> is null:</p><ul><li>If “<strong>this.uUID”</strong> is null (or undefined): <br>this is the case for when you visit the password reset url without providing a password reset token. For example,<br>“<a href="https://www.redacted.com/some-path/resetpassword?uuid=`"><strong>https://www.redacted.com/some-path/resetpassword?uuid=</strong></a>”<br>in this case, the web app would call “<strong>resetPasswordForApp(z, je)” </strong>and pass the new password as “<strong>z</strong>” and the “<strong>userName</strong>”<strong> </strong>as “<strong>je</strong>” to it.</li><li>If “<strong>this.uUID</strong>” is NOT null:<br> That means a password reset token was provided in the URL (as uuid), for example,<br>“<a href="https://www.redacted.com/some-path/resetpassword?uuid=acde070d-8c4c-4f0d-9d8a-162843c10333`"><strong>https://www.redacted.com/some-path/resetpassword?uuid=acde070d-8c4c-4f0d-9d8a-162843c10333</strong></a>”<br>in this case, the web app would call “<strong>resetPassword(z, this.uUID)</strong>” and pass the new password as “<strong>z</strong>” and the “<strong>uUID</strong>” to it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VlPLYRo1cIxJ7Ap4zz7c3w.png" /><figcaption>ternary operator — simpler example</figcaption></figure><p><strong>Have you spotted the vulnerability yet?</strong><br>What if we manipulate “<strong>localStorage</strong>” and insert the victim’s email as the “<strong>userName</strong>”, then visit the password reset page without a “<strong>uuid</strong>”?</p><p>Like this:<br>“<a href="https://www.redacted.com/some-path/resetpassword?uuid=`"><strong>https://www.redacted.com/some-path/resetpassword?uuid=</strong></a>”</p><p>Well… that’s exactly what I did.<br>And yeah, it worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IP5KjZeORPOaMKm7P9TCew.png" /><figcaption>Adding values to local storage</figcaption></figure><p>I opened DevTools in the browser and added the following values:</p><pre>&quot;key&quot; : &quot;loggedInApplicantUser&quot;<br>&quot;value&quot; : {&quot;userName&quot;: &quot;victim&#39;s email&quot;}</pre><p>then navigated to “<a href="https://www.redacted.com/some-path/resetpassword?uuid=`"><strong>https://www.redacted.com/some-path/resetpassword?uuid=</strong></a>” (notice the uuid is empty). typed in a new password, submitted the form, and received a 200 response with the message “<strong>Password updated for user victim_email</strong>”. simple, isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*_OFQHGVOrLQszlh-t4uOUg.png" /></figure><p>I also found several user IDs being leaked in the Wayback Machine, which could be used to enumerate emails. I reported the whole thing as Critical, but the security team had a different opinion and closed it as Medium, stating the attack complexity was high, since an attacker would need to know the victim’s email address</p><p>I requested disclosure back in February but didn’t receive a response until July. The program refused to disclose the report, so I decided to share the technical details of the vulnerability without mentioning the program name or including anything that could lead to it.</p><p>Please keep in mind that this was reported almost a year ago. I rarely do VDPs now, and when I do, it’s either automation, or for research purposes and trying out new techniques.</p><p>Now, you might be thinking…</p><blockquote>Ali, what happened to that whole ‘understanding the encryption algorithm’ and ‘finding the encryption key’ thing?</blockquote><p>Well… after reporting this, I had to go to court for summer practice. <br>And after a while, let’s just say I either forgot about it… <br>or maybe just lost the passion for a bit (:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8qxs2l4WNXrhONgz1Wliw.jpeg" /></figure><p>I came back after a while and started hacking on other programs, specifically a Chinese company. and, well, let’s just say I got scammed. But that’s a story for another day. as for now, have a good day.</p><p><strong>Final Disclaimer:</strong><br> This post is shared in accordance with the platform’s guidelines. No identifying information or exploit paths are included, and the vulnerability is no longer reproducible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f1d4fc36a00" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>