Home Cyber Security News 10-Year Old Facebook OAuth Framework Flaw Discovered

10-Year Old Facebook OAuth Framework Flaw Discovered

by Abeerah Hashim
Facebook OAuth framework flaw

A researcher has found a serious vulnerability in the Facebook platform that could allow hijacking anyone’s Facebook account. For discovering this OAuth Framework flaw, Facebook awarded a hefty bug bounty to the researcher.

Facebook OAuth Framework Flaw

Researcher Amol Baikar has found a serious OAuth Framework flaw affecting the Facebook platform.

Sharing his findings in a blog post, the researcher revealed that the bug existed in the “Login with Facebook” feature. Hence, it became possible for an adversary to hijack access tokens when a user would log in to other websites via Facebook. In turn, this would not only allow hacking Facebook accounts but would also give access to the respective third-party services.

While explaining the normal login flow the researcher stated,

The Facebook SDK for JavaScript uses “/connect/ping” endpoint to issue a user_access token and redirect URL set to “XD_Arbiter” which is whitelisted by default for all applications. In the background, on initialization SDK creates a proxy iframe for Cross-domain communication. Proxy frame sends back the token, code or not_authorized, unknown status via postMessage() API.

Though, the endpoint was secure enough to prevent known login bypass strategies two important points made it possible to exploit the page proxy which further exposed the cross-domain communication. As stated by the researcher, these were,

-Missing the “X-Frame-Options” header. (completely framable flow)
-Additionally “window.parent” which itself saves the user interaction to zero. Wasn’t needed to bother with window.open or any button onClick event.

Hence, the access_token would ‘leak to any origin’, and an adversary could then set up a new phone number for recovery.

While Facebook initially addressed this matter, the researcher found that the OAuth’s core endpoint “/dialog/oauth/” continued to redirect to page proxy.

Here is a demonstration of the exploit:

Facebook Awarded A Hefty $55,000 Bounty

Initially, when Baikar reached out to Facebook regarding the flaw, the tech giant quickly acknowledged the bug and developed a fix. At that time, they permanently revoked “/connect/ping endpoint” to generate access-token, and added __d(“JSSDKConfig”) line to the XD_Arbiter to prevent page proxy exploit.

The researcher deemed these steps inadequate as he could bypass the fix. Eventually, Facebook developed another fix that resolved this decade-old vulnerability.

The researcher was awarded with a bug bounty of $55,000 ( which is the maximum payout for a client-side account takeover).

Let us know your thoughts in the comments.

You may also like

Latest Hacking News

Privacy Preference Center

Necessary

The __cfduid cookie is used to identify individual clients behind a shared IP address and apply security settings on a per-client basis.

cookie_notice_accepted and gdpr[allowed_cookies] are used to identify the choices made from the user regarding cookie consent.

For example, if a visitor is in a coffee shop where there may be several infected machines, but the specific visitor's machine is trusted (for example, because they completed a challenge within your Challenge Passage period), the cookie allows Cloudflare to identify that client and not challenge them again. It does not correspond to any user ID in your web application, and does not store any personally identifiable information.

__cfduid, cookie_notice_accepted, gdpr[allowed_cookies]

Advertising

DoubleClick by Google refers to the DoubleClick Digital Marketing platform which is a separate division within Google. This is Google’s most advanced advertising tools set, which includes five interconnected platform components.

DoubleClick Campaign Manager: the ad-serving platform, called an Ad Server, that delivers ads to your customers and measures all online advertising, even across screens and channels.

DoubleClick Bid Manager – the programmatic bidding platform for bidding on high-quality ad inventory from more than 47 ad marketplaces including Google Display Network.

DoubleClick Ad Exchange: the world’s largest ad marketplace for purchasing display, video, mobile, Search and even Facebook inventory.

DoubleClick Search: is more powerful than AdWords and used for purchasing search ads across Google, Yahoo, and Bing.

DoubleClick Creative Solutions: for designing, delivering and measuring rich media (video) ads, interactive and expandable ads.

doubleclick

Analytics

The _ga is asssociated with Google Universal Analytics - which is a significant update to Google's more commonly used analytics service. This cookie is used to distinguish unique users by assigning a randomly generated number as a client identifier. It is included in each page request in a site and used to calculate visitor, session and campaign data for the sites analytics reports. By default it is set to expire after 2 years, although this is customisable by website owners.

The _gat global object is used to create and retrieve tracker objects, from which all other methods are invoked. Therefore the methods in this list should be run only off a tracker object created using the _gat global variable. All other methods should be called using the _gaq global object for asynchronous tracking.

_gid works as a user navigates between web pages, they can use the gtag.js tagging library to record information about the page the user has seen (for example, the page's URL) in Google Analytics. The gtag.js tagging library uses HTTP Cookies to "remember" the user's previous interactions with the web pages.

_ga, _gat, _gid