<?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 a-shams on Medium]]></title>
        <description><![CDATA[Stories by a-shams on Medium]]></description>
        <link>https://medium.com/@a-shams?source=rss-a176084c5ca5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2NKPhkjuqQQIWKjkru2Zhg.jpeg</url>
            <title>Stories by a-shams on Medium</title>
            <link>https://medium.com/@a-shams?source=rss-a176084c5ca5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:08:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a-shams/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 an AWS Cognito Misconfiguration Led to Full Organization Account Compromise]]></title>
            <link>https://medium.com/@a-shams/how-an-aws-cognito-misconfiguration-led-to-full-organization-account-compromise-5c9f6983e1a4?source=rss-a176084c5ca5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c9f6983e1a4</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[amazon-cognito]]></category>
            <dc:creator><![CDATA[a-shams]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 19:53:21 GMT</pubDate>
            <atom:updated>2025-12-26T19:53:21.208Z</atom:updated>
            <content:encoded><![CDATA[<p><em>written by </em><a href="https://www.linkedin.com/in/abdalrhman77shamseldin/"><strong>Abdelrhman Shamseldin</strong></a><strong> .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*IM2mhn4DKv3WJpX6ccOTjA.png" /></figure><p>While hunting on a private bug bounty program on HackerOne, I discovered a critical security flaw in a platform using AWS Cognito for authentication. By combining a flawed email update process with a domain-based authorization model, an attacker could change their registered email to one belonging to any organization using the platform, resulting in full account takeover and access to all sensitive company data without verification.</p><h3>The Hunt</h3><p>From the program scope, I started with: https://portal.redacted.com which is only a login page (supports Google SSO or email/password).</p><p>After i tried logging in with a Google account, I consistently got an error: <strong>“organization not found” </strong>from the application.</p><p>That error looked like an application-level tenant lookup failure (not an authentication failure), so i opened Burp Suite and tried the login flows again.</p><p>While watching the HTTP history, I noticed requests going to a separate auth subdomain:<a href="https://auth.dev.portal.redacted.com/...">https://auth.dev.portal.redacted.com/login...</a>, This looked like a Cognito authentication frontend (OAuth redirects, callback handling, etc.). I also found a simple registration path by changing the URL endpoint from “login” to “signup”, Which led me to a basic signup page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*vXYUCqXU-j4ONlB4MR4q8w.png" /></figure><p>I registered a fresh account using a normal email and completed verification via the code sent to my inbox, So far, everything looked standard.</p><p>I tried logging in again. Same error: “Organization not found.” But this time, the authentication flow was clearer, requests were hitting Amazon Cognito Identity Provider endpoints.</p><h3>Learning Cognito’s Weak Points</h3><p>I paused and dove into research. AWS Cognito is widely used but often misconfigured. A few excellent write-ups (like <a href="https://shellmates.medium.com/amazon-cognito-misconfiguration-35dfde9e2037">this</a> and <a href="https://medium.com/@AashisMhj5511/understanding-authentication-flow-in-aws-cognito-54aba4110333">this</a>) outlined common risks: exposed client_id, region info in requests, and sensitive endpoints like AWSCognitoIdentityProviderService.</p><p>From the login request, I had:</p><ul><li>client_id</li><li>Region</li><li>Only missing an access_token</li></ul><p>The platform’s behavior was as follow: it would log me in, issue an access_token, then immediately revoke it and log me out “because my email wasn’t linked to an organization”.</p><h3>Intercepting the Token</h3><p>With Burp, I stopped the request chain right after authentication but before the revocation call. Now I had a valid Cognito access_token. Using the AWS CLI for Cognito-idp, I started testing available operations.</p><p>Research into common Cognito misconfigurations highlighted the update-user-attributes action as a prime target. I crafted a request to change my account&#39;s email address:</p><pre>$ aws cognito-idp update-user-attributes — region us-east-1 — access-token eyJraW****** — user-attributes ‘Name=email,Value=test@example.com</pre><p>and The request succeeded <strong>without sending a verification code to the new email</strong>:</p><pre>{<br>“CodeDeliveryDetailsList”:[<br><br>{<br>“Destination”:”t***@e***”,<br>“DeliveryMedium”:”EMAIL”,<br>“AttributeName”:”email”<br>}<br>]<br>}</pre><p>Next i tried changing my email to “name@redacted.com”which i saw earlier in a JavaScript source file , I logged in again.<br>This time no “Organization not found.”<br>Instead, I was inside the redacted.com organization portal, with full access to dashboards, analytics, reports, and sensitive business intelligence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glQkvvHwy-_eR0-A-BegUg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDgSrrsTx3TQD0rv4rxLOw.jpeg" /></figure><p>The platform trusted Cognito’s email attribute blindly and used it as the only mechanism for organization mapping. No secondary verification, no alerting, no session invalidation after email change.</p><p>Next, when I used an email from the JavaScript source file that appeared to be higher-privileged (likely admin), the portal showed me a <strong>list of organizations</strong> to choose from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*7PBzq1vcm3WqwKPyRoFXeg.jpeg" /></figure><p>That indicated the risk wasn’t limited to a single tenant, it could extend to broad org enumeration and targeted access depending on what email identity you could impersonate.</p><h3>Root cause</h3><p>Two problems:</p><ol><li><strong>Cognito misconfiguration:</strong></li></ol><ul><li>The app allowed updating the email attribute in a way that did not enforce (or did not require) re-verification before the new email became authoritative for identity/authorization decisions.</li></ul><p><strong>2. Authorization design issue in the portal:</strong></p><ul><li>Organization access was based only on <strong>email domain</strong>, rather than a secure server-side membership model.</li></ul><h3>Timeline / program handling</h3><ul><li>I submitted the report to the private program.</li><li>The program team validated it and resolved it in <strong>~10 days</strong>.</li><li>Severity was initially considered <strong>Critical</strong>, then adjusted to <strong>High</strong>, and a bounty was awarded.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*k71SMxz3nb3iyKn6RQ0aNw.png" /></figure><h3>Closing notes</h3><p>This was a fun chain because nothing looked “broken” at first, But the combination of a Cognito misconfiguration, and domain-based tenant logic created a clean escalation path.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c9f6983e1a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[stupidly easy 0-click ATO and PII disclosure.]]></title>
            <link>https://medium.com/@a-shams/stupidly-easy-0-click-ato-and-pii-disclosure-4f8a3f3e5d55?source=rss-a176084c5ca5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f8a3f3e5d55</guid>
            <dc:creator><![CDATA[a-shams]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 23:49:51 GMT</pubDate>
            <atom:updated>2025-12-26T20:03:01.800Z</atom:updated>
            <content:encoded><![CDATA[<h3>0-click ATO and PII disclosure</h3><p>Hi my name is Abdelrahman and this is my first write up ever, i want to share 2 <strong>critical</strong> vulnerabilities i found recently in a <strong>VDP</strong> that i was hunting on.</p><h4><strong>The recon process :</strong></h4><p>we can refer to the program as <strong>redacted<em>.</em>com, </strong>the scope was all the company online assets, i started with google dorks, for example i used : <strong>site:*.redacted.* © redacted. All rights reserved </strong>, i found about 15 different domains.</p><p>next i used <strong>subfinder</strong> for passive subdomain enumeration and for subdomain brute forcing i used <strong>knockpy</strong> and <strong>gobuster</strong>, after that i took screenshots of all alive subdomains using <strong>eyewitness.</strong></p><p>while i was reading <strong>eyewitness</strong> report i noticed new subdomains in one of the response headers and one of them was <a href="https://uat-portal.aon.co.za/views/loginRegistration/NewCllentRegistration.html?client=new&amp;loginProfile=Business"><strong>uat-portal</strong></a><strong>.redacted.co</strong>, my first bug ever was <strong>SQLi</strong> in a <strong>UAT</strong> (<strong>user acceptance testing</strong>) subdomain so i knew i had to check this one.</p><h4><strong>First bug : PII disclosure :</strong></h4><p>I opened <strong>burpsuite</strong> in background and created two new accounts in the website, so after logging in i opened my profile and went to burp, i noticed the endpoint that handle the authorization and user info is /<strong>ExecuteService</strong>, simply all the requests body was in <strong>Json</strong> format and it consists of an api service key which is a function name and some parameters, it looked like this :</p><pre>{&quot;d&quot;:&quot;{\&quot;ApiServiceKey\&quot;:\&quot;function_name\&quot;,\&quot;InputParams\&quot;:{\&quot;parameter_name\&quot;:\&quot;value\&quot;}}&quot;}</pre><p>i found a function called <strong>ValidateMember</strong> which takes the user email address as a parameter and it returns some authorization tokens, one of the tokens is used in another function called <strong>GetMemberDetails</strong> which returns all user data like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*KT2bEC5_VJpfvbJ0EcFLhQ.png" /></figure><p>first i tried replacing the email of the first user in the request body with the second user email, and just like that the function gave me different tokens which i used in the <strong>GetMemberDetails </strong>function and i was able to see all the info of the second user.</p><p>next i removed all the cookies from the request headers and i still get the user info, so i found that this function doesn’t even require authorization, so any unauthenticated attacker can get all <strong>PII</strong> of any user by just knowing their email address.</p><p>My goal in this program was to find one <strong>critical</strong> bug, and sometimes <strong>PII</strong> impact is considered <strong>high</strong> but not <strong>critical</strong> so i decided to continue my exploration.</p><h4><strong>Second bug : 0-click account takeover :</strong></h4><p>for this vulnerability we need to understand the authentication process of this program.</p><p>the website is using <strong>OKTA OAuth 2.0 authorization, </strong>so when you need to login the website redirect you to <strong>OKTA</strong> portal, and after successful login the portal response with a state token which the application assign it to the user email and give them access to their account back in the main application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*JsIy70J6D8dOM0EhqaHWFg.png" /></figure><p>the function that handle this process is called <strong>getUserInfo </strong>and same as in the first vulnerability in this write up, if you replaced the email parameter with any other user email, the application assigns the state token from <strong>OKTA</strong> to that email and give you access to that account.</p><p>next i updated the profile info and changed the email address with the other user email address, and just like that i was able to takeover the account.</p><p>not only that but the application assigns that account to you, so next time when you login it lets you choose between your account and the other account you takeover, also the victim can not access their account any more.</p><p>i stopped here as a 0-click account takeover is considered a <strong>critical</strong> bug and i reported both vulnerabilities to the program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*Jcz7TkZxga_cMATOMwzgDg.gif" /></figure><p>luckily in the PII disclosure the program team changed the impact from <strong>High</strong> to <strong>Critical, </strong>so i end up finding two instead of one.</p><h4><strong>Timeline :</strong></h4><p><strong>May 29, 2024</strong> — both bugs reported.</p><p><a href="https://hackerone.com/bugs?subject=user&amp;report_id=2523776&amp;view=all&amp;substates%5B%5D=editing&amp;substates%5B%5D=pre-submission&amp;substates%5B%5D=new&amp;substates%5B%5D=triaged&amp;substates%5B%5D=needs-more-info&amp;substates%5B%5D=resolved&amp;substates%5B%5D=informative&amp;substates%5B%5D=not-applicable&amp;substates%5B%5D=duplicate&amp;substates%5B%5D=spam&amp;substates%5B%5D=retesting&amp;substates%5B%5D=pending-program-review&amp;reported_to_team=&amp;text_query=&amp;program_states%5B%5D=2&amp;program_states%5B%5D=3&amp;program_states%5B%5D=4&amp;program_states%5B%5D=5&amp;sort_type=latest_activity&amp;sort_direction=descending&amp;limit=25&amp;page=1#activity-27815864"><strong>June 4, 2024</strong></a> — both bugs triaged.</p><p><a href="https://hackerone.com/bugs?subject=user&amp;report_id=2523776&amp;view=all&amp;substates%5B%5D=editing&amp;substates%5B%5D=pre-submission&amp;substates%5B%5D=new&amp;substates%5B%5D=triaged&amp;substates%5B%5D=needs-more-info&amp;substates%5B%5D=resolved&amp;substates%5B%5D=informative&amp;substates%5B%5D=not-applicable&amp;substates%5B%5D=duplicate&amp;substates%5B%5D=spam&amp;substates%5B%5D=retesting&amp;substates%5B%5D=pending-program-review&amp;reported_to_team=&amp;text_query=&amp;program_states%5B%5D=2&amp;program_states%5B%5D=3&amp;program_states%5B%5D=4&amp;program_states%5B%5D=5&amp;sort_type=latest_activity&amp;sort_direction=descending&amp;limit=25&amp;page=1#activity-27815864"><strong>June 14, 2024</strong></a> — first bug resolved and the other is still in process.</p><p><strong><em>thanks for reading, Leave clap if you enjoyed this read and help me improve by leaving your feedback in the comments.</em></strong></p><p>you can find me on :</p><p>1- <a href="https://x.com/abdushams_">X.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f8a3f3e5d55" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>