There's no doubt that the worm making its rounds on Twitter is a nuisance and a huge problem for all. The fact of the matter is, somebody has collected your usernames and passwords, and many of your accounts are now Zombies, spamming each friend on your friends list through direct message, turning more unsuspecting accounts into zombies, and spreading like wildfire. Louis has talked about the worm which has surfaced on Twitter, and the urgency of the situation and potential implications for OAuth and security for Microblogging.I suggested plain text passwords could be to blame - after all, any application out there that collects your usernames and passwords could theoretically use those passwords to start such a worm, in order to gain access to people with similar bank account passwords and more. That would be the fastest way over, say, a single user trying to amass friends to dm. We're already seeing several of those compromised accounts sending iphone-related spam, so it would appear the worm developers could now be monetizing this, through your friends. At the same time, I keep seeing others criticizing the possibility that OAuth could have prevented this. I'd like to share my thoughts why.
Disclaimer
First of all, let me preface this with the fact that I am not a security expert. I have been developing software since I was 10 (I am now 31), and have plenty of real-world experience writing secure software. I've worked in health organizations requiring software to respect privacy around your health data, with e-commerce protecting your money, and I've written APIs. I understand what it takes to keep software safe. I also run my own business in which I also have to protect my users' data. I also understand that nothing's perfect. While security has not been my sole focus, I hope I can at least make some sense of the matter.
First Things First - This is an App
Let's set things straight here. Now, I could be wrong, but all evidence seems to suggest that this "worm" is actually an application, or possibly multiple applications, running on multiple servers around the world (the IP range also suggests that the same developers have targeted YouTube and Bebo in the past). After all, the only other way to log in on behalf of users and DM others would be to screen-scrape Twitter, simulating a user actually logging in via the Twitter.com interface. This is possible, but I would imagine we would see Twitter very quickly implementing some form of Captcha to slow it down. We haven't seen this yet so the most logical conclusion is that someone has written an App somewhere, which is taking advantage of the fact that you can login via plain text usernames and passwords. The same application is taking those usernames and passwords, and programmatically logging in on behalf of each compromised user and direct messaging their friends to collect more usernames and passwords.
Currently, the Twitter API makes it completely possible for anyone with your username and password to log in on your behalf, programmatically. Essentially, Twitter has given developers the key, and all keys open up the same lock. The only way to shut this down would be to kill the lock, which would shut off all developers. This is why the topic of OAuth continues to be brought up - to start off, OAuth forces any developer to use a protected key or token in order to log in on behalf of the user. The developer never has the user's username or password. The user himself keeps their own keys to Twitter without having to give a copy of those keys to developers.
It's not that simple though.
Why They're Saying OAuth Wouldn't Have Fixed the Problem
Assuming Twitter had implemented OAuth, let's assume no developer has your username or password and your information now feels secure. There is still nothing stopping those users from using those tokens to log in on your behalf. Essentially, while the developer couldn't screen scrape your data to log you in through Twitter with such a key, they could still use the API, just as these current Phishers are probably doing, to continue to send DMs and messages on your behalf. An OAuth token is just like another username and password essentially, intended just for API use.
The other criticism they're giving OAuth is that it still doesn't stop the Phishing. When the end-user authenticates through an OAuth-enabled website, they are taken back to a page on the originating site that, if they aren't logged in, asks them to log in, and that site in turn returns them back to the third party site with an OAuth token that can be used for access. Nice and simple, right? Well, the problem (which I've only seen theorized, but it is definitely possible) is that any third-party developer could create an app that redirects the user back to a page that just looks like the originating site (like Twitter.com, for instance), and pretends the user isn't logged in. The site could then collect the username and passwords of unsuspecting users, just as the current phishing scheme is doing now. The potential is still there to collect usernames and passwords, just as before.
The Advantage People Keep Forgetting
Let's ignore the last paragraph and just focus on the one before it. Even though an application can easily login on behalf of the user via the API, with OAuth, a site like Twitter now has full control over each and every application that runs on the API. OAuth has controls which allow API providers like Twitter to cut off any application using the API. So, assuming Twitter sets up some sort of manual approval process similar to Facebook's (I suggested this to Ev and Biz in the interview I attended with Scoble last year (end of the article), and they said they were working on this) to weed out the sketchy applications, it becomes much easier to just cut off the offending application. They now have record of the exact application sending these DMs, and can cut it off immediately. Currently, they're stuck chasing IP addresses, and trying to block various IP ranges, which are tough to block and easy to switch.
Back to the Problem
So, let's assume Twitter had implemented OAuth. We now have two possible scenarios: Scenario 1, said Phisher signs up to have an app on the API (or buys an app like Twply), and sends out DMs on behalf of users. (Note that the Phisher couldn't start as an individual and collect usernames and passwords in the manner this Phisher did in the current scenario because they couldn't send plain-text usernames and passwords via the API) The Phisher gets users' friends to login via OAuth, he collects the tokens to send out DMs on behalf of other users. Twitter's in-house alarms go off of such activity. Twitter shuts down said Phisher in a matter of minutes, and only a few people even see the worm.
Scenario 2 is a little more difficult, but less motivational for a Phisher on a site like Twitter. In this scenario, a Phisher creates a fake 3rd party app, accumulates a lot of followers somehow, and gets users to somehow think they are going to Twitter to login, and they collect the users plain-text usernames and passwords. The said Phisher can't do anything through the API, because it doesn't allow plain-text usernames and passwords. All they can do with it is screen-scrape Twitter, login on behalf of the user, and go about it that way. They also have to accumulate a decent sized following.
First, let's face it, there's not a ton of information that's not already public a Phisher can gather on such a site as Twitter, other than their username and password, which could also be used on other sites like banking sites. I really think most of these Phishers are more interested in spamming you, trying to make a quick buck off the unsuspecting sending spam to their friends (like the iPhone example above) - selling the data to spammers I'm certain is big bucks (at least $1,200, according to the sale of Twtply). Second, Twitter could easily implement a captcha system in such a case, and by that means they could at least slow down the Phisher or spammer. At that point, if the Phisher or Spammer is still diligent enough to get through, they have a much more controlled system, and they can then play the IP blocking game. Let's face it though - this isn't a banking site, usernames and passwords only go for a meager $1,200 from what we know, so most spammers ought to give up at that point. It's much less of a problem, and much easier of a problem to deal with than what Twitter is seeing now.
The Purpose of Security is to Make it Harder
As I said earlier, no security plan is a perfect plan, but the harder it is for a perpetrator to get through a system, the more secure that system is. Currently, there is no barrier between Twitter and those that can potentially misuse your usernames and passwords, other than you. As I said earlier, Twitter has only one lock for each user, and each developer you share your information with has the same key to that lock as you do.
However, despite the continued risk for phishing OAuth poses, as Lachlan Hardy suggests at the end of his piece here, it is still a step in the right direction, and I think would have prevented this particular worm. OAuth would have given Twitter the capability to revoke the keys of the offending phishers, enabling them to shut the worm down when it happened. After all, this isn't just a worm, it's an app, using the API, like any other developer, but in this case to spread malicious websites. I want to suggest that Twitter stop skirting around this issue, stop pretending OAuth wouldn't have solved the problem, and just implement something, quick.
Read more by Jesse Stay at Stay N' Alive.
10 Comments
Post by Jesse Stay: http://www.friendfeed.com/j...
One of the big benefits of OAuth is that the user can say that an application only gets read access to the account. So, if the API and OAuth are done correctly, you can specifiy that a 3rd party application can only read your twitter stream, not send messages on your behalf. As you stated, it does not fix everything, but the security of OAuth definitely makes it harder for someone to completely take over your account.
OAuth would help - but what will kill things like this is when they find out that it's not profitable... Twitter isn't a great place for the "follow this link!!" stuff. :)
Lucretia, I think there are definitely enough users to encourage it. The worm itself wouldn't have spread if no one clicked the link, so I think there are plenty of people that would make it worth the spammers' while. I don't expect it to go away, unless Twitter takes measures to make it go away.
You have a point - now that we're on version 5 of the phishing scam, I have to admit that I have some very gullible or very trusting folks following me.
:\
You'd think we'd all have learned by now - don't trust strange links on the internet.
I knew it was just a matter of time before twitter would be hacked. I had no idea that twitter was so open with their house keys or in this case my username and password. Hopefully this will be a good lesson for developers everywhere to place more focus on secuirty. Great article! Thanks!
Agree that OAuth raises the bar, but only slightly. First, you don't need no stinkin API to get into the original application, in this case Twitter. You call it screen scraping, but running a script against the site is easy to do using the credentials stolen from users. You can run the attack manually as most post phishing attacks against banks are and just as the Twitter defacements of this morning.
OAuth is not the way. Strong federated identity with one time password tokens is what it is going to take. In the mean time Twitter has to improve all of their security. Evidently they had an easily discoverable UI for resetting passwords that was hacked. Sheesh.
-Stiennon
Stiennon, I agree a screen scrape wouldn't be very hard, but how are they going to obtain the credentials in the first place? They couldn't write a script to make users spread it for them, at least not as fast as they are with this worm. I argue that method would be much harder and take a longer time to do on a site like Twitter. I don't think the worm we're seeing today would still exist if OAuth were in place. And I have yet to see Alex suggest Federated Identity or one time passwords as a solution - his only response is, "OAuth doesn't work".
I have to agree with Stiennon on this one. OAuth needs to be implemented but only solves third-party interactions with your account. OAuth does nothing to prevent traditional phishing attacks where you as a human mistakenly give your credentials to a fake site. Just like with any social media service (Facebook/Myspace) I can manually log in with stolen credentials and DM/spam friends and contacts. OAuth is only good when a third-party application is using your credentials. Just like how FriendFeed uses the remote key solution for third-party authentications to FriendFeed. Having stolen FriendFeed credentials I can still logon to FriendFeed as the victim. The remote key doesn't stop this type of attack. Twitter needs two-factor token based authentication and OAuth for a complete solution.
Where this particular instance was a third-party attack however, you have to admit OAuth would have fixed this phishing attack. Twitter's repeated mention that it wouldn't have makes no sense.