How I got a $3,500 USD Facebook Bug Bounty
A stored cross-site scripting flaw existed in Facebook's share popup because filenames from linked services like Dropbox were not escaped. An attacker could execute script in a victim's browser by getting them to visit a crafted share link.
blog.detectify.com
Published on blog.detectify.com
I recently found a Stored XSS on Facebook, which resulted in a Bug Bounty Reward. If you want to know how an XSS could be exploited, you can read my colleague Mathias’ blog post about it.
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
The share popup inserted the shared item's title into the page without proper HTML escaping.
Impact
The XSS could be triggered by visiting a link while logged in, and with the m2w parameter it also worked on mobile devices, though initially it required user interaction and only affected the share popup.
What the attacker needed
A Facebook account; a Dropbox account (or other linked service); victim visits a crafted link
The fix
The issue was fixed by Facebook, as the proof-of-concept link stopped working.
How it was found
- Create a file with a malicious name and sync it to Dropbox.
- Share that file to a Facebook group using the Add File icon.
- Click the Share-link on the shared entry to trigger the stored XSS.
- Change the share URL to the sharer.php format to make the XSS trigger just by visiting the link.
- Append the m2w parameter to force the desktop version and trigger the XSS on mobile devices too.
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 share a file on Facebook, the file's name is shown on a page. If that name contains special characters that look like code, the page should display them as plain text. Here it did not, so a malicious file name could run code in the browser of anyone who opened the share link.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.