Loop Of Doom How A Recursive Redirect Opened The Gates To Session Hijacking ️
A login redirect endpoint only validated the first hop of a nested redirect chain, so a crafted chain could bounce the user to an attacker-controlled site with the session cookie attached. The author also claims the same chain could be used to fixate a session and to steal an OAuth authorisation code.
Free Link 🎈
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could obtain a victim's session cookie or OAuth authorisation code and reuse it to access the account, though the text gives no evidence of a real victim or of any defence that limited it.
What the attacker needed
Victim clicks a crafted link; victim logs in during the flow; attacker hosts a page that sets a cookie
The fix
The redirect handler should validate the final destination of every hop, not just the first, and should reject deeply nested redirect parameters.
How it was found
- Send a redirect request whose next parameter points back at the same endpoint, nesting the parameter again.
- Nest the next parameter deeper until the innermost value points at an attacker-controlled URL.
- Follow the chain and observe that after a few bounces the browser lands on the attacker URL with the session cookie.
- Reuse the captured session cookie in a clean browser to confirm it is authenticated.
- For session fixation, host a page that sets a chosen session cookie and lure the victim through the redirect chain to log in.
- For OAuth, point the callback's next parameter at an attacker page to capture the authorisation code, then exchange it at the token endpoint.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you log in, the site often sends you onward to another page using a redirect. If the site only checks the first redirect address and not where the chain finally ends, an attacker can make the last stop their own site and receive the login cookie or code. That lets them act as the victim.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.