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 CSO newsletter!

Error: Please check your email address.

Tags Internet-based applications and servicesonline safetysecurityHITBAccess control and authenticationSwissquote Banktwittersocial mediainternetprivacy

More about SwitzerlandTweetDeck

Show Comments

Featured Whitepapers

Editor's Recommendations

Solution Centres

Stories by Lucian Constantin

Latest Videos

  • 150x50

    CSO Webinar: Will your data protection strategy be enough when disaster strikes?

    Speakers: - Paul O’Connor, Engagement leader - Performance Audit Group, Victorian Auditor-General’s Office (VAGO) - Nigel Phair, Managing Director, Centre for Internet Safety - Joshua Stenhouse, Technical Evangelist, Zerto - Anthony Caruana, CSO MC & Moderator

    Play Video

  • 150x50

    CSO Webinar: The Human Factor - Your people are your biggest security weakness

    ​Speakers: David Lacey, Researcher and former CISO Royal Mail David Turner - Global Risk Management Expert Mark Guntrip - Group Manager, Email Protection, Proofpoint

    Play Video

  • 150x50

    CSO Webinar: Current ransomware defences are failing – but machine learning can drive a more proactive solution

    Speakers • Ty Miller, Director, Threat Intelligence • Mark Gregory, Leader, Network Engineering Research Group, RMIT • Jeff Lanza, Retired FBI Agent (USA) • Andy Solterbeck, VP Asia Pacific, Cylance • David Braue, CSO MC/Moderator What to expect: ​Hear from industry experts on the local and global ransomware threat landscape. Explore a new approach to dealing with ransomware using machine-learning techniques and by thinking about the problem in a fundamentally different way. Apply techniques for gathering insight into ransomware behaviour and find out what elements must go into a truly effective ransomware defence. Get a first-hand look at how ransomware actually works in practice, and how machine-learning techniques can pick up on its activities long before your employees do.

    Play Video

  • 150x50

    CSO Webinar: Get real about metadata to avoid a false sense of security

    Speakers: • Anthony Caruana – CSO MC and moderator • Ian Farquhar, Worldwide Virtual Security Team Lead, Gigamon • John Lindsay, Former CTO, iiNet • Skeeve Stevens, Futurist, Future Sumo • David Vaile - Vice chair of APF, Co-Convenor of the Cyberspace Law And Policy Community, UNSW Law Faculty This webinar covers: - A 101 on metadata - what it is and how to use it - Insight into a typical attack, what happens and what we would find when looking into the metadata - How to collect metadata, use this to detect attacks and get greater insight into how you can use this to protect your organisation - Learn how much raw data and metadata to retain and how long for - Get a reality check on how you're using your metadata and if this is enough to secure your organisation

    Play Video

  • 150x50

    CSO Webinar: How banking trojans work and how you can stop them

    CSO Webinar: How banking trojans work and how you can stop them Featuring: • John Baird, Director of Global Technology Production, Deutsche Bank • Samantha Macleod, GM Cyber Security, ME Bank • Sherrod DeGrippo, Director of Emerging Threats, Proofpoint (USA)

    Play Video

More videos

Blog Posts

Market Place