<?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 Muhammad Asim Shahzad on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Asim Shahzad on Medium]]></description>
        <link>https://medium.com/@masimshahzad?source=rss-440524433a10------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PFgvAdI_b_lLVHeRuBYRfw@2x.jpeg</url>
            <title>Stories by Muhammad Asim Shahzad on Medium</title>
            <link>https://medium.com/@masimshahzad?source=rss-440524433a10------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 03:05:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@masimshahzad/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[Sign in with Apple JWT Bug: Account Takeover Case]]></title>
            <link>https://masimshahzad.medium.com/sign-in-with-apple-jwt-bug-account-takeover-case-ae9fd2061bf6?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae9fd2061bf6</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 04:59:39 GMT</pubDate>
            <atom:updated>2026-11-16T04:59:39.016Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sign in with Apple JWT Bug: Any Email, Any Account</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlC4tmCfVEZkm7te6bPaQw.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h3>How a $100,000 bug bounty finding let an identity provider sign tokens for email addresses nobody had proven they owned</h3><p><em>AI-assisted: drafted with AI help from public sources, then reviewed and edited. This is an analytical case study of a public disclosure, not my own discovery.</em></p><p>An email address was the only thing an attacker needed. In April 2020, Bhavuk Jain found a <a href="https://bhavukjain.com/blog/2020/05/30/zeroday-signin-with-apple/">Sign in with Apple JWT bug</a> that made Apple’s servers hand out validly signed identity tokens for whatever email was asked for. Any third-party app that trusted those tokens without extra checks was open to full account takeover, and Apple paid $100,000 for the report.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Apple fixed this in 2020. Endpoints, request bodies and reproduction details are intentionally omitted.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Authentication bypass at the identity provider: identity token issued for an unverified, caller-chosen email claim</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-287 (Improper Authentication), CWE-639 (Authorization Bypass Through User-Controlled Key)</li><li><strong>CVE:</strong> Not reported</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: $100,000 (Apple Security Bounty), source-reported</li></ul><h3>How the Sign in with Apple JWT Bug Worked (high level)</h3><p>Sign in with Apple behaves much like OpenID Connect. The user authenticates with Apple, chooses whether to share their real address or a private relay address, and Apple returns a signed JWT. The relying app checks the signature against Apple’s public keys and logs in whoever the email claim names.</p><p>The flaw sat in the step where Apple minted that token. According to the researcher, the email that ended up in the JWT could be supplied by the requester, and Apple did not confirm it belonged to the person who had just signed in. The token was genuine: correct issuer, correct signature, and a claim saying the email was verified. Only the identity inside it was wrong.</p><p>That is what makes this case uncomfortable. Every app that “validated the JWT properly” still accepted it, because the lie came from the trusted signer itself.</p><h3>Impact</h3><p>Jain wrote that the bug could lead to full takeover of accounts on third-party apps using Sign in with Apple, even if the victim had no Apple ID, as long as the app had no additional safeguards. He named large adopters such as Dropbox, Spotify and Airbnb as examples of integrators, while noting they were not tested. Apple reviewed its logs and found no misuse or account compromise.</p><h3>Defending Against Sign in with Apple JWT Abuse (my own analysis)</h3><p><strong>1. Key accounts on the stable subject, not the email.</strong> Link a social login to iss + sub. Treat email as a mutable contact attribute.</p><p><strong>2. Never auto-merge on email alone.</strong> If a federated email matches an existing password account, require the user to prove control of that account before linking.</p><p><strong>3. Validate every claim you depend on.</strong> Check aud, exp, nonce and issuer, and bind the nonce to the browser session that started the login.</p><p><strong>4. Plan for a compromised provider.</strong> Alert on new federated links and offer step-up checks for sensitive actions.</p><pre># Pseudocode: federated login keyed on (issuer, subject)<br>def federated_login(id_token, session):<br>    claims = verify_jwt(id_token, keys=apple_jwks(),<br>                        issuer=APPLE_ISS, audience=MY_CLIENT_ID)<br>    if claims.nonce != session.pop(&quot;login_nonce&quot;):<br>        raise AuthFailed(&quot;nonce mismatch&quot;)<br>    link = links.find(issuer=claims.iss, subject=claims.sub)<br>    if link:<br>        return create_session(link.user)<br>    existing = users.find_by_email(claims.email)<br>    if existing:                       # do not merge silently<br>        return require_proof_of_existing_account(existing, claims)<br>    return create_session(users.create_federated(claims.iss, claims.sub,<br>                                                 contact_email=claims.email))</pre><h3>Key Takeaways</h3><ul><li>A valid signature proves who issued a token, not that its claims are true.</li><li>Identify federated users by issuer and subject; email-based account merging is a takeover path.</li><li>Build relying-party checks that still hold when the identity provider makes a mistake.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Bhavuk Jain</strong>: <a href="https://bhavukjain.com/blog/2020/05/30/zeroday-signin-with-apple/">Zero-day in Sign in with Apple</a> (30 May 2020). Press context on the fix: <a href="https://arstechnica.com/information-technology/2020/06/apple-fixes-bug-that-could-have-given-hackers-unauthorized-to-user-accounts/">Ars Technica, 1 June 2020</a>. Facts come from those sources; analysis and code are original.</p><p>Next breakdown: the Facebook IDOR that could delete any photo album. Follow @masimshahzad for daily bug bounty breakdowns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae9fd2061bf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Phone Number That Unlocked Any Tinder Account]]></title>
            <link>https://masimshahzad.medium.com/the-phone-number-that-unlocked-any-tinder-account-cf489246d335?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf489246d335</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[account-takeover]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 03:54:39 GMT</pubDate>
            <atom:updated>2026-11-13T03:54:39.385Z</atom:updated>
            <content:encoded><![CDATA[<h4>A 2018 bug bounty chain shows how a skipped OTP binding and an unchecked token audience added up to account takeover</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OGcNESLQYUHCb0atDO63w.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><p><em>AI-assisted: drafted with AI help from public sources, then reviewed and edited. This is an analytical case study of a public disclosure, not my own discovery.</em></p><p>A phone number was all it took. In a 2018 <a href="https://www.anandpraka.sh/2018/02/hacking-tinder-accounts-using-facebooks.html">Tinder account takeover</a>, Anand Prakash chained a verification gap in Facebook’s Account Kit with a Tinder API that never asked which app a login token was issued for. The result was full access to the profile and private chats of any Tinder user who signed in with their phone. Facebook paid $5,000, Tinder paid $1,250, and both fixed their side quickly.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Both issues were fixed in 2018. Requests, parameters and reproduction details are intentionally omitted.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Authentication bypass chain: OTP not bound to the phone number, plus missing token audience (client ID) check</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-287 (Improper Authentication), CWE-345 (Insufficient Verification of Data Authenticity)</li><li><strong>CVE:</strong> Not reported</li><li><strong>Severity/CVSS:</strong> Not reported. Bounties: $5,000 (Facebook) + $1,250 (Tinder), source-reported</li></ul><h3>How the Tinder Account Takeover Worked (high level)</h3><p>Tinder’s “Log in with phone number” was handled by Facebook’s Account Kit, a passwordless identity service. It texted a code, confirmed it, and returned an access token that Tinder exchanged for a session.</p><p><strong>Link one: Account Kit.</strong> In one phone-confirmation path, Account Kit did not verify that the code belonged to the phone number in the same request. An attacker’s own valid code could be paired with a victim’s number, and Account Kit issued a token for the victim’s identity.</p><p><strong>Link two: Tinder.</strong> An Account Kit token carries the ID of the app it was issued to. Tinder’s login API accepted the token without checking that ID, so a token minted for <em>any</em> Account Kit app worked as a Tinder login.</p><p>Either flaw alone is serious. Together, a phone number became a session.</p><h3>Impact</h3><p>Per the researcher, an attacker gained full control: private messages, personal details, and swiping on the victim’s behalf. On a dating app, that means intimate data and impersonation in front of strangers. The only precondition was phone-number login. The Verge reported no evidence the bug was exploited before the fix.</p><h3>Fixing Tinder-Style Account Takeover: Defense-in-Depth (my own analysis)</h3><p><strong>1. Bind every OTP to exactly one identifier and one flow.</strong> Store the code with the number, purpose and flow ID it was sent for, and compare all of them on confirmation.</p><p><strong>2. Validate the token’s audience, not just its signature.</strong> Confirm the token was issued to <em>your</em> app ID, for the expected user, and is still valid, using the provider’s verification endpoint or claims.</p><p><strong>3. Treat third-party identity as a trust boundary.</strong> A provider bug becomes your takeover if you accept anything it signs. Notify users of new-device logins and step up checks before exposing chats.</p><pre># Pseudocode: OTP confirmation bound to number + flow<br>def confirm_otp(flow_id, phone, code):<br>    rec = otp_store.get(flow_id)<br>    if (rec is None or rec.expired() or rec.attempts &gt;= 5<br>            or rec.phone != normalize(phone)<br>            or not constant_time_eq(rec.code_hash, hash(code))):<br>        otp_store.bump_attempts(flow_id)<br>        raise AuthFailed()<br>    otp_store.delete(flow_id)            # single use<br>    return issue_identity_token(sub=rec.phone, aud=rec.app_id)</pre><pre># Pseudocode: relying-party login that checks audience<br>def login_with_provider_token(token):<br>    info = provider.verify(token)        # signature, expiry, revocation<br>    if info.app_id != MY_APP_ID:<br>        raise AuthFailed(&quot;token issued to another app&quot;)<br>    user = users.find_by_verified_phone(info.subject)<br>    return create_session(user, risk=assess_device(user))</pre><h3>Key Takeaways</h3><ul><li>An OTP is only proof of possession if it is tied to the identifier it was sent to.</li><li>“Validly signed” is not “meant for me”: always check the audience or client ID.</li><li>Outsourcing login moves the code, not the responsibility; verify what the provider hands you.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Anand Prakash</strong> (AppSecure): <a href="https://www.anandpraka.sh/2018/02/hacking-tinder-accounts-using-facebooks.html">Tinder Account Takeover Vulnerability via Facebook Account Kit ($6,250 Bug Bounty)</a> (20 February 2018). Press context: <a href="https://www.theverge.com/2018/2/21/17036514/tinder-vulnerability-account-takeover-accountkit-login">The Verge, 21 February 2018</a>. Facts come from those sources; analysis and code are original.</p><p>Next breakdown: another real bug bounty case. Follow @masimshahzad for daily bug bounty breakdowns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf489246d335" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Missing Anchor, One Flickr XSS]]></title>
            <link>https://masimshahzad.medium.com/one-missing-anchor-one-flickr-xss-5c633acf1011?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c633acf1011</guid>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[xs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 03:48:33 GMT</pubDate>
            <atom:updated>2026-11-13T03:48:33.070Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebArp31pSIccaXp1SgibTA.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h4>A 2013 Flickr mobile bug shows how an unanchored URL check plus CORS let an outside page inject script</h4><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>A URL allowlist that only asks “does this string contain our domain?” is not an allowlist. <a href="https://whitton.io/articles/abusing-cors-for-an-xss-on-flickr/">Jack Whitton found</a> that Flickr’s mobile site loaded page content from a path in the URL fragment, validated it with a regex that was not anchored to the start, and rendered the response as HTML. With CORS, that meant an attacker-hosted page could become script running on m.flickr.com.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. The researcher reports Flickr fixed the issue. This article intentionally omits reproduction details and payloads.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> DOM-based cross-site scripting via flawed client-side URL validation</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-79, CWE-20</li><li><strong>CVE:</strong> Not reported</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: Not reported</li></ul><h3>What Happened (high level)</h3><p>The mobile site was a single-page app of its era: navigation lived in location.hash, and JavaScript fetched the matching page over AJAX and swapped it in.</p><p>To stay on its own origin, the loader did two things. It ensured the path began with a slash, and it ran a regex meant to confirm the target was m.flickr.com. The regex was not anchored, so any URL that merely contained the hostname somewhere passed. A protocol-relative URL starting with a double slash also satisfied the “leading slash” rule while pointing at a different host.</p><p>Before CORS, a cross-origin AJAX request would simply fail, so the flaw might have looked harmless. Browsers with CORS will complete the request if the remote server opts in with the right response headers, and an attacker controls their own server’s headers. The fetched markup was then written into the page with innerHTML, executing in Flickr&#39;s origin.</p><p>Flickr fixed it by anchoring the regex and adding a separate check rejecting double-slash URLs, as Whitton describes.</p><h3>Impact</h3><p>The post does not detail impact, but my assessment is standard for XSS: script in m.flickr.com’s origin can act as the logged-in user, reading whatever the mobile site shows them and performing actions they could perform. Delivery needed only a crafted link, since the payload source lived in the URL fragment.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Parse, then compare.</strong> Use the URL parser and compare the resolved origin exactly; never regex-match raw strings.</p><p><strong>2. Prefer route names over URLs.</strong> Map fragment values to an internal route table so arbitrary hosts never enter the fetch.</p><p><strong>3. Don’t render fetched HTML with innerHTML.</strong> Return data and build DOM safely, or sanitize with a vetted library.</p><p><strong>4. Add a strict Content Security Policy.</strong> Restrict connect-src to your own origin so the browser refuses foreign fetches even if validation regresses.</p><pre>// Pseudocode: resolve fragment to a same-origin path before fetching<br>const ROUTES = new Set([&quot;/photos&quot;, &quot;/explore&quot;, &quot;/groups&quot;, &quot;/settings&quot;]);</pre><pre>function resolveFragment(hash) {<br>  const raw = decodeURIComponent(hash.replace(/^#/, &quot;&quot;));<br>  let url;<br>  try {<br>    url = new URL(raw, window.location.origin);   // handles &quot;//host&quot; too<br>  } catch {<br>    return null;<br>  }<br>  if (url.origin !== window.location.origin) return null;  // exact match<br>  const base = &quot;/&quot; + url.pathname.split(&quot;/&quot;)[1];<br>  return ROUTES.has(base) ? url.pathname + url.search : null;<br>}</pre><pre>async function loadPage(hash) {<br>  const path = resolveFragment(hash);<br>  if (!path) return showNotFound();<br>  const data = await fetch(path, { credentials: &quot;same-origin&quot; }).then(r =&gt; r.json());<br>  renderSafely(data);                               // DOM APIs, no innerHTML<br>}</pre><h3>Key Takeaways</h3><ul><li>Unanchored regexes and substring checks are not origin validation.</li><li>CORS changed old assumptions: cross-origin fetches can succeed when the attacker owns the server.</li><li>Treat any fetched markup as untrusted, even from paths you think you own.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Jack Whitton</strong>: <a href="https://whitton.io/articles/abusing-cors-for-an-xss-on-flickr/">Abusing CORS for an XSS on Flickr</a> (12 December 2013). Discovered via Awesome-Bugbounty-Writeups index. Facts come from that post; analysis, code and remediation are original suggestions.</p><p>Next breakdown: another real bug bounty case. Follow @masimshahzad for daily bug bounty breakdowns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c633acf1011" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Unsigned Form Field That Ran Code on PayPal]]></title>
            <link>https://masimshahzad.medium.com/the-unsigned-form-field-that-ran-code-on-paypal-d95d6bba567d?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/d95d6bba567d</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[remote-code-execution]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 03:44:19 GMT</pubDate>
            <atom:updated>2026-11-13T03:44:19.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbAqWQT7S9w7skVM1LnYHg.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h4>A 2015 PayPal bounty shows why server-side state must never round-trip through the client as a raw serialized object</h4><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>One hidden form field on a PayPal business site was enough to execute shell commands on its web servers. <a href="https://artsploit.blogspot.com/2016/01/paypal-rce.html">Michael Stepankin reported</a> in December 2015 that manager.paypal.com accepted an unsigned, base64-encoded Java serialized object from the browser and deserialized it, a path to remote code execution and, he notes, production database access. PayPal fixed it promptly.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. The researcher reports PayPal fixed the issue promptly. This article intentionally omits reproduction details and payloads.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Insecure deserialization of untrusted data leading to remote code execution</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-502</li><li><strong>CVE:</strong> Not reported</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: Not reported (the researcher says PayPal paid a bounty despite a duplicate; no amount given)</li></ul><h3>What Happened (high level)</h3><p>While testing the application, Stepankin noticed a POST parameter that decoded into a complex binary structure. It was a Java serialized object with no signature, meaning the server would rebuild whatever object graph a client sent.</p><p>Java deserialization runs class-specific logic while reconstructing objects. If any library on the classpath contains a class whose deserialization hooks can be chained into dangerous behavior, an attacker can supply that graph and get code execution. Public research by Chris Frohoff and Gabriel Lawrence had already shown such chains in Apache Commons Collections, and a then-recent FoxGlove Security article had popularized the risk.</p><p>Stepankin confirmed command execution with a harmless out-of-band callback, read a single system file as proof, and stopped there. He later found other endpoints in the same application using serialized objects too. His report was marked duplicate: Mark Litchfield had reported a similar issue two days earlier.</p><p>My reading: the application used the client as a storage layer for server state, and trusted it on the way back.</p><h3>Impact</h3><p>Code execution on payment-adjacent web servers is about as severe as web bugs get. Per the researcher, the foothold could reach production databases behind the application, risking merchant data, lateral movement, and persistent backdoors inside a regulated environment.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Keep state on the server.</strong> Send an opaque random ID to the client and look the state up server-side.</p><p><strong>2. If state must travel, use data formats, not object formats.</strong> JSON with a strict schema, signed with an HMAC, verified before any parsing.</p><p><strong>3. Where Java deserialization is unavoidable, allowlist classes.</strong> Use a JEP 290 ObjectInputFilter that rejects everything not explicitly expected.</p><p><strong>4. Shrink the gadget surface.</strong> Inventory and upgrade libraries; alert on deserialization exceptions.</p><pre># Pseudocode: verify-then-parse client state; never deserialize objects<br>SERVER_KEY = load_secret(&quot;form_state_hmac_key&quot;)</pre><pre>def issue_form_state(data: dict) -&gt; str:<br>    body = b64url(https://medium.com/json_dumps(data,%20sort_keys=True))<br>    mac = hmac_sha256(SERVER_KEY, body)<br>    return body + &quot;.&quot; + b64url(https://medium.com/mac)</pre><pre>def read_form_state(token: str) -&gt; dict:<br>    try:<br>        body, mac = token.rsplit(&quot;.&quot;, 1)<br>    except ValueError:<br>        raise Rejected(&quot;malformed state&quot;)<br>    if not constant_time_equal(b64url_decode(mac), hmac_sha256(SERVER_KEY, body)):<br>        raise Rejected(&quot;tampered state&quot;)          # check before parsing<br>    data = json_loads(b64url_decode(body))        # plain data, no classes<br>    return validate_schema(data, FORM_STATE_SCHEMA)</pre><h3>Key Takeaways</h3><ul><li>A serialized object from the client is code input, not data input.</li><li>Signing or keeping state server-side removes the attack surface entirely.</li><li>Duplicates happen; fixing every endpoint sharing the pattern matters more than the first report.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Michael Stepankin</strong>: <a href="https://artsploit.blogspot.com/2016/01/paypal-rce.html">[manager.paypal.com] Remote Code Execution Vulnerability</a> (25 January 2016; found December 2015). Discovered via Awesome-Bugbounty-Writeups index. Facts come from that post; analysis, code and remediation are original suggestions.</p><p>Next breakdown: another real bug bounty case. Follow @masimshahzad for daily bug bounty breakdowns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d95d6bba567d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Referer Header That Redirected OAuth Tokens]]></title>
            <link>https://masimshahzad.medium.com/the-referer-header-that-redirected-oauth-tokens-0598b9e056cb?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/0598b9e056cb</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[oauth]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 04:11:34 GMT</pubDate>
            <atom:updated>2026-11-11T04:11:34.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ViDvp_piH04ErXfk18VRVA.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h4>A 2016 Airbnb bounty shows how a convenience redirect plus login CSRF can turn strict OAuth settings into account takeover</h4><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>Airbnb locked its OAuth redirect URIs down to an exact list, and tokens still walked out the door. <a href="https://www.arneswinnen.net/2017/06/authentication-bypass-on-airbnb-via-oauth-tokens-theft/">Arne Swinnen showed</a> that a post-login redirect driven by the HTTP Referer header, combined with a forgeable login request, could deliver Facebook and Google OAuth tokens to an attacker’s page. Airbnb fixed both issues in August 2016 and paid a $5,000 bounty.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Airbnb fixed both issues in 2016. This article intentionally omits reproduction details.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Open redirect in an OAuth callback chained with login CSRF, leading to OAuth token theft</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-601, CWE-352</li><li><strong>CVE:</strong> Not reported</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: $5,000 (source-reported)</li></ul><h3>What Happened (high level)</h3><p>Identity providers had already closed the classic route: no wildcard redirect URIs, and a server-side check that the redirect URI was not tampered with during code exchange. Airbnb’s registered callbacks were a fixed list of its own localized domains.</p><p>The weak point sat inside Airbnb. When a user who was already logged in completed an OAuth round trip, the callback sent them “back” to wherever the Referer header of the initiating request pointed. A Referer is set by whichever page triggers the request, so an attacker’s page controls it.</p><p>Two more ingredients made it practical. The OAuth login start endpoint accepted a cross-site GET, so a victim could be silently logged into their own account, planting the attacker-controlled return address. Once that session existed, any later OAuth round trip followed the same redirect, even one requesting tokens in the URL fragment, which browsers carry across redirects. The callback URI itself never changed, so provider-side checks passed.</p><p>The result, per Swinnen: an authorization code usable to log in on the website, and a provider access token that Airbnb’s mobile app accepted for login.</p><h3>Impact</h3><p>Any victim already signed in to Facebook or Google with a linked Airbnb account could lose their account by visiting one page. That exposes bookings, messages, payment methods and identity documents. The attack was generic across both identity providers, not tied to one app’s misconfiguration.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Never derive redirects from the Referer.</strong> Store an internal return path server-side at flow start and accept only relative paths from an allowlist.</p><p><strong>2. Make login start a state-bound, same-site action.</strong> Reject cross-site requests to OAuth initiation, and bind state to a pre-session cookie the attacker cannot set.</p><p><strong>3. Reject unexpected response types.</strong> If the callback expects a code, a flow carrying fragment tokens is an anomaly; terminate it instead of redirecting.</p><p><strong>4. Don’t accept bare provider access tokens as mobile login.</strong> Use PKCE and a backend code exchange so a stolen token is not a session.</p><pre># Pseudocode: callback redirect that ignores Referer entirely<br>ALLOWED_RETURN_PREFIXES = (&quot;/trips&quot;, &quot;/inbox&quot;, &quot;/account&quot;)</pre><pre>def start_oauth(request):<br>    if request.headers.get(&quot;Sec-Fetch-Site&quot;) == &quot;cross-site&quot;:<br>        raise Rejected(&quot;cross-site login start&quot;)<br>    rp = request.args.get(&quot;return_to&quot;, &quot;/&quot;)<br>    if not (rp.startswith(&quot;/&quot;) and not rp.startswith(&quot;//&quot;)<br>            and rp.startswith(ALLOWED_RETURN_PREFIXES)):<br>        rp = &quot;/&quot;<br>    flow = new_flow(state=random_token(), return_path=rp,<br>                    response_type=&quot;code&quot;)<br>    bind_to_presession_cookie(request, flow)<br>    return redirect(provider_auth_url(https://medium.com/flow))</pre><pre>def oauth_callback(request):<br>    flow = load_flow_for_presession(request, request.args.get(&quot;state&quot;))<br>    if flow is None or &quot;code&quot; not in request.args:<br>        raise Rejected(&quot;invalid or unexpected flow&quot;)   # no redirect on failure<br>    complete_login(flow, request.args[&quot;code&quot;])<br>    return redirect(flow.return_path)                 # never Referer</pre><h3>Key Takeaways</h3><ul><li>Exact-match redirect URIs protect the provider hop, not your own redirects after it.</li><li>Login CSRF matters: forcing a victim into their own account can be the setup step.</li><li>Any header the browser lets other sites influence is attacker input.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Arne Swinnen</strong>: <a href="https://www.arneswinnen.net/2017/06/authentication-bypass-on-airbnb-via-oauth-tokens-theft/">Authentication bypass on Airbnb via OAuth tokens theft</a> (22 June 2017; reported 4 June 2016, fixed 18 August 2016). Discovered via Awesome-Bugbounty-Writeups index. Facts come from that post; analysis, code and remediation are original suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0598b9e056cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Five Low Bugs, One GitHub Private Repo Takeover]]></title>
            <link>https://masimshahzad.medium.com/five-low-bugs-one-github-private-repo-takeover-db16e468816a?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/db16e468816a</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 04:04:58 GMT</pubDate>
            <atom:updated>2026-11-11T04:04:58.608Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkvf2nj6O_74q45P--xVOQ.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h4>A 2014 disclosure shows why OAuth redirect checks, token storage and scope approval must be designed together</h4><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>Individually minor OAuth weaknesses can add up to a serious exposure. <a href="http://homakov.blogspot.com/2014/02/how-i-hacked-github-again.html">Egor Homakov reported</a> that five low-severity issues in GitHub’s OAuth handling, combined, could have exposed users’ private repositories. GitHub fixed them and paid $4,000, per the researcher.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Fixed in 2014. This article intentionally omits reproduction details.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Combined OAuth weaknesses leading to excessive token exposure</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-601, CWE-863, CWE-522</li><li><strong>CVE:</strong> Not stated in the disclosure</li><li><strong>Severity/CVSS:</strong> Researcher called it high severity; no CVSS reported. Bounty: $4,000 (source-reported)</li></ul><h3>Root Cause Categories (high level)</h3><p>The disclosure covered weaknesses in four areas: — Redirect URI validation that was looser than an exact match — Authorization codes not strictly bound to the redirect they were issued for — A provider token stored where the browser could read it — A trusted first-party client receiving broad scopes without explicit consent</p><p>None was critical alone. The risk came from how they compounded.</p><h3>Impact</h3><p>The researcher reported that the combination could have granted read/write access to private repositories. Private code often holds secrets and build configuration, so write access extends to supply-chain risk.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Exact registered redirect matching.</strong> Compare the full URI against registered values. No prefix, path or wildcard matching, and no normalization that changes meaning.</p><p><strong>2. Bind each code to client and redirect.</strong> Store both when issuing; require both to match at exchange (RFC 6749 §4.1.3).</p><pre># Pseudocode: provider-side issue and exchange<br>def authorize(client, redirect_uri, scopes, user):<br>    if redirect_uri not in client.registered_redirects:  # exact<br>        raise InvalidRedirect()<br>    granted = scopes &amp; client.allowed_scopes              # explicit<br>    if granted - user.consented_scopes(client):<br>        return show_consent(client, granted)<br>    return issue_code(client.id, redirect_uri, granted, ttl_short=True)</pre><pre>def exchange(code, client_id, redirect_uri, verifier):<br>    c = codes.consume(code)                    # single use<br>    if (c is None or c.client_id != client_id<br>            or c.redirect_uri != redirect_uri<br>            or not pkce_ok(c.challenge, verifier)):<br>        raise InvalidGrant()<br>    return mint_token(c)</pre><p><strong>3. Keep tokens server-side.</strong> The browser should hold only an opaque session ID, never a provider token, even encoded.</p><p><strong>4. Explicit scopes, even for first-party clients.</strong> Pre-approval should cover only registered scopes; anything broader needs consent.</p><p><strong>5. Understand PKCE’s limits.</strong> PKCE reduces the value of an intercepted code, but it doesn’t fix loose redirect matching, leaked tokens or excessive scopes.</p><p><strong>6. Separate origins and limit referrers.</strong> Host user content away from callback origins, set Referrer-Policy: no-referrer on callbacks, and strip codes from URLs after use.</p><h3>Key Takeaways</h3><ul><li>Triage low findings for how they combine, not just one by one.</li><li>Exact redirect matching and code binding reduce interception risk. Server-side tokens and explicit scopes are still required.</li><li>First-party trust should never mean silent privilege.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Egor Homakov (@homakov)</strong>: <a href="http://homakov.blogspot.com/2014/02/how-i-hacked-github-again.html">How I hacked Github again</a> (February 2014). Facts come from that post; analysis, code and fixes are original suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db16e468816a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The CSRF Token Nobody Checked]]></title>
            <link>https://masimshahzad.medium.com/the-csrf-token-nobody-checked-6c4254608a69?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c4254608a69</guid>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 04:00:16 GMT</pubDate>
            <atom:updated>2026-11-11T04:00:16.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*388oJD41KHFQ-7jzRF77XQ.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h3>A 2015 Messenger.com disclosure shows that issuing anti-forgery tokens is worthless if the server never verifies them</h3><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>A CSRF token that the server never compares is decoration. <a href="https://whitton.io/articles/messenger-site-wide-csrf/">Jack Whitton reported</a> that shortly after Messenger.com launched in April 2015, state-changing requests succeeded with the anti-forgery parameter removed entirely, and after testing a few endpoints he concluded the check was missing on every request. Facebook shipped what he called a simple and quick fix: tokens are now verified everywhere.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Both researchers report Facebook fixed the issues in 2015. This article intentionally omits reproduction details.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Cross-site request forgery (missing server-side token validation)</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-352</li><li><strong>CVE:</strong> Not stated in the disclosure</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: Not reported</li></ul><h3>What Happened (high level)</h3><p>Browsers attach session cookies to a request no matter which site triggered it. The usual defense is an unguessable per-session token that the server compares on every state-changing call. Messenger.com clients sent that token, but the new domain’s backend did not reject requests that lacked it.</p><p>Whitton compared normal requests with variants that tampered with the token. On Messenger.com, removing it still produced a normal success response for a settings change and for removing a participant from a group thread. He credits Mazin Ahmed (@mazen160), who independently found and <a href="https://mazinahmed.net/blog/facebook-messenger-multiple-csrf/">published related Messenger CSRF issues</a> in June 2015.</p><p>My reading: a new product on a separate origin inherited the client-side token plumbing but not the server-side enforcement.</p><h3>Impact</h3><p>Any page a logged-in user visited could trigger actions in that user’s Messenger account. Beyond settings, the disclosures describe removing people from threads, sending messages, and deleting threads on the victim’s behalf. For a messaging product, silent message spoofing is a trust failure, not a cosmetic bug.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Enforce in one place, default-deny.</strong> Verify the token in shared middleware that runs before any handler. Endpoints should opt out explicitly, never opt in.</p><p><strong>2. Compare tokens in constant time against server-held state.</strong> A missing, empty, or wrong-length value fails the same way as a wrong one.</p><p><strong>3. Refuse state changes over safe methods.</strong> GET and HEAD must never mutate data, or a method switch quietly bypasses the check.</p><p><strong>4. Layer SameSite cookies and Origin checks.</strong> SameSite=Lax or Strict blocks most cross-site cookie sends; an Origin or Fetch-Metadata check rejects cross-site writes even if a token check regresses.</p><pre># Pseudocode: global, default-deny CSRF gate that runs before routing<br>SAFE_METHODS = {&quot;GET&quot;, &quot;HEAD&quot;, &quot;OPTIONS&quot;}</pre><pre>def csrf_gate(request, route):<br>    if request.method in SAFE_METHODS:<br>        if route.mutates_state:<br>            raise Rejected(&quot;state change over safe method&quot;)<br>        return<br>    if route.csrf_exempt_reason:          # explicit, reviewed opt-out only<br>        return<br>    site = request.headers.get(&quot;Sec-Fetch-Site&quot;)<br>    if site not in (None, &quot;same-origin&quot;, &quot;same-site&quot;):<br>        raise Rejected(&quot;cross-site write&quot;)<br>    expected = request.session.get(&quot;csrf_token&quot;)<br>    supplied = request.form.get(&quot;csrf_token&quot;) or request.headers.get(&quot;X-CSRF-Token&quot;)<br>    if not expected or not supplied:<br>        raise Rejected(&quot;missing token&quot;)   # absent == invalid<br>    if not constant_time_equal(expected, supplied):<br>        raise Rejected(&quot;bad token&quot;)</pre><p><strong>5. Regression-test the negative cases in CI.</strong> For every mutating route, assert rejection with the token removed, emptied, altered, and with the method switched. Diff the route list against the test list so new endpoints cannot ship untested.</p><h3>Key Takeaways</h3><ul><li>Sending a token is not the defense; rejecting requests without a valid one is.</li><li>New domains and product launches deserve a fresh look at shared security controls.</li><li>Test the failure path: a CSRF suite that only checks success proves nothing.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Jack Whitton</strong>: <a href="https://whitton.io/articles/messenger-site-wide-csrf/">Messenger.com Site-Wide CSRF</a> (26 July 2015). Related independent research by <strong>Mazin Ahmed</strong>: <a href="https://mazinahmed.net/blog/facebook-messenger-multiple-csrf/">Facebook Messenger Multiple CSRF Vulnerabilities</a> (9 June 2015). Facts come from those posts; analysis, code and remediation are original suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c4254608a69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The SAML Assertion Meant for Someone Else]]></title>
            <link>https://masimshahzad.medium.com/the-saml-assertion-meant-for-someone-else-b4718fbb61fa?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4718fbb61fa</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[identity-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[aml]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 03:57:32 GMT</pubDate>
            <atom:updated>2026-11-11T03:57:32.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wX_ALSZpdy8FQVcJrKVbcQ.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h4>A 2017 Slack disclosure shows why audience, expiry and destination checks are not optional extras</h4><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>A signed SAML assertion is not a universal passport. <a href="https://blog.intothesymmetry.com/2017/10/slack-saml-authentication-bypass.html">Antonio Sanso reported</a> that Slack accepted an expired assertion issued for GitHub, naming a subject other than himself, and signed him into a Slack workspace as that subject. Slack confirmed the issue the next day, awarded $3,000 that August, and closed the report on 26 October 2017 after finishing work with affected customers.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Reported in May 2017 and closed in October 2017 after Slack completed remediations. This article intentionally omits reproduction details.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> SAML authentication bypass (insufficient assertion validation)</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-345, CWE-287</li><li><strong>CVE:</strong> Not stated in the disclosure</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: $3,000 (source-reported)</li></ul><h3>What Happened (high level)</h3><p>SAML assertions carry an audience restriction so a token minted for one service provider cannot be replayed at another. Sanso described the failure as a confused-deputy problem: Slack did not reject an assertion whose audience was a different provider. The assertion he presented was also expired, and it identified a subject that was not his own handle.</p><p>He reported the issue via HackerOne on 2 May 2017. Slack confirmed it on 3 May 2017, paid $3,000 on 26 August 2017, and closed the ticket on 26 October 2017. He noted the SAML surface was likely aimed at enterprise customers.</p><p>This article does not describe how an assertion is captured or replayed. A valid signature answers who issued the document, not whether it was minted for this service or is still inside its validity window.</p><h3>Impact</h3><p>Anyone who could present a signed assertion from another service, even an expired one, could obtain a Slack session as the subject named in that assertion. For an enterprise workspace that treats SAML as the gate, that is a full authentication bypass.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Reject any assertion that does not name this service.</strong> The configured entity identifier of this service provider must appear in the audience restriction. An assertion minted for another product is not close enough.</p><p><strong>2. Enforce the validity window, destination, and request binding.</strong> Check not-before and not-on-or-after with a small clock-skew allowance, match destination to this assertion-consumer URL, and require a pending request this service created.</p><p><strong>3. Consume assertion identifiers before you issue a session.</strong> Persist the identifier first so a retry cannot replay successfully. Commit that write, then create the local session.</p><pre># Pseudocode: verify claims, consume the ID, commit, THEN issue a session<br>def accept_assertion(assertion, now, this_sp, used_ids):<br>    if not verify_signature(assertion, this_sp.trusted_idp_certs):<br>        raise Rejected(&quot;bad signature&quot;)<br>    if now &lt; assertion.not_before or now &gt; assertion.not_on_or_after:<br>        raise Rejected(&quot;outside validity window&quot;)<br>    if this_sp.entity_id not in assertion.audiences:<br>        raise Rejected(&quot;audience mismatch&quot;)<br>    if assertion.destination != this_sp.acs_url:<br>        raise Rejected(&quot;bad destination&quot;)<br>    if assertion.in_response_to not in this_sp.pending_requests:<br>        raise Rejected(&quot;unknown request&quot;)<br>    with db.transaction():<br>        if assertion.id in used_ids:<br>            raise Rejected(&quot;replay&quot;)<br>        used_ids.add(assertion.id)  # consumption committed first<br>    return issue_session(subject=assertion.subject)</pre><p><strong>4. Pin trusted identity-provider signing keys.</strong> Accept only issuers you intended to federate with, and rotate unused keys out of the trust store.</p><p><strong>5. Regression-test negative cases.</strong> Tests should present a well-signed assertion with the wrong audience, an elapsed window, or a mismatched destination, and expect rejection.</p><h3>Key Takeaways</h3><ul><li>A signature proves who issued the assertion, not that it was minted for you.</li><li>Expiry, audience, destination and request binding each close a different failure mode.</li><li>Consume assertion identifiers before you create a session, or a retry will replay successfully.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Antonio Sanso</strong>: <a href="https://blog.intothesymmetry.com/2017/10/slack-saml-authentication-bypass.html">Slack SAML authentication bypass</a> (26 October 2017). Facts come from that post; analysis, code and remediation are original suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4718fbb61fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Race That Confirmed the Wrong Email]]></title>
            <link>https://masimshahzad.medium.com/the-race-that-confirmed-the-wrong-email-d81971d49140?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/d81971d49140</guid>
            <category><![CDATA[race-condition]]></category>
            <category><![CDATA[account-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 03:53:19 GMT</pubDate>
            <atom:updated>2026-11-11T03:53:19.760Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-PqjkIAndkPC80UFTnFHew.jpeg" /><figcaption>AI-generated illustration</figcaption></figure><h3>A 2016 Facebook disclosure shows why a confirmation secret must bind to one contact value under a lock</h3><p><em>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</em></p><p>Email confirmation is supposed to prove control of a single address. <a href="https://www.josipfranjkovic.com/blog/race-conditions-on-web">Josip Franjković reported</a> that a race in Facebook’s registration contact-point flow could make a confirmation message delivered to an address he controlled complete a different, unused address he did not. Facebook fixed the issue on 10 May 2016. The write-up does not state a bounty for this specific report.</p><blockquote><strong><em>Disclaimer:</em></strong><em> Educational and defensive use only. Patched in 2016. This article intentionally omits reproduction details.</em></blockquote><h3>Vulnerability Overview</h3><ul><li><strong>Type:</strong> Race condition in contact-point confirmation</li><li><strong>CWE (analytical mapping, not from the source):</strong> CWE-362, CWE-367</li><li><strong>CVE:</strong> Not stated in the disclosure</li><li><strong>Severity/CVSS:</strong> Not reported. Bounty: not stated in the disclosure</li></ul><h3>What Happened (high level)</h3><p>The researcher first noticed unexpected confirmation behavior while testing Facebook’s mobile registration flow in February, then produced a reliable demonstration on 20 April. Concurrent updates to an account’s pending contact point were not serialized against each other. A confirmation artifact generated during that overlap could be delivered for one address and applied to another.</p><p>He described the result simply: an unused email address could be marked confirmed on an account without the researcher receiving mail at that unused address. Facebook shipped a fix on 10 May 2016. This article does not reconstruct the interleaving.</p><p>The same post collects other race-condition cases; those are separate bugs.</p><h3>Impact</h3><p>Confirming an email the account holder does not control undermines recovery, identity proof, and any downstream check that treats a confirmed address as a trusted channel. An unused address that becomes confirmed can later be used to reset access or to impersonate ownership of that identity.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><p><strong>1. Bind each confirmation secret to one exact contact value.</strong> Store the normalized address, the account, and the purpose on the token itself. Verification must look up that triple, not “the latest pending email on this account.”</p><p><strong>2. Serialize writes to pending identity fields.</strong> Take a row lock on the account or on the token before changing a contact point or consuming a secret. Two overlapping updates should not retarget an in-flight token.</p><p><strong>3. Persist counters and consumption, then commit before raising.</strong> A check-then-act gap lets parallel requests slip through. Raising inside a transaction can roll back the attempt counter. Decide under the lock, commit, then raise.</p><pre># Pseudocode: bind, lock, persist the attempt, commit, THEN raise<br>def confirm_contact(account_id, submitted_contact, submitted_code):<br>    contact = normalize(submitted_contact)<br>    with db.transaction():<br>        token = (db.query(Token)<br>                   .filter_by(account_id=account_id,<br>                              purpose=&quot;confirm_email&quot;,<br>                              contact=contact)<br>                   .with_for_update()<br>                   .one_or_none())<br>        verdict = &quot;invalid&quot;<br>        if token and not token.used and not token.expired():<br>            token.attempts += 1<br>            ok = hmac.compare_digest(token.code_hash,<br>                                     hash_code(submitted_code))<br>            if ok:<br>                acct = (db.query(Account)<br>                          .filter_by(id=account_id)<br>                          .with_for_update()<br>                          .one())<br>                acct.email = token.contact  # only the bound value<br>                token.used = True<br>                verdict = &quot;ok&quot;<br>    if verdict != &quot;ok&quot;:<br>        raise InvalidConfirmation()</pre><p><strong>4. Expire and notify.</strong> Give secrets a short lifetime, consume them on success or lockout, and tell the user when a contact point is added or confirmed.</p><p><strong>5. Test the overlap directly.</strong> A concurrency test should submit two distinct contact values at the same time and assert that each secret confirms only itself.</p><h3>Key Takeaways</h3><ul><li>A confirmation code that is not bound to one contact value is a race waiting to happen.</li><li>Commit the attempt counter and the consumption flag before you raise an error.</li><li>Overlapping writes to identity fields need tests, not just code review.</li></ul><h3>Credit &amp; Sources</h3><p>Research by <strong>Josip Franjković</strong>: <a href="https://www.josipfranjkovic.com/blog/race-conditions-on-web">Race conditions on the web</a> (12 July 2016). Facts about this Facebook case come from that post; analysis, code and remediation are original suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d81971d49140" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Dangling CDN Record That Unlocked SSO]]></title>
            <link>https://masimshahzad.medium.com/the-dangling-cdn-record-that-unlocked-sso-8fae3acdc296?source=rss-440524433a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fae3acdc296</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[single-sign-on]]></category>
            <category><![CDATA[subdomain-takeover]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Muhammad Asim Shahzad]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 08:19:51 GMT</pubDate>
            <atom:updated>2026-11-09T08:19:51.119Z</atom:updated>
            <content:encoded><![CDATA[<p>A 2017 Uber disclosure shows why cookie-sharing SSO is only as safe as every sibling hostname</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44kN2pdKDLnNh6gNtIfyfQ.jpeg" /><figcaption>AI-generated illustration.</figcaption></figure><p>AI disclosure: This article was drafted with AI assistance as an analytical case study of a public disclosure. It is not my own discovery.</p><p>A leftover DNS alias is easy to file as housekeeping. Arne Swinnen reported that an Uber hostname still pointed at a CloudFront distribution nobody owned, and that Uber’s then-new cookie-sharing single sign-on treated sibling hostnames as part of the same trust domain. Together, the two issues could escalate into impersonation across properties protected by that sign-on. Uber removed the dangling record and paid $5,000 for the combined findings, per the researcher.</p><h3>Vulnerability Overview</h3><ul><li>Type: Subdomain takeover escalating to SSO session compromise</li><li>CWE (analytical mapping, not from the source): CWE-283, CWE-565</li><li>CVE: Not stated in the disclosure</li><li>Severity/CVSS: Not reported. Bounty: $5,000 (source-reported)</li></ul><h3>What Happened (high level)</h3><p>Uber had moved toward SSO that shared session cookies across sibling hostnames.</p><p>Separately, a static-content hostname still had a DNS alias to Amazon CloudFront, but the matching distribution was no longer registered. That dangling pointer let the researcher claim the unused CDN slot and serve content on an Uber hostname. Parent-domain cookies are visible to sibling hosts, so an attacker-controlled hostname inside that cookie scope can observe SSO material the browser sends there.</p><p>Uber had tried to shrink the lifetime of shared cookies and had added a login anti-forgery check. Those countermeasures did not stop a relayed sign-on once a sibling hostname was attacker-controlled. This article does not reconstruct that relay.</p><p>He submitted the report on 7 April 2017. Uber removed the DNS alias on 7 June 2017 after he noted he still controlled the hostname, paid a total of $5,000, and confirmed an extra binding check on session use on 7 July 2017.</p><h3>Impact</h3><p>The researcher described an authentication bypass of Uber’s SSO, reaching properties that SSO protected, including rider, partner, developer, and vault-style applications. Already-authenticated sessions were in scope, not merely visitors of the neglected static hostname.</p><h3>Remediation &amp; Defense-in-Depth (my own analysis)</h3><ol><li>Treat unclaimed cloud aliases as production incidents. Continuously inventory canonical names that point at CDNs, load balancers and SaaS vendors, and fail a release when the provider no longer has a matching owned resource.</li></ol><pre># Pseudocode: block deploys when a CNAME target does not claim the hostname<br>def assert_alias_owned(hostname, provider):<br>    target = dns.cname(hostname)<br>    if target is None:<br>        return<br>    if not provider.distribution_claims(hostname):<br>        raise DanglingAlias(hostname)<br><br>def issue_session(response, token):<br>    # Host-only cookie: omit Domain so sibling hostnames cannot read it<br>    response.set_cookie(<br>        &quot;session&quot;, token,<br>        secure=True, httponly=True, samesite=&quot;Lax&quot;,<br>        path=&quot;/&quot;,<br>    )</pre><p>2. Stop sharing session cookies with every sibling. Issue host-only cookies, or the __Host- prefix, instead of parent-domain cookies. A marketing hostname should never observe a sign-on cookie.</p><p>3. Prefer token-based SSO with exact redirect allowlists. Swinnen recommended returning to OAuth-style federation.</p><p>4. Scope review to the real trust domain. Every hostname that can see parent-domain cookies belongs in security testing and in the bug-bounty policy, including leftovers from old campaigns.</p><p>5. Treat address binding as extra depth, not the fix. Uber also added an address-binding check on session use. The researcher noted residual risk when attacker and victim share an external address.</p><h3>Key Takeaways</h3><p>Dangling cloud aliases are takeover primitives, not leftover DNS trivia.</p><p>Cookie-sharing SSO inherits the weakest sibling hostname in the parent domain.</p><p>Ownership checks belong in deploy automation, not in a yearly spreadsheet.</p><h3>Credit &amp; Sources</h3><p>Research by Arne Swinnen: Authentication bypass on Uber’s Single Sign-On via subdomain takeover (25 June 2017). Facts come from that post; analysis, code and remediation are original suggestions.</p><p>Disclaimer: Educational and defensive use only. Reported in April 2017 and mitigated that June and July. This article intentionally omits reproduction details.</p><p>Source: <a href="https://www.arneswinnen.net/2017/06/authentication-bypass-on-ubers-sso-via-subdomain-takeover/">https://www.arneswinnen.net/2017/06/authentication-bypass-on-ubers-sso-via-subdomain-takeover/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fae3acdc296" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>