Stealing Side-Channel Attack Tokens in Facebook Account Switcher
The account switcher page accepted a 'next' parameter that controlled the redirect destination and appended a security token (fb_dtsg_ag) to the URL. An attacker could craft a link that redirects to an attacker-controlled Facebook app, leaking the token and potentially bypassing side-channel protections.
Published on medium.com
After receiving an email from facebook that somebody requested to join my group I decided to open the link in a different account to see the results. I was brought to the “account switcher” page that looks like this.
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
Root cause
Likely the account switcher page failed to validate the 'next' parameter and included a sensitive token in the redirect URL, allowing token leakage to an attacker-controlled domain.
Impact
An attacker could steal the fb_dtsg_ag token, potentially bypassing side-channel attack protections, though the token alone may not grant full account access.
What the attacker needed
Victim clicks a crafted link; attacker controls a Facebook app
How it was found
- Open the account switcher page with a crafted 'next' parameter that points to a Facebook redirect endpoint.
- The redirect endpoint then forwards to an attacker-controlled Facebook app URL.
- Click 'continue' to trigger the redirect, which includes the fb_dtsg_ag token in the URL.
- The attacker's app logs the token from the request.
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 switch accounts on Facebook, the site uses a special code (called a token) to make sure the request is legitimate. The page that handles the switch let the user decide where to go next, and it put that token in the web address. By crafting a link, an attacker could send the token to a website they control, which might let them bypass security checks.
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.