Twitter Exploit Still Works
Yesterday I posted an article about a serious vulnerability I found in Twitter. As it was a bit on the geeky side, it may well have gone over a few people’s heads, so I thought I’d try to explain it in a bit more detail. Incidentally I don’t think Twitter really got it either, as we’ll see in a moment.
Twitter Exploit Video
Why should I care?
With a few minutes work, someone with a bit of technical expertise could make a Twitter ‘application’ and start sending tweets with it. Using the simple instructions below, it can be arranged so that if another Twitter user so much as sees one of these tweets – and they are logged in to Twitter – their account could be taken over.
Imagine that for a moment. Simply by seeing one of these tweets, code can be run inside your browser impersonating you and doing anything that your browser can do. Perhaps it may simply redirect you to a pornographic website? Or maybe delete all of your tweets? Send a message to all of your friends? Maybe it would delete all of your followers, or worse still, just send the details needed to log in to your account off to another website for someone to use at their leisure.
All of that, just from seeing one of these tweets.
If I tweet something, all of my followers will see it instantly. Do you trust everyone you’re following?
I could mention a few of the trending topics of the moment, and there’s a good chance that someone will see one of my tweets that way.
Maybe I could just drop your name into my tweet and see if you look at it to see why I’ve mentioned your name?
What should I do?
There are a couple of steps you can take to try to stop you being affected.
- If you’re not logged in to Twitter, there’s no opportunity to steal your details or impersonate you, however malicious code could still send you to other websites or otherwise annoy you, so it doesn’t completely fix the problem.
- Unfollow anyone you don’t know or don’t trust that could be exploiting this. Who’s to say they’re not already stealing your details? If you don’t see their tweets they can’t harm you.
- If you use something other than the Twitter website to view your tweets, perhaps one of the applications mentioned below, you should be fairly safe, though without looking at each one individually it’s hard to be sure. Still, you’re likely to be pretty safe this way.
How does it work?
If you’ve used Twitter you may have noticed that whenever you ‘tweet’, along with the time it also includes the name of the Twitter application you used to send the update. Many people just use the Twitter website, others use dedicated applications – like TweetDeck, TwitterFox or HootSuite as seen below in one of Dave’s tweets.

Where that link goes is up to the developer of the application. If they change it, it affects all of the tweets ever sent with that application. Fair enough. This can be quite simply changed by filling out a form on the Twitter website, and takes effect instantly.
(Semi-)Technical Details
Twitter made one of the most basic mistakes in developing web applications – never blindly trust data that is provided from the outside world! Their form did no – or some very, very basic – checking on what you enter in the box. I pointed this out in the article yesterday and they have since attempted to fix it. However, Twitter have completely missed the point.
- Whatever I type in that box will appear on the end of my tweets.
- I can type in some raw HTML code into that box, and it will get included on the end of my tweet.
- Anyone who sees that tweet will then be viewing that code.
- That code can be JavaScript <script> tags

The code between those <script> tags can do anything the Twitter website can do. Send you off to another page, change your account details, send tweets, add or delete followers, etc.
I say Twitter have missed the point because they apparently “fixed” the problem last night.
Their idea of fixing it is to stop you putting spaces in the address box. Spaces. Other than that, everything else is fair game.
As an example, see @apifail2. It pops up a (harmless) box on your screen using JavaScript – but if it can do that, it can do a lot worse!
I think I’m going to stay off Twitter for a couple of days!
P.S. This isn’t the first time we’ve found vulnerabilities in Twitter… I wonder how many more there are out there? We got no response from them yesterday either, which is a shame. We don’t want to stop using their service because we’re worried about security, and I’m sure we’re not the only ones.
James
Update 28/08: This has probably been fixed, but without any official communication from Twitter it is hard to say for sure. The accounts I was using have been suspended and the exploit no longer appears to work as described. Whether it might still be working in a slightly altered form or on other accounts created before the fix I do not know.
87 Comments
Dave - http://www.djb31st.co.uk
Very worrying indeed!!
Think i’ll stick to twitterfox for a few days!
I can’t believe that their “FIX” was to just disable spaces!!
I think they need introducing to the strip_tags function?
Tiger - http://www.seoblackout.com
It seems that they are more afraid of dofollow links than security issues….
rishil - http://designer-watches.org
ha ha ah, Dave, once again you prove why you are one of my Heroes…
Shane - http://www.shanedj.com
Bad vulnerability, epic find though.
just Guido
Good stuff. And amusing pop-up. =)
I’m no developer so I don’t have a clue about how ‘bad’ this is, but it’s concerning that they’re not giving this the priority it deserves from a user’s point of view. After they’ve been warned and shown a demonstration. Twice. Wonder how long until they will ban this account. 🙂
Out of curiousity: is it against the law or Twitter TOS to build an app that would actively spread the word in a non harmful way while proving the point?
Allan Stewart - http://www.fireflyseo.com
Man, this is terrible news! I think I might stay off Twitter for a while.
Might be sensible to start a twitter badge campaign to increase awareness?
Anyone up for it?
Justin Parks - http://www.justinparks.com
Well this is a bit of a bollocks up isn’t it. @just Guido as far as i can tell it is against their terms of service, but once the damage is done, its a bit late to wander off quoting legal babble and even if the malicious accounts are banned or stopped, they just open a new one straight away in a few seconds, not good.
Nice find Dave all in all, but it worries me more what you haven’t come across, if that’s the soft version then what happens when bank details and identity theft kicks off. I would expect twitter to address this asap, publicly and in depth and start beefing up security and code immediately before something BAD happens.
Shane - http://www.shanedj.com
Get the Badge set up Allan, i’ll join in!
Gareth Trufitt - http://trufitt.com
How they haven’t got their arses in gear and fixed this yet I do not know!
David Fairhurst - http://www.intelligentretail.co.uk
Nice find Dave, more headaches for the Twitter tech bods I guess! Seems like a bit of a schoolboy error to me – I would have thought that all forms on such a high profile website would have draconian levels of input checking!
Duncan - http://www.duckonwater.co.uk
This is a rookie mistake made by guys who should know better! this is just asking for exploitation!
Good write up and examples – thanks for the heads up, il make sure I Tweet this article.
Massive Twitter Security Problem Not Resolved Just Yet - pingback
[…] today followed up on yesterday’s blog post with another one correctly claiming that the exploit still very much works. He proved as much by creating another dummy account on Twitter, which pops up a (harmless) dialog […]
Allan Stewart - http://www.fireflyseo.com
I am proposing this image to add to your twitter profiles. I just purchased from IStock so should be fine to use…
http://www.fireflyseo.com/images/twitter-security.jpg
Dave hope you don’t mind the link, feel free to host on your site if you want to remove it.
rishil - http://designer-watches.org
Question: Would you guys consider this a hack?
Massive Twitter Security Problem Not Resolved Just Yet | Posts MarketPlace - pingback
[…] today followed up on yesterday’s blog post with another one correctly claiming that the exploit still very much works. He proved as much by creating another dummy account on Twitter, which pops up a (harmless) dialog […]
DaveN
@rishil we where careful not to pull any 3rd party JS but you could easily turn it into the biggest Malware distribution platform
Dave
Neil Yeomans - http://twitter.com/neil_yeomans
Awww poor James Slater hasn’t gotten any credit for this (in blog comments or external articles), but Dave has:
http://www.techcrunch.com/2009/08/26/massive-twitter-security-problem-not-resolved-just-yet/
Just to clarify: this is James’s find right?
Falha de segurança crítica no Twitter permanece no ar mesmo depois de (supostamente) consertada | Web - pingback
[…] o especialista em seu blog, a falha de segurança está no campo da API que permite que programadores insiram a URL do […]
Allan Stewart - http://www.fireflyseo.com
Rishi / Everyone…
It is a client side hack so its unlikelly Twitter web servers are compromised. The likelly hood is this exploit has been in the wrong hands for a while and that there are a number of twittter accounts out there which are used to gather in user password information. As everyone knows, MOST non tech users use the same password on most websites, many of which, such as Amazon hold credit card details. In my view this security exploit has the potential to be extremelly damaging. The trouble is the damage may have already be done. I am not trying to be a doom monger but either way Twitter should responde to this as a top priority ticket item. As Justin Parks states if this is indicative of the general approach to security at Twitter then I would advise people to stop using it imediatly.
If you do feel brave enough to use Twitter at the moment and want to help raise awareness of this issue I have posted a tweet on adding a wee image to your profile picture.
http://twitter.com/fireflyseo/status/3554729419
dan
if there is an exploit Dave is bound to find it 😉
james
Thanks Neil, you are correct. Oh well!
Gary Gilbert - http://www.garyrgilbert.com/blog
Dave,
Thanks a lot for making us aware of this very nasty but simple to fix problem. I am a little disappointed that twitter hasn’t managed to fix this yet. I mean xss is one of the FIRST things you test for, or perhaps thats just me.
Dhruv Sood - http://www.psoodocode.com
Awesome find! And amazing how they still haven’t fixed it. I have one word for Twitter – AntiXSS!
Marty Martin - http://www.twitter.com/mosquitohawk
That is crazy scary. Kudos to you for discovering it, you made the front page of Mashable today. It’s amazing that the folks at Twitter aren’t taking this *much* more seriously.
Massive Twitter Security Problem Not Resolved Just Yet | Tech Daily - pingback
[…] today followed up on yesterday’s blog post with another one correctly claiming that the exploit still very much works. He proved as much by creating another dummy account on Twitter, which pops up a (harmless) dialog […]
Bill - http://www.billhartzer.com/
Amazing that their fix was “spaces”. I’m not a programmer by any means, but still that just doesn’t sound right. I totally agree: stop following people who you don’t know and trust. There’s most likely all sorts of other security issues with Twitter that we just don’t know about yet.
Nick Stamoulis - http://www.brickmarketing.com
I think as Twitter grows larger and larger we will see more of these types of efforts. Hopefully Twitter will beef up their internet security a bit more.
Someone
It’s XSS.. I mean… Get over yourself.
Tom - http://socialmediasecurity.com
Another way to mitigate this as a user (if using the Twitter web client) is to install the NoScript add-on for Firefox. NoScript can prevent XSS in “most” cases.
Warning: Evil Twitter Pop-up Could Hack Your Account - pingback
[…] such panic? Because, if you ever see a pop-up similar to that above, it may not be as innocuous as the one created by the guys over at Dave Naylor’s blog. In fact, someone with half an ounce of tech savvy […]
Tobias Svensson - http://return42.blogspot.com/
While this seems to be the dream of every Twitter-spammer, I wonder why I haven’t seen this in action, yet.
Victor Lonmo - http://www.googlerank.ca
Excellent article Dave. Given the vulnerability of Twitter it is surprising that it has not been attacked this way. It’s also shocking that Twitter does not have more comprehensive filter for all messages sent through it. (I’m not much of a programmer and even I know better.)
Andre
Wow David you are a genius for finding this. This is why you are an SEO god!
ps just playing around, James is my new hero.
Scott Bowler - http://blog.quba.co.uk
Looks like it’s been fixed, recently tweets containing code characters get converted to their HTML code equivalent
Bob
Your twitter account just got suspended.
Vinay - http://twitter.com/iVinay
Sweet, Twitter has gone ahead banning the @apifail account but not fixing their security loophole! Just great!
carla
I see that Twitter have suspended the apifail2 account – interesting to see what they do over the next couple of hours re the problem
Twitter struggles to plug security hole | Twimmer.com :: Twitter News - pingback
[…] to be stolen and even allow for the installation of malware. Twitter claims to have closed it, but Naylor says in an update today that a vulnerability still exists. Naylor explains why users should care:With a few minutes work, someone with a bit of technical […]
Matt Katz (mattkatz) 's status on Wednesday, 26-Aug-09 15:00:03 UTC - Identi.ca - pingback
[…] http://www.davidnaylor.co.uk/twitter-exploit-still-works.html […]
Andy
Firstly, feel a bit sorry for you James. I suppose that’s part of the double edged sword that comes with blogging on a domain that became famous for one person’s contributions! Still a few of us spotted that it was you and not Dave that picked up on this, so kudos!
Secondly, who else instantly thought of using a twitter name in a decent search vertical, building up it’s rank and then chucking in a redirect using this vuln? 😛
Your Twitter Account is in Jeopardy - pingback
[…] According to Slater (and the issue has been acknowledge by Twitter, just not fixed), anyone who simply sees your tweets from when you’re logged into Twitter, can run some code inside your browser and take over your account, which can lead to malware spreading, impersonation, or whatever you can imagine. […]
DaveN
LOL @andy James works here as well he is on the pay roll..
Dave
Andy
Ahh, my uni took that stance: You are being educated by us and therefore anything you do, write or create whilst under our instruction is ours 😛
I gathered he was part of the team at Bronco, but he should still get credit where credit is due!
DaveN
Your comment…
paul carpenter - http://www.itsafamilything.co.uk
Hehe – this is moving fast… the Guardian are on it. Still no official word from Twitter…
Andy
Double kudos… earning your boss 3 followed links from a major UK newspaper website 😛
maurice - http://hauntingthunder.wordpress.com/
Fuck my hat Twitters technical people realy are fracking useless when oneof them went whining about “how the internet wasnt (built 25 years ago) wasnt suitable for them.
I even got a link from valywag and a comment from Vint Cerf on my blog (well ime 85% certain it was him)
John T.
Who did you try contacting at Twitter? If you send an email to security@twitter.com you should get a response within the day.
Nick - http://anderenterprises.com
has there been any new developments on this security issue yet? I am surprised that they would not put a real quick stop to it. REALLY appriciate the heads up on this one. glad That I am following such alert people. Thanks again!
Your Twitter Account is in Jeopardy | The Free Site Hosting | Reviews & Top Hosts - pingback
[…] According to Slater (and the issue has been acknowledge by Twitter, just not fixed), anyone who simply sees your tweets from when you’re logged into Twitter, can run some code inside your browser and take over your account, which can lead to malware spreading, impersonation, or whatever you can imagine. […]
Twitter Security Exploit Still Hasn’t Been Fixed - pingback
[…] to David Naylor, who found the exploit, the security issue still hasn’t been fixed, meaning that it still presents a danger to all Twitter users. Today, David has provided more […]
Your Twitter Account is in Jeopardy - Google Live Search - pingback
[…] According to Slater (and the issue has been acknowledge by Twitter, just not fixed), anyone who simply sees your tweets from when you’re logged into Twitter, can run some code inside your browser and take over your account, which can lead to malware spreading, impersonation, or whatever you can imagine. […]
Your Twitter Account is in Jeopardy | Google MSN Search - pingback
[…] The skinny of it is if you tweet through Twitter.com, you may be putting your account in jeopardy. According to Slater (and the issue has been acknowledge by Twitter, just not fixed), anyone who simply sees your tweets […]
Your Twitter Account is in Jeopardy | Msn Yahoo Google - pingback
[…] The skinny of it is if you tweet through Twitter.com, you may be putting your account in jeopardy. According to Slater (and the issue has been acknowledge by Twitter, just not fixed), anyone who simply sees your tweets […]
Twitter Has Evil Pop-Up That Could Hack Your Account - News: Everything-e - pingback
[…] such panic? Because, if you ever see a pop-up similar to that above, it may not be as innocuous as the one created by the guys over at Dave Naylor’s blog. In fact, someone with half an ounce of tech savvy […]
Gabe da Silveira - http://darwinweb.net/
@Allan Stewart – Just at a cursory glance I see no reason why this would expose the user’s password. The exploit is to steal their Twitter login cookie. There should be no password information there. If there is, well, then the problem is much worse than indicated here.
Stuart - http://www.designmeme.com/
Setting up a user style-sheet (eg. with the Stylish Firefox extension) and adding the following:
span.entry-meta span a script { display:block; color:#fff; background:#f00; }
will let you quickly see if anyone of the tweets you’re viewing on the Twitter website contain scripts inside the link to the posting application’s website.
Miguel
LOL, that just shows how good of a framework ROR is. (jk)
Jonthan Lulich - http://60MinutesFame.com
all i can say, is ouch! for such a widely used service you would think they could find a correction for this exploit. same goes for myspace. seems to be several vulnerabilities there as well, concerning javascript injections. hate to stop using these services due to lack of security
hope they find a fix soon!
Cooksey
Naww, It banned the account.
Freelance Seo - http://www.seomysite.co.uk/
Indeed, they do seemed to be far more concerned over dofollow links than security. Which by the way I still think its ridiculous that tweet links are not followable….
I never really liked twitter anyway…………….. 😀
Jack Hanington
Its nice of you to share your IP address with the readers of this post + all of youtube. =D
Just saying… in the bottom right hand corner of your browser is your IP and that you are not on a proxy. Is this the onion router? Good post though.
DaveN
HI Jack, The IP address the IP of Twitter thats all:)
Amelia Vargo
Excellent find, it’s a shame that Twitter themselves don’t seem to be doing much about it… Security risks like this will turn many people off using Twitter. Fixing this should be their top priority.
Thanks for highlighting this problem, without people like you this sort of thing would probably go unnoticed for ages!
Sarwar Faruque - http://www,sarwarfaruque.com
Excellent find! Twitter really needs to start patching it’s bugs fast. It seems so easy to execute that people with very little experience can actually start exploiting this. Worse off, it makes Twitter spam even more easier than ever before!
Emil Stenström - http://friendlybit.com
Seems that they suspended apifail2 now too. I wonder if they fixed the bug too?
alfon - http://staticsilence.com
i use twitter too but not really know much about this.. nice info bro..
TravisV - http://www.itdatabase.com
What other web app with that degree of popularity is (1) down as often as it is (2) puts wacky restrictions on things like # of searches (3) has gaping security holes? Hard to think of anything as widely used (perhaps IE?) that is as poorly thought out from a technical perspective.
TravisV - http://www.itdatabase.com
Err – obviously I know that IE is a browser (not a web app). But the only real example I can think of where the popularity / quality is as disproportionate.
Elizabeth K. Barone - http://facebook.com/elizabethbarone
Your test account’s been suspended…
Is this issue fixed yet? I can’t find anything saying it’s been fixed, and the Twitter blog/status sites have absolutely nothing about this, which is downright sketchy to me. I mean, at least acknowledge that there’s a problem!
Steve - http://www.laokay.com
I think they should’ve known better.
Blogs are stripping out all sorts of code out of posts to stop malicious things from happening.
Has nobody learned anything by now?
Steen Öhman - http://www.ohmanresearch.com
Great stuff …
An article about James Slaters discoveries was just posted in one of the big danish newspapers.
http://ekstrabladet.dk/kup/elektronik/article1212838.ece
Update: Your Twitter Account is Still in Jeopardy | Msn Yahoo Google - pingback
[…] News, WebProNews, Zdnet News, google news, social media, twitter Update: There is now a video up on Dave Naylor’s blog about the Twitter exploit, which I have embedded below. Meanwhile, Twitter has yet to respond to […]
Update: Your Twitter Account is Still in Jeopardy | Google MSN Search - pingback
[…] is now a video up on Dave Naylor’s blog about the Twitter exploit, which I have embedded below. Meanwhile, Twitter has yet to respond to […]
Dave
Pretty pompous of you to expect twitter to immediately answer your every request/question/comment. It’s great that you found the flaw and let them know about it but at the same time you expect them to let you know everything they are doing AS THEY DO IT. Not a few days later after they have a chance to test everything
Rify - http://www.smile-marketing.co.cc
Thanks 4 article
David Michaels - http://www.insidethetourbus.com
Bad news for everyone who feels the need to tell the world they just brushed their teeth! 🙂
Name - http://hubpages.com/hub/Cupid-Dating-Sites
“Unfollow people you don’t know”
Wow that could take awhile. Everyday I get several new followers that I have no clue as to who they are.
Noah - http://wealthnetpartners.com/blog/
I can’t help but wonder how you even discovered this exploit in the first place…
DaveN
@noah if it ain’t broken stress test it… ps tor ain’t all they are cracked up to be 🙂 exit nodes leakage and all that …
Dave
Becky - http://www.beckynaylor.co.uk
has there been any official word yet if this problem has been fixed .. or do we all just presume its ok agian now?
Twitter Spam and Other Exploits | dropthedigibomb.com - pingback
[…] highly recommend your read David Naylor’s post on Twitter Exploits (Thanks to @Nik_G for sending me this link). It may help prevent you from being […]
karen - http://www.satelliteview-of-my-house.com
Is that problem still exist on tweeter?Sometimes im using my cellphone to blog but sometimes my tweets dont appear on my twitter page.
Rash - http://www.webtopvideos.com
Never thought such a top service like Twitter can be exploited this easy and makes some really primary school mistakes. Good catch!
Hope twitter gets serious about this and do all necessary fixes to give it’s user a secure way to socialize.
Robin - http://www.itopsoft.com
I think i’ve find just another precious deposits
Brent Payne talks on the State of Search radioshow about giving people different pages - State of Search - pingback
[…] New Twitter design Post on David Naylor’s blog […]
Attack of the Tweets: Major Twitter Flaw Exposed « ROAM DATA Smart mCommerce News - pingback
[…] for instance. “Whatever I type in that box will appear at the end of my tweets,” he blogged in a follow-up post. “Anyone who sees that tweet will then be viewing that […]