Tokens from services like Facebook can be stolen
A page on Badoo's site reads access tokens from the URL and sends them to any opener window using postMessage with a wildcard target origin. An attacker can host a page that opens this URL, receive the token, and use it to log in to Badoo.
Originally disclosed on HackerOne
- Triaged in 20 hours
- Fixed in 16 days
- Paid in 20 hours
- Disclosed after 8 months
Description
This file https://mus1.badoo.com/cb.html looks for the parameters access_token, token and code in the URL and send the value back to the window.opener using window.opener.postMessage(message, '*');. Because you specified * as the value of the second parameter of postMessage(), the browser is not going to check which is the opener and will send the message to any opener with the token.
The problem here is that you can receive the message from a site you control and then use this token to even log in Badoo.
Proof of concept
- Download the file opener.html that I attached.
- Sign up to Badoo using Facebook.
- Using the browser where you are logged in to Facebook, open the file that you downloaded in step 1.
- Click on Click Here.
- Wait a few seconds.
- When it's done, in the page will appear your Facebook token for Badoo.
I attached a screen capture too (the size is 1.4MB). Please, let me know if you need more information.
Attachments
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could steal a victim's Facebook token for Badoo and use it to log in to the victim's Badoo account.
What the attacker needed
Victim logged in to Facebook; victim visits attacker's page; attacker page opens Badoo URL
How it was found
- Download the provided opener.html file.
- Sign up to Badoo using Facebook.
- Using the browser where you are logged in to Facebook, open the downloaded file.
- Click on 'Click Here'.
- Wait a few seconds.
- The page will display your Facebook token for Badoo.
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 report has not been written yet. The Original tab links to the source.
When you log in with Facebook, Badoo gets a special code (a token) that proves who you are. A page on Badoo's site was taking that code from the web address and passing it to whatever page opened it, without checking if that page was trustworthy. So an attacker could make a page that opens the Badoo page, receive the code, and then use it to log in as the victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.