Twitter has a gaping security hole. Changing your password won’t stop malicious users logging in as you!
I received a rather worrying email from Twitter. Apparently they thought my password had been compromised and needed to be reset.

Reset Your Twitter Password
After checking to see if it was valid, I went and changed my password. Any site which relied on a cookie to post to Twitter would have been blocked out. Ha! Gotcha, suckers!
The OAuth Problem
OAuth tokens are not revoked when the master password is changed.
OAuth is a great idea – rather than give your username and password to any random site, you log on to Twitter and tell them that you authorise the refering site. The site gets an OAuth token and never gets to see your password. Great! Right? Not really.
Let’s consider the following scenario.
Alice has a Twitter username and password.
Bob runs a Twitter site.
Alice visits Bob’s site. Alice is security conscious and uses OAuth.
Eve somehow discovers Alice’s password.
Eve also visits Bob’s site and uses OAuth.
Alice gets suspicious about strange activity on her account and changes her password.
Because Bob’s site uses OAuth, it does not require either Alice or Eve to re-enter Alice’s password.
In this scenario, Alice has to visit Twitter’s OAuth Connections page and revoke access to all the sites she has previously connected to. Alice has no way of knowing when each site was last accessed. She also doesn’t know which site Eve is using.

Twitter's OAuth Page
The Problem
Changing a password should – in the minds of most people – mean that you need to re-enter your password even if you have previously authenticated yourself.
In this scenario, changing the password does not revoke access to malicious users who have previously used your credentials.
Twitter should revoke all OAuth tokens when a user’s password is changed. It is the only way to ensure that stolen credentials cannot continue to be used after a user has changed their password.
Addendum
As I’ve made clear in the comments – this isn’t a vulnerability within OAuth per se. It’s a usability issue which has strong security implications.
I spoke to Eran Hammer-Lahav (listed as OAuth’s advisory contact) who said:
If you suspect someone stole your password, you should revoke any tokens you did not personally authorized. But there is no reason to revoke tokens just because you are changing password.
While I appreciate this as the official line from those in the know, it does nothing to prevent a user who uses the same sites as you. For example, I can see on every tweet that you use Dabr. Therefore, I can safely OAuth myself as you on Dabr. You’ll change your password, but you won’t revoke Dabr’s token because you personally authorised it.
Continuing The Conversation
Heise Online provides comentary in German (English version)
El Reg has a feature about Twitter and OAuth.
There’s also an interesting discussion over at Hacker News.
32 Comments to “Twitter, OAuth and Passwords – Oh My!”
Add Comments (+)No it shouldn’t. People need to understand that an OAuth token is like a separate password, specific to a site, that you’ve handed to them. Revoking them everytime a password changes means the user now has to go back and re-authorize every single site they had previously authorized.
You know about that connections tab inside your profile, right?
Oscar: I know about it, you know about it – but is that really enough? If spam and phishing can spread widely because people aren’t as well up on using Twitter as you or me, then that’s a problem – because for a service that gets widespread use, there are always going to be large numbers of not very IT savvy people using it.
Why hasn’t Twitter taken the simple step of providing a tick box option when you change your password to also revoke or not the OAuth permissions? I guess we may argue over what the default on that should be :-) But expect people to understand that changing their password isn’t enough is just asking for trouble.
I have to agree with Terence that this creates a rather large hole. However, the hole exists because it is not immediately transparent to the user that someone other than them self is using that third party site. I’m wondering if, instead of disabling part of the functionality of Oauth (not reauthorizing when the password is changed), Twitter should indicate the IP address, date and time of the last authorization for each application in the connections tab. The user would then have an indication if someone else is using that application. Additionally, having this information on the Control tab is a bit difficult to find. It might be wise to follow the lead of some of the email providers and indicate at the bottom of a primary page the last application which acquired an auth, along with the IP, date and time, if the IP is not the same as the IP accessing Twitter at that moment. Just my two cents
I think this is a sensationalist blog post vastly exaggerated just to get noticed. It’s not a flaw in oauth. If anything just a questionable design decision by Twitter.
Oauth is NOT any less secure people! I’d much much rather join a “Twitter site” by oauth than by giving them my password.You’re an idiot.
This is not a security hole. This is a feature. It’s the way OAuth is designed.
Should twitter make it clearer how applications are posting to your account, and make it easier to see and revoke tokens. Sure. But they already do that, just maybe not as clearly as you’d like.
Posts like this are sensationalist SEO spam.
Nothing quite like expert and informed opinion.
As in, Rabble, your troll-like comment is in fact, nothing like it.Terence, good point – well made. I did wonder about OAuth the other day when something like this happened to a friend of mind. Sad to hear my suspicion has proved correct.
As Terence knows, I made a Twitter app which (optionally) uses OAuth. I know that the OAuth connections page exists and I understand that changing my password does not automatically revoke any OAuth tokens that have already been approved. A typical user has a much narrower understanding of how OAuth works.
I do agree that this *is* a security issue and that it needs to be clearer to users that simply changing their password is no longer enough to block someone from using their account.
IMO an automatic revoke of all tokens is too disruptive. Dossy gets it spot on when suggesting that if you change your password then you should be given some information about OAuth and how to further protect yourself.
I’m a dev and I have no idea how to manually revoke an OAuth token. Maybe my grandma can figure it out and explain to me.
You’ve confused authentication and authorization. They are not the same thing. Your username and password are all about authentication, proving you are you, or at least know your password. OAuth is about authorization, i.e. giving another site permission to act on your behalf without exposing your authentication credentials.
That doesn’t actually avoid the problem though. If someone else finds out your password then *they* can authorise a site that you’re not aware of and keep (some) control of your account through that site until someone tells you to manually check your OAuth connections page and revoke access.
That’s hardly an ideal situation and is still a security issue.
Hey, thanks for the insight. I just noticed that Google Docs has a similar bug; if you change the password on your Google Account, they don’t delete all of your documents. I mean, who knows what an impostor might have been doing?
What exactly happens when the imposter goes to authenticate themselves on a site that you’ve already authorized using OAuth? As pzupan says above, twitter could at least say when the last authorization happened. They could also keep a count of authorizations for each site, so if you know you’ve only been through the process once on each, you’d be able to see immediately which one has been compromised.
What I don’t get here is that Twitter told _you_ that they believed your account had been compromised. I may be well off here, but doesn’t this that they probably had a pretty good idea _how_ it had been compromised – when and through what service. If this is the case, then they owe it to you to pass that nugget of information along, and perhaps even revoke (or suspend?) the token for the suspect service.
They didn’t give you an idea of what triggered this alert?
I agree, this Is certainly not something I had thought of, so I’d like Twitter to warn me. It’s not a bug, just a usage anomoly. Change will probably only occur when this is actually exploited.
I can’t believe how much comment abuse you’re getting!
Trackbacks/Pingbacks
- Dossy’s Blog: Terrence Eden doesn’t understand the point of OAuth
- heise online – Hintertür bei Twitter schließen « Rolf Schaumburg's privater Blog
- Identity Security - TechnoPhobia
- Wolfstar: public relations (PR), social media and word of mouth (WOM) marketing and communications : Wolfstar















Hi Terence,
Great to hear these thoughts. What approaches do other OAuth providers take to this problem? Revoking all OAuth tokens on a password change/reset takes away a good chunk of the value that many people get from using OAuth.
Maybe making ‘revoke all’ an option for users after a password reset would improve the situation.