Advanced levelPremiumbounty: $1100

OAuth open redirect — backslash bypass of redirect_uri (POE report walkthrough)

Walkthrough of the POE report: open redirect via `\` (backslash) in redirect_uri that POE's parser didn't normalize correctly. URL-based XSS chained for token theft.

Gorka El BochiMay 11, 202612 min

Quick answer

POE (Quora) had a redirect_url validator that checked it started with /, didn't start with //, and didn't contain :. Bypass: /\evil.com. The backslash passes all three checks because "it isn't a slash." But browsers normalize \/ per the WHATWG URL spec → it resolves to //evil.comhttps://evil.com. Combined with the already-issued p-b cookie + a canvas shouldAutoOpen whitelist that trusted poe.com as a hostname → zero-click chain. $1,100 H1 #3652197.


1. The vulnerable validation

typescript
// redirectUrlUtils.ts (POE — anonimizado)
function isValidRedirect(redirectUrl: string): boolean {
  return (
    redirectUrl.startsWith("/") &&        // 1: debe ser path relativo
    !redirectUrl.startsWith("//") &&      // 2: bloquea protocol-relative
    !redirectUrl.includes(":")            // 3: bloquea javascript:, https:, etc
  );
}

At first glance it looks OK. The payload /\evil.com breaks it:

CheckInput /\evil.comResult
startsWith("/")Yes, starts with /✅ passes
!startsWith("//")It's /\, not //✅ passes
!includes(":")No :✅ passes
ValidatorACCEPTS

But the browser, upon seeing /\evil.com, normalizes it per the WHATWG URL spec:

bash
/\evil.com  →  //evil.com  →  https://evil.com

That normalization happens when the browser resolves the final URL of the Location: header or of a window.location = "...". The validator checks before the normalization; the browser executes after.


2. The attack URL

ini
https://poe.com/login?redirect_url=/%5Cevil.com
  • %5C is the URL-encoding of \ (backslash).
  • Server decodes → redirect_url = /\evil.com.
  • Validator accepts → embeds it in googleOauthState.next_url.
  • Post-OAuth callback → Location: /\evil.com.
  • Browser resolves → https://evil.com.

3. End-to-end attack flow

less
[Attacker] sends link: poe.com/login?redirect_url=/%5Cevil.com[Victim] clickpoe.com/login (real page)
                                  ↓
[POE] validates redirect_url (passes) → embeds in googleOauthState[Victim] clicks "Continue with Google" → authentication[Google] callback with valid code to poe.com[POE] reads next_url from stateemits Location: /\evil.com[Browser] normalizes /\ → // → resolves to https://evil.com[Victim] lands on evil.com with the p-b cookie already issued on poe.com

If the victim was already logged in, the OAuth step is skipped and the redirect happens directly.


Keep reading the full chain

The remaining part includes the step-by-step PoC, exploitation code and the full chain that led to impact. Available to subscribers.

Practice this in a lab

Open Redirect Backslash Bypass

Solve

Keep learning · free account

Save your progress, unlock advanced payloads and rank your flags.

Create account

Related articles

hunters training
711

hunters training

labs from real reports
55

labs from real reports

completions
1,205

completions

in bounties practiced
$213,970

in bounties practiced

46 flags captured this week·Real reports from HackerOne · Bugcrowd · Intigriti·No commitment·Free Academy