Twitter OAuth feature can be abused to hijack accounts, researcher says

The callback feature in Twitter's OAuth implementation can be abused, a researcher said at Hack in the Box

A feature in the Twitter API (application programming interface) can be abused by attackers to launch credible social engineering attacks that would give them a high chance of hijacking user accounts, a mobile application developer revealed Wednesday at the Hack in the Box security conference in Amsterdam.

The issue has to do with how Twitter uses the OAuth standard to authorize third-party apps, including desktop or mobile Twitter clients, to interact with user accounts through its API, Nicolas Seriot, a mobile applications developer and project manager at Swissquote Bank in Switzerland, said Thursday.

Twitter allows apps to specify a custom callback URL where users will be redirected after granting those apps access to their accounts through an authorization page on Twitter's site.

Seriot found a way to craft special links that, when clicked by users, will open Twitter app authorization pages for popular clients like TweetDeck. However, those requests would specify the attacker's server as callback URLs, forcing users' browsers to send their Twitter access tokens to the attacker.

The access token allows actions to be performed with the associated account through the Twitter API without the need of a password. An attacker could use such tokens to post new tweets on behalf of the compromised users, read their private messages, modify the location displayed in their tweets, and more.

The presentation essentially covered the security implications of allowing custom callbacks and described a method of using this feature to masquerade as legitimate and trusted Twitter clients in order to steal user access tokens and hijack accounts, Seriot said.

An attacker could send an email with such a crafted link to the social media manager of an important company or news organization suggesting, for example, that it's a link to follow someone on Twitter.

When clicking on the link, the target would see an SSL-protected Twitter page asking him to authorize TweetDeck, Twitter for iOS, or some other popular Twitter client, to access his account. If the target is already using the impersonated client, he might believe that the previously granted authorization has expired and they need to re-authorize the app.

Clicking the "authorize" button would force the user's browser to send the access token to the attacker's server, which would then redirect the user back to the Twitter website. The user wouldn't see any sign of something bad happening, Seriot said.

In order to perform such an attack and craft the special links in the first place, the attacker would need to know the Twitter API tokens for the applications he wishes to impersonate. These are generally hardcoded in the applications themselves and can be extracted in several ways, Seriot said.

The developer built an open-source OAuth library for Mac OS X that can be used to interact with the Twitter API and generate authorization links with rogue callback URLs. However, the library, which is called STTwitter, was built for legitimate purposes and is intended to add Twitter support to Adium, a popular multi-protocol chat client for Mac OS X.

According to Seriot, Twitter could prevent such attacks by disabling the callback functionality from its OAuth implementation. However, he doesn't believe that the company will do this, because it's technically a legitimate feature that's used by some clients.

Twitter did not immediately respond to a request for comment sent Thursday.

Join the Good Gear Guide newsletter!

Error: Please check your email address.

Tags Internet-based applications and servicesonline safetysecurityAccess control and authenticationHITBtwitterSwissquote Bankinternetsocial mediaprivacy

Struggling for Christmas presents this year? Check out our Christmas Gift Guide for some top tech suggestions and more.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Lucian Constantin

IDG News Service

Most Popular Reviews

Follow Us

Best Deals on GoodGearGuide

Shopping.com

Latest News Articles

Resources

GGG Evaluation Team

Kathy Cassidy

STYLISTIC Q702

First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni

STYLISTIC Q572

For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell

LIFEBOOK UH574

The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi

STYLISTIC Q702

The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott

STYLISTIC Q702

My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Latest Jobs

Shopping.com

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?