Skip to content
Open redirect Write-up Intermediate

Stealing Facebook Access Tokens using the Facebook OAuth Dialog

The Facebook registration plugin's redirect_uri validation accepted hostnames containing two or more consecutive dots, and Chrome on OSX and Linux treats multiple dots as a single dot, so an attacker could redirect the POST request containing the user's name, email and access token to an attacker-controlled domain.

Michał Bentkowski Follow

Published on blog.bentkowski.info

The original lives on blog.bentkowski.info

We do not hold its text, 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 redirect_uri validation only checked that the hostname ended with the allowed domain but did not reject hostnames containing consecutive dots, and Chrome on OSX and Linux normalises multiple dots to a single dot, so the request went to an attacker-controlled domain.

Impact

An attacker could steal the user's name, email and an access token that allowed reading the friend list, but only when the victim used Chrome on OSX or Linux.

What the attacker needed

Victim uses Chrome on OSX or Linux; victim clicks a crafted link; victim submits the registration form

The fix

The redirect_uri validation was fixed to reject hostnames containing consecutive dots.

How it was found

  1. Open the Facebook registration plugin URL with the redirect_uri parameter set to a hostname containing multiple dots.
  2. Click the register button to submit the form.
  3. Observe that the POST request containing user data and access token is sent to the attacker-controlled domain.

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 use a Facebook app, Facebook sends your data to a web address the app chooses. The app must tell Facebook which addresses are allowed. Here, the check was flawed: it let through addresses with extra dots, and some browsers treat those as normal addresses. So an attacker could trick Facebook into sending your data to their own site.

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.

More by Michał Bentkowski

View all

15 more disclosed reports, best first.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.