Security researcher Vinoth Kumar says Facebook awarded him $20,000 after he discovered and reported a Document Object Model-based cross-site scripting (DOM XSS) vulnerability that could have been exploited to hijack accounts.
The researcher says he discovered the vulnerability in the window.postMessage() method, which is meant to safely enable cross-origin communication between Window objects.
What Kumar discovered was that the login SDK sends an initial payload to the proxy iframe, and that the payload contains the click URL of the ‘Continue with Facebook’ button, which is rendered in the proxy iframe.
The researcher identified two manners in which the vulnerability could be exploited, one involving opening a pop-up window and then communicating with it, and the other relying on opening an iframe and communicating with it.
Successful exploitation of the vulnerability would have allowed an attacker to obtain the victim’s session cookies and hijack their account.
“Due to an incorrect post message configuration, someone visiting an attacker-controlled website and clicks login with the Facebook button would trigger XSS on facebook.com domain behalf of logged-in user. This would have let to 1-click account takeover,” Kumar explains.
He has published a video to demonstrate the attack:
Facebook was informed about the discovery on April 17. The social media platform addressed the vulnerability three days later by “adding facebook.com regex domain and schema check in the payload url param.” The company awarded the researcher a $20,000 bug bounty two weeks later.