Hacking facebook oculus integration CSRF
A CSRF vulnerability in the Oculus-Facebook account linking flow allowed an attacker to connect a victim's Facebook account to the attacker's Oculus account by tricking the victim into visiting a crafted link. Once linked, the attacker could extract the victim's Facebook access token and use it to take over the account.
Published on josipfranjkovic.com
Oculus enables users to connect their Facebook accounts for a more "social" experience. This can be done using both the native Windows Oculus application and using browsers.
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 linking endpoint did not require a CSRF token or verify that the request came from the legitimate user, allowing an attacker to forge a request that links accounts.
Impact
An attacker could connect a victim's Facebook account to their Oculus account, obtain a first-party access token, and take full control of the victim's Facebook account, including adding a phone number and resetting the password.
What the attacker needed
Attacker has an Oculus account; victim clicks a link or visits a page; victim is logged into Facebook
The fix
The initial fix checked that the logged-in Oculus user matched the username in the SSO link, but this was bypassed by a login CSRF; the final fix added a CSRF check on the nonce-redirect endpoint and an additional confirmation click.
How it was found
- Using the attacker's Oculus account, create a GraphQL mutation to generate a Facebook SSO link.
- The response contains a link that, when visited, connects the victim's Facebook account to the attacker's Oculus account.
- The victim clicks the link or visits a page that loads it as an image, silently linking the accounts.
- The attacker queries the Oculus GraphQL API to retrieve the victim's Facebook access token.
- Using the token, the attacker adds a new phone number to the victim's Facebook account via GraphQL mutations.
- The attacker confirms the phone number and resets the victim's password.
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 link two accounts, like Facebook and Oculus, the website should verify that you really intend to do so. Here, a specially crafted link could silently link your Facebook account to someone else's Oculus account without your consent. The attacker could then access your Facebook account as if they were you.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.