<?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 Abdallah Hammad on Medium]]></title>
        <description><![CDATA[Stories by Abdallah Hammad on Medium]]></description>
        <link>https://medium.com/@abdallahhammad440?source=rss-5d4506170c29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ejaMwsJrY3EvwV321lnZuQ@2x.jpeg</url>
            <title>Stories by Abdallah Hammad on Medium</title>
            <link>https://medium.com/@abdallahhammad440?source=rss-5d4506170c29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:05:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdallahhammad440/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[The Recovery Button That Broke a Zero-Knowledge Promise]]></title>
            <link>https://medium.com/@abdallahhammad440/the-recovery-button-that-broke-a-zero-knowledge-promise-a4c8b97e7274?source=rss-5d4506170c29------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4c8b97e7274</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Abdallah Hammad]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 19:15:01 GMT</pubDate>
            <atom:updated>2026-11-02T19:15:38.922Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcSByG6-TPIg8g2DR97QtA.png" /></figure><p><em>An application security review of an encrypted digital legacy platform</em></p><p><strong>Note:</strong> The client, product, and identifying details are redacted. The technical findings and remediation are in my <a href="https://github.com/Abdallah-Hammad-Sec/appsec-e2ee-digital-legacy-review">published case study</a>. The repository’s runnable examples are lab reproductions, not client code.</p><p>“Can your team recover a user’s files if they lose their password?”</p><p>Imagine asking that in a product review and hearing the answer:</p><p>“No. That’s the point. We’re zero-knowledge.”</p><p>It sounds reassuring. For a platform holding passwords, private messages, documents, and videos intended for someone’s family after death, it is also a serious promise. It says the company cannot read those assets, even if someone pressures it to.</p><p>I was reviewing a digital legacy platform built around that promise. The design made sense at first: keys were generated on the client, assets were encrypted before storage, and beneficiaries would receive access only after a release condition was satisfied.</p><p>The normal user flow appeared to support the claim.</p><p>Then I looked at account recovery.</p><h3>The question I kept asking</h3><p>I did not start by trying to break the encryption algorithm. I started by following the keys.</p><p>Where is the master key created? Where is it wrapped? Which services can touch it? What happens when a user rotates it, loses a device, asks support for help?</p><p>The platform used a client-side master key to protect per-asset data keys. It stored encrypted assets and prepared wrapped key material for designated beneficiaries. After a verified release event, a beneficiary could use their own key material to access the assets assigned to them.</p><p>That is a reasonable structure. But a diagram of the intended path does not prove that <em>every</em> path respects it.</p><p>So I traced the primary storage and retrieval flows, then the secondary paths: rotation, escrow, release, and support-assisted recovery. I was looking for one specific event , an unwrapped key or plaintext asset appearing on infrastructure controlled by the operator.</p><p>For ordinary storage and retrieval, I did not find it.</p><p>For a subset of users who had opted into a convenience recovery feature, I did.</p><h3>A narrow exception with a complete consequence</h3><p>The support recovery tool could trigger a server-side password-reset flow. In a particular case, that flow could re-wrap the user’s master key using a recovery key accessible to support.</p><p>That sentence is the finding.</p><p>The issue did not require breaking AES, guessing a password, or compromising a beneficiary. The product had created an authorized route through which its own operator could handle key material that its zero-knowledge claim said it could never access.</p><p>The trigger was narrow: it affected users who had chosen that recovery option. The consequence was not narrow. For those users, the operator was not structurally incapable of recovering access to their assets.</p><p>Picture the follow-up meeting. An engineer might reasonably say, “But only support can use it.”</p><p>My answer would be: “Then the guarantee depends on support access remaining trustworthy. That is different from a guarantee that the operator cannot do it.”</p><p>This distinction matters under insider misuse, server compromise, and legal or other pressure on the company. A policy can tell employees not to retrieve plaintext. A zero-knowledge architecture is supposed to remove their ability to do so.</p><p>The finding was rated <strong>Critical</strong> because it contradicted the product’s stated security property, even though the affected population was limited.</p><h3>The second problem was about when a secret could move</h3><p>A digital inheritance platform has another difficult boundary. It must release access after a genuine death event, while protecting a living user from an early or fraudulent release.</p><p>The review found an access-control flaw in the endpoint that served wrapped key shares to beneficiaries. The endpoint checked whether the caller was authenticated and listed as <em>a</em> beneficiary. It did not adequately bind the request to the <strong>specific beneficiary, specific share, and verified release condition</strong>.</p><p>That could allow a beneficiary to request a share meant for another beneficiary, or in some cases request a share before their own release condition had fired.</p><p>There is an important limit to the impact: the wrongly retrieved share was still encrypted. Without the intended beneficiary’s private key, retrieving it did not by itself reveal the underlying assets.</p><p>I would still treat this as a launch-blocking issue. The system’s promise was not merely that ciphertext would remain hard to decrypt. It also promised to deliver each share to the right person at the right time. The server’s authorization decision needed to enforce that promise precisely.</p><p>The fix bound each share request to its own beneficiary relationship and confirmed that the corresponding release condition had been satisfied.</p><h3>A familiar crypto mistake appeared in a less familiar place</h3><p>The review also found AES in ECB mode in an older storage module used for cached thumbnail derivatives.</p><p>ECB is dangerous for image-like data because equal plaintext blocks produce equal ciphertext blocks. Patterns in the source can survive encryption. The affected module predated the main asset-encryption path, which made it easy to overlook while focusing on the platform’s headline E2EE design.</p><p>It was migrated to AES-GCM and the corrected module was checked again. The <a href="https://github.com/Abdallah-Hammad-Sec/appsec-e2ee-digital-legacy-review/tree/main/tooling">public repository includes a small crypto-parameter linter and before-and-after lab samples</a> to demonstrate this class of check. Those samples illustrate the issue; they are not the client’s implementation.</p><h3>What had to change before launch</h3><p>The recovery path came first. The server-side recovery-key route was removed. For users who wanted a recovery option, the replacement used client-side social recovery: Shamir secret sharing distributed recovery material among trustees chosen by the user. The operator no longer held a recovery path to unwrapped keys.</p><p>The beneficiary-share authorization fix came next. Then the legacy ECB module was migrated, and broader key-management and API hardening work was completed. The <a href="https://github.com/Abdallah-Hammad-Sec/appsec-e2ee-digital-legacy-review/blob/main/remediation/roadmap.md">remediation roadmap</a> records the priorities and pre-launch verification.</p><p>Across the wider engagement, <strong>95% of findings remediated, 18 high and critical issues eliminated, more than 30 sensitive APIs hardened, and more than 40 recommendations implemented</strong>. The public repository documents the crypto-focused portion in detail.</p><p>The recovery fix was checked against the same path that exposed the issue. That mattered more than a ticket marked “done.” The test was whether the operator could still reach unwrapped user keys through support recovery. After remediation, that route was gone.</p><h3>The lesson I took from this review</h3><p>The most important finding was in a feature intended to help users.</p><p>That is what made it easy to miss. Account recovery sounds like a customer service function. In a zero-knowledge product, it is part of the cryptographic architecture. If the company can recover the user’s key for them, the company may be able to recover it for someone else.</p><p>A strong security claim has to survive its exceptions: support tools, emergency workflows, migrations, old modules, and the moment a beneficiary asks for access.</p><p>For this platform, the central review question became simple:</p><p><strong>Could the operator ever do the one thing it promised users it could not do?</strong></p><p>For some users, the answer had been yes. The work was to find that path, explain its consequences without exaggeration, and verify that the final design removed it.</p><p><em>Technical details, threat models, sanitized findings, and remediation notes are available in the </em><a href="https://github.com/Abdallah-Hammad-Sec/appsec-e2ee-digital-legacy-review"><em>redacted case study</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4c8b97e7274" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Didn’t Hack the System. It Let Me In.]]></title>
            <link>https://medium.com/@abdallahhammad440/i-didnt-hack-the-system-it-let-me-in-a31707736152?source=rss-5d4506170c29------2</link>
            <guid isPermaLink="false">https://medium.com/p/a31707736152</guid>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[vulnerability-assessment]]></category>
            <category><![CDATA[healthcare]]></category>
            <dc:creator><![CDATA[Abdallah Hammad]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 11:01:28 GMT</pubDate>
            <atom:updated>2026-03-31T13:21:48.183Z</atom:updated>
            <content:encoded><![CDATA[<h4>How a simple user account turned into full platform compromise in a healthcare <em>SaaS application</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJozTInZ6iau4Kya3mNdqA.png" /></figure><h3>Introduction</h3><p>Every penetration test starts the same way.</p><p>You create an account.</p><p>You log in.</p><p>You look around.</p><p>Nothing fancy. No drama.</p><p>This one was no different.</p><p>Except… it didn’t take long before things started to feel <em>too easy</em>.</p><p>And when things are too easy in security, it usually means something is very, very wrong.</p><h3>The Beginning: Just Another User</h3><p>I approached the platform as any normal user would.</p><p>Signed up. Logged in. Started exploring.</p><p>At first glance, everything looked like a typical modern SaaS platform:</p><ul><li>AI-powered chatbot</li><li>Messaging system</li><li>User roles (patients, doctors, moderators)</li><li>Backend APIs powering everything</li></ul><p>But under the surface, the system was operating on a dangerous assumption:</p><ul><li>“If a user is authenticated… they can be trusted.”</li></ul><p>That assumption was the beginning of everything.</p><h3>Step 1: Seeing More Than I Should</h3><p>The first crack appeared through a simple API endpoint:</p><pre>/api/user/get-all-users</pre><p>No authentication required.</p><p>Just call it, and you get <strong>every user on the platform</strong>.</p><p>Patients. Doctors. Moderators.</p><p>Emails. Identifiers. Everything.</p><p>That alone is already a serious issue:</p><ul><li>mass user enumeration</li><li>targeting users becomes trivial</li><li>phishing, credential stuffing, data harvesting</li></ul><p>But it didn’t stop there.</p><h3>Step 2: Reading Other Users’ Data (IDOR)</h3><p>Once I had user IDs, I tried something simple:</p><ul><li>“What happens if I request another user’s profile?”</li></ul><p>The answer: it works.</p><p>No validation. No ownership check.</p><p>Just change the ID… and you get someone else’s data.</p><p>This is a classic <strong>IDOR (Insecure Direct Object Reference)</strong>:</p><ul><li>any user can read any other user’s profile</li><li>privacy boundaries simply don’t exist</li></ul><h3>Step 3: Writing Instead of Reading (BOLA)</h3><p>Reading is bad.</p><p>Writing is worse.</p><p>So I tried modifying data.</p><p>Same idea, change the user ID.</p><p>And it worked.</p><p>This is <strong>BOLA (Broken Object Level Authorization)</strong>:</p><ul><li>I could modify other users’ data</li><li>change profiles</li><li>potentially hijack accounts</li></ul><p>At this point, the system had already lost:</p><ul><li>confidentiality</li><li>integrity</li></ul><p>And we were just getting started.</p><h3>Step 4: The Chat System (Where Things Got Interesting)</h3><p>The platform had an AI chatbot.</p><p>Messages are stored and rendered.</p><p>So naturally, I asked:</p><ul><li>“What happens if I inject JavaScript here?”</li></ul><p>I tried but it didn&#39;t execute.<br>So I thought, what if I could convince the chat-bot to execute it for me?</p><p>And voala… I succeeded, it executed.</p><p>And not just once.</p><p>It persists.</p><p>This is <strong>stored client-side injection (stored XSS)</strong>:</p><ul><li>payload stored in chat</li><li>executes every time someone opens it</li><li>runs in victim’s browser</li></ul><p>Now combine that with what we already know…</p><h3>Step 5: Broken Access Control in Chats</h3><p>Chat conversations were accessible like this:</p><pre>GET /api/chats/{chat_id}</pre><p>No validation of:</p><ul><li>ownership</li><li>participation</li><li>authorization</li></ul><p>If you have a chat_id, you can read the conversation.</p><p>Which means:</p><blockquote><em>I can access </em><strong><em>any chat on the platform</em></strong></blockquote><h3>The Breakthrough: Chaining Everything Together</h3><p>This is where it stops being “bugs” and becomes <strong>real compromise</strong>.</p><h3>The chain:</h3><ol><li>I create a chat</li><li>I inject malicious JavaScript</li><li>The payload is stored</li><li>I share the chat (or rely on broken access control)</li><li>A victim opens it</li><li>The code executes in their browser</li><li>I now operate in their session context</li></ol><h3>What That Actually Means</h3><p>Let’s translate that into real impact:</p><p>I was able to:</p><ul><li>access private conversations between patients and doctors</li><li>impersonate users</li><li>execute actions on behalf of victims</li><li>steal session context (depending on cookie/security setup)</li><li>spread malicious content through the platform</li></ul><p>And because of broken access control:</p><ul><li>I didn’t need to guess anything.</li><li>The system gave me access.</li></ul><h3>And It Didn’t Stop There…</h3><p>The platform had deeper systemic issues.</p><p>Here’s a snapshot of what was uncovered during the assessment:</p><h3>Authentication &amp; Identity Issues</h3><ul><li>No email verification → <strong>pre-account takeover (pre-ATO)</strong></li><li>Non-atomic registration → accounts created even when signup fails</li><li>Identity desynchronization (Cognito vs DB) → ghost users, crashes (500 errors)</li><li>Role manipulation via user_type → backend logic influenced by user input</li></ul><h3>API &amp; Access Control Failures</h3><ul><li>Mass user enumeration (no auth)</li><li>IDOR (read any user)</li><li>BOLA (modify any user)</li><li>Broken access control in chats</li><li>No rate limiting → unlimited abuse</li></ul><h3>Infrastructure &amp; Exposure</h3><ul><li>API docs publicly exposed (/docs, /openapi.json)</li><li>Backend API directly exposed (no gateway / WAF)</li><li>Open SSH port on production server</li><li>Backend URL exposed in public JS bundle</li></ul><h3>Data &amp; Security Misconfigurations</h3><ul><li>PII stored inside JWT payloads</li><li>CORS misconfigured (*)</li><li>Cookies missing HttpOnly and Secure</li><li>Missing security headers (X-Frame-Options, etc.)</li><li>DMARC set to p=none</li><li>Server version disclosure (nginx/Apache)</li><li>Weak TLS indicator</li></ul><h3>File Management Risks</h3><p>Endpoints:</p><pre>/add-file<br>/delete-file/{filename}<br>/get-all-files</pre><p>Issues:</p><ul><li>Uses Basic Auth (separate from main auth)</li><li>No rate limiting → brute force possible</li><li>Potential:</li></ul><ol><li>file upload abuse</li><li>path traversal</li><li>data overwrite</li></ol><h3>Business Impact:</h3><p>Let’s step away from technical terms.</p><p>Here’s what this means:</p><ul><li>Any user could access other users’ private data</li><li>Patient-Doctor conversations were not private</li><li>Sensitive health-related information could be exposed</li><li>Accounts could be manipulated or impersonated</li><li>The platform could be used to attack its own users</li><li>Trust in the system would collapse immediately</li></ul><p>For a healthcare-related platform, this isn’t just a bug.</p><ul><li>It’s an existential risk.</li></ul><h3>The Real Problem</h3><p>This wasn’t one vulnerability.</p><p>It was a pattern:</p><ul><li>No real access control</li><li>No trust boundaries</li><li>No defense-in-depth</li><li>No consistency in identity handling</li></ul><p>Each issue alone is manageable.</p><p>Together?</p><p>They form a system where:</p><ul><li>An attacker doesn’t need to break in.</li><li>They just need to show up.</li></ul><h3>Final Thoughts</h3><p>This assessment wasn’t about finding one critical bug.</p><p>It was about uncovering how multiple small weaknesses combine into something much bigger.</p><p>And the most important takeaway is this:</p><ul><li>Security doesn’t fail because of one mistake.</li><li>It fails when assumptions go unchecked.</li></ul><p>In this case, the assumption was simple:</p><ul><li>“Authenticated users are safe.”</li></ul><p>They weren’t.</p><p>And that made all the difference.</p><ul><li><em>By: </em><a href="https://abdallah-hammad.com/"><em>Abdallah Hammad</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a31707736152" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I pwned a production app from the dev playground]]></title>
            <link>https://medium.com/@abdallahhammad440/how-i-pwned-a-production-app-from-the-dev-playground-5e35ace34bbe?source=rss-5d4506170c29------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e35ace34bbe</guid>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Abdallah Hammad]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 10:27:37 GMT</pubDate>
            <atom:updated>2025-11-13T10:30:09.889Z</atom:updated>
            <content:encoded><![CDATA[<p>Black-box → Basic Auth → Authenticated chaining. Created a dev user, minted a JWT, used it on prod. Result: impersonation and mass ATO potential. Redacted, real, and messy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*_-vzEs376e2pRJteHyrCqA@2x.jpeg" /></figure><p>TL;DR: 10 days. 3 phases. Found Basic Auth on both environments, discovered an exposed REST debug GUI in dev, created and activated a dev account, minted a JWT, then reused that token on prod because both environments shared the same signing secret and used numeric user IDs. Boom… I could see other users. Chain = create → activate → token → reuse on prod → enumerations → mass ATO. Fix: rotate keys, disable debug GUI, scope tokens, and add rate limiting.</p><blockquote>Note: All domains, hostnames, and exact identifiers are redacted.</blockquote><h3>The popup, the curiosity, and the jump from window to backdoor.</h3><p>I started with one thing: the domain (dev + prod). I clicked the site, got the Basic Auth popup (the HTTP one that shows before the GUI loads), tried admin/admin, test/test, the usual. Nothing. I ran recon, found a few subdomains, an old nginx version, an open SSH on one subdomain, logged everything, and then I stopped trying to open the front door. Instead, I looked through the window: the API.</p><p>If you’ve done this before you know the smell.. front-end looks fine, but the backend sometimes.. talks. So I went and whispered to it.</p><h3>Phase 1 .. black-box recon (what I did, what I logged)</h3><p><strong>Recon runs:</strong></p><ul><li>Passive search, subdomain enumeration, banner grabs.</li><li>Found Basic Auth popup on both prod and dev.</li><li>Found old nginx version on a subdomain.</li><li>Open SSH on a subdomain (not exploited, just noted).</li><li>Took notes like a maniac, every header, version, and endpoint hint.</li></ul><p>Everything looked solid at the GUI level .. until I started fuzzing the API from dev (so I don’t touch prod with noisy requests). That’s where the story actually begins.</p><h3>Phase 2 .. fuzzing and the gift: dev’s REST debug GUI</h3><p>I fuzzed and enumerated API endpoints. Surprise: there was a publicly accessible REST debug GUI (the dev debug playground). From that console I could see ~90% of the API endpoints. Not “a few”, most of them.</p><p>I spent time mapping endpoints, parameters, and auth expectations. Some endpoints claimed to require auth, but the debug GUI and certain calls gave me enough to understand the app’s internal logic. I didn’t touch the front-end GUI yet, I hung out with the APIs and read how the app behaves.</p><p>Big takeaway: exposed developer tooling = free blueprint. If you show your internal map to the internet, someone will use it.</p><h3>Phase 3 .. create user, activate, mint token, and the prod surprise.</h3><p><strong>This is the juicy, step-by-step:</strong></p><ul><li>I created a user on dev via /api/auth/users.</li><li>Activation email came. The link had a UUID and a token .. used those to call /api/auth/users/activate.</li><li>I logged in and requested a token from /api/token. Got a JWT.</li><li>I decoded the JWT (jwt.io) .. every step noted, every claim copied.</li><li>I thought .. what if dev tokens work against prod? I tried it.</li><li>They worked. Why? Dev and prod used the same JWT signing secret, and the app used sequential numeric user IDs. Dev user with ID 10 ≈ Prod user with ID 10. Token replay across environments. Mass ATO door = open.</li></ul><p>So yeah, I made a user in dev, activated it, minted a token, and because the environments were poorly isolated, that token mapped to a real prod user. I could see data that wasn’t mine. I updated a field (added my email) to confirm, and yep .. I had prod presence. I called the client and said “we need to talk, now” (they confirmed there was indeed a prod user that matched).</p><h3><strong>The attack chain (concise, repeatable, scary)</strong></h3><ul><li>Create account in dev (/api/auth/users).</li><li>Activate account via the emailed link (/api/auth/users/activate).</li><li>Login → receive JWT (/api/token).</li><li>Use JWT against prod (prod accepts it because signing secret + claims are identical).</li><li>Server maps token to prod user with same numeric ID → access granted.</li><li>Enumerate users/groups via endpoints; no rate limiting → automated ATO possible.</li></ul><p>That is not a single bug. It’s a whole rotten design: shared secret + predictable IDs + separate DBs = token replay.</p><h3>Other findings (short and spicy)</h3><ul><li>Exposed REST debug GUI in dev .. absolute no-no for public environments.</li><li>Outdated Nginx, known CVEs; upgrade ASAP.</li><li>File upload validation weak forged extensions, missing magic-byte verification. Combined with misconfig, could lead to RCE.</li><li>No rate limiting / anti-automation endpoints allowed enumeration and brute-forcing.</li><li>Inconsistent Basic Auth usage confusing auth flows increase risk.</li></ul><h3><strong>Impact &amp; risk:</strong></h3><ul><li>High (Immediate): Token reuse across environments → impersonation and data access.</li><li>High: User enumeration + no throttling → mass account takeover and spam/credential-stuffing attacks.</li><li>Medium → High: File upload + old server config → potential RCE.</li><li>Business: Data exposure, possible regulatory fines, reputational damage.</li></ul><h3>What I delivered in the report (one-line exec summary)</h3><p>Dev exposed a debug interface and shared JWT signing secrets with prod while using sequential numeric user IDs. Tokens created in dev were valid in prod and mapped to prod users, enabling immediate impersonation and mass ATO. Immediate actions: rotate keys, disable the debug GUI, scope tokens, and add rate limiting. Full reproduction steps and remediation checklist included in the redacted report.</p><h3>The exact remediation steps I prioritized (what to do first)</h3><p><strong>Immediate (do now):</strong></p><ul><li>Rotate all JWT signing keys for every environment and invalidate existing tokens.</li><li>Disable or restrict access to the REST debug GUI (VPN, IP allowlist, or MFA).</li><li>Add iss and aud claims and validate them server-side to scope tokens per environment.</li></ul><p><strong>High priority:</strong></p><ul><li>Use separate secrets per environment (no shared keys).</li><li>Stop using sequential numeric IDs in tokens — switch to UUIDs.</li><li>Enforce strict server-side authorization (deny by default).</li></ul><p><strong>Medium priority:</strong></p><ul><li>Add rate limiting, account lockouts, and automated-abuse detection.</li><li>Harden file uploads: check magic bytes, re-encode images, store outside web root.</li><li>Upgrade Nginx and patch dependencies; add WAF protections.</li></ul><p><strong>Long term:</strong></p><ul><li>CI/CD gates to prevent debug flags from reaching prod.</li><li>Periodic red-team/blue-team exercises and threat modeling.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e35ace34bbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web App Penetration Test, Freelance Job: From 0 to Admin Like a Ghost ]]></title>
            <link>https://medium.com/@abdallahhammad440/web-app-penetration-test-freelance-job-from-0-to-admin-like-a-ghost-317a402e5999?source=rss-5d4506170c29------2</link>
            <guid isPermaLink="false">https://medium.com/p/317a402e5999</guid>
            <dc:creator><![CDATA[Abdallah Hammad]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 09:45:03 GMT</pubDate>
            <atom:updated>2025-11-23T20:16:43.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECu0N-Hq7Ou0W-qMON18QQ.jpeg" /></figure><p>Let’s talk about a juicy engagement I worked on recently. It was a <strong>web application penetration testing freelancing job</strong>, and the target? A single web application .. let’s call it <strong>example.com</strong>. No subdomains, no multiple targets. Just one clean, solid-looking surface.</p><p>Or so it seemed.</p><h3>🧭 Step 1: Understand the Enemy</h3><p>Like any good operator, I started by <strong>gathering intel</strong>. Since the app was standalone, I knew my focus would need to be surgical.</p><p>I browsed around, <strong>thinking like a user first</strong>, not a hacker. I registered a normal user account, played around with the features, and slowly started to <strong>understand the business logic</strong>.</p><p>What does it do?</p><p>How does it work?</p><p>Where could something be out of place?</p><p>Once I had the layout mapped in my mind, I moved to the real game.</p><h3>🧪 Step 2: Mapping and Fuzzing</h3><p>Next up .. <strong>mapping the application structure</strong> and digging around for forgotten doors:</p><p>Hidden pages, admin panels, debug endpoints, anything that could give me an edge.</p><p>I ran some fuzzing against the directories and endpoints. I was looking for that one misnamed file or hidden gem like /admin, /dashboard-beta, or even /secret-login.</p><p>But nothing.</p><p>The app looked tight.</p><p>Still .. <strong>I wasn’t even slightly discouraged</strong>. I knew the deeper stuff doesn’t usually live out in the open. So I dug deeper.</p><h3>🧠 Step 3: Think Like a Developer .. Read the Source</h3><p>I opened the frontend source code .. time to see if the devs dropped any golden breadcrumbs.</p><p>Page after page .. HTML, JS, maybe even some React or Vue components .. everything looked polished and clean.</p><p>Still, <strong>I didn’t stop</strong>. Because the <strong>nervous system</strong> of any web app .. the real brain is usually buried in the <strong>JavaScript files</strong>.</p><h3>🕵️‍♂️ Step 4: The Goldmine .. JavaScript Recon</h3><p>So I started going through the JS files .. one by one, reading, scrolling, and trying to understand every variable, every function, every call.</p><p>Most were dull. Then… <strong>bam</strong>.</p><p><strong>I found it.</strong></p><p>Hidden in one of the JS files was something spicy:</p><blockquote>const adminURL = “/adminOfTheApp/”;</blockquote><p>No links pointed to it. No UI exposed it.</p><p>But the backend endpoint was hardcoded.</p><p><strong>Note taken.</strong></p><p>I hit the /adminOfTheApp/ URL.</p><p>It redirected me to a login page. No surprise there.</p><p>I tried default creds .. admin:admin, root:toor, even some common leaks .. nothing worked.</p><p>There was also <strong>rate limiting</strong> in place. Not bulletproof, but enough to slow down brute force attacks.</p><p>Still, this wasn’t over. I just had to get clever.</p><h3>Step 5: The Real Flaw .. Client-Side Validation for Authentication 😱</h3><p>I went back into the JS files and kept digging. Then I spotted <strong>something terrifyingly wrong</strong>.</p><p>One of the files was handling <strong>authentication logic on the client side</strong>.</p><p>It basically decided whether you’re a normal user or an admin… <strong>based on cookie parameters</strong>.</p><p>Wait, what?</p><p>Yup. Something like:</p><blockquote>if (cookies.role === “admin”) {<br> showAdminUI();<br>}</blockquote><p>There it was a <strong>client-side authentication mechanism</strong>.</p><p>It looked like they were setting a parameter in cookies like:</p><blockquote>X-Auth-Role: admin</blockquote><p>I took notes again, fired up <strong>Burp Suite</strong>, and did a <strong>match &amp; replace</strong> in the session.</p><p>I added a fake token, something like:</p><blockquote>Cookie: session=abc123; X-Auth-Role=admin;</blockquote><p>Then I went back to the <strong>admin panel endpoint</strong>, intercepted the response, made some adjustments… and then…</p><p>😱 <strong>Boom. Admin UI. Full view. Right in front of me.</strong></p><h3>🧨 Step 6: The Adrenaline Hit</h3><p>I started clicking through the features of the admin panel like I was part of the dev team.</p><p>But the dream didn’t last long.</p><p>On the <strong>first click</strong>, I was kicked out.</p><p>Turns out .. the <strong>outer shell</strong> of the admin panel was vulnerable to client-side manipulation, but once inside, it relied on <strong>server-side validation</strong>. And that validation was checking for a <strong>real token</strong>.</p><p>My fake token? Useless beyond the login wall.</p><h3>🧗 Step 7: Time for OSINT .. Think Outside the App</h3><p>At this point, many would’ve thrown in the towel. Not me.</p><p>I went full <strong>OSINT mode</strong>.</p><p>I started searching and gathering info about the people behind the application.</p><p>Eventually, I tracked down one of the app’s creators .. likely an admin. I profiled him, gathered everything I could: name, phone patterns, likely usernames.</p><h3>🐍 Step 8: Python + Bypass = Enumeration</h3><p>I went back to the app and wrote a <strong>Python script</strong> for <strong>username enumeration</strong>.</p><p>Based on my OSINT info, I tested different formats .. emails, usernames, phone numbers .. while also coding a rate-limiting bypass to avoid detection.</p><p>Success.</p><p>I got a hit. The input field accepted a <strong>valid mobile number</strong> as a username.</p><p>Time to go full throttle.</p><h3>🦾 Step 9: Bruteforce with Grace</h3><p>Using the same bypass trick, I launched a <strong>targeted brute-force attack</strong> against that valid username.</p><p>Moments later?</p><p>💥 <strong>Password cracked.</strong></p><p>It was embarrassingly simple.</p><p>And because the assumption was “Nobody will find the admin panel URL,” they never properly secured it server-side.</p><p>Guess what? I did find it.</p><p>And now, I had <strong>valid credentials</strong> for a <strong>real admin</strong>.</p><h3>🏁 Step 10: ATO Achieved</h3><p>Logged in.</p><p>No tricks. No manipulation.</p><p>Just <strong>pure Account Takeover of an actual admin</strong> account .. gained through <strong>a mix of logic flaw exploitation, client-side bypassing, creative OSINT, and brute-force finesse</strong>.</p><p><strong>Mission Complete.</strong></p><p>Then I reported the technical team of what I’ve found, I told them that:</p><blockquote><em>I uncovered a chain of multiple vulnerabilities that allowed me to fully compromise the target.</em></blockquote><blockquote><em>The journey started with bypassing client-side validation that determined admin status, exposing an </em><strong><em>Authentication Logic Flaw</em></strong><em>. I leveraged this flaw to access sensitive admin endpoints, which were further vulnerable to </em><strong><em>Broken Access Control (IDOR) .. </em></strong><em>allowing me to retrieve the admin flag directly by manipulating parameters.</em></blockquote><blockquote><em>From there, I dug deeper into the login mechanism. The system disclosed whether a username was valid through distinct error messages, which led to </em><strong><em>Username Enumeration</em></strong><em>. Using this, I built a list of valid users. Next, I observed the login endpoint lacked any meaningful rate-limiting, enabling </em><strong><em>Brute Force Attacks</em></strong><em>. By combining this with </em><strong><em>publicly exposed employee usernames found via OSINT</em></strong><em>, I successfully took over the admin account — a full </em><strong><em>Account Takeover (ATO)</em></strong><em>.</em></blockquote><blockquote><em>Lastly, the application implemented </em><strong><em>Weak Password Policies</em></strong><em>, using simple predictable passwords such as admin123, further weakening its security posture and making brute-force and credential stuffing even more effective.</em></blockquote><blockquote><em>All these bugs worked together like puzzle pieces .. starting from small recon observations and ending in full account compromise.</em></blockquote><p>With all the technical details they need.</p><h3>🔑 Key Takeaways</h3><ol><li>Never rely on client-side logic for access control.</li><li>Implement proper rate-limiting and account lockout mechanisms.</li><li>Avoid verbose login error messages .. they leak too much information.</li><li>Enforce strong password policies.</li><li>Always treat internal endpoints as potentially exposed.</li></ol><blockquote><em>💬 Have you ever found similar bugs? Let me know in the comments or connect with me on </em><a href="https://www.linkedin.com/in/abdallah-hammad-376a42231/"><em>LinkedIn</em></a><em>!</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=317a402e5999" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>