Twitter ‘onMouseOver’ security flaw widely exploited

Graham Cluley
Graham Cluley
@[email protected]

The Twitter website is being widely exploited by users who have stumbled across a flaw which allows messages to pop-up and third-party websites to open in your browser just by moving your mouse over a link. In a worrying development, messages are also spreading virally exploiting the cross-site-scripting (XSS) vulnerability without the consent of users.

Thousands of Twitter accounts have posted messages exploiting the flaw. Victims include Sarah Brown, wife of the former British Prime Minister.

Sarah Brown's Twitter page

It appears that in Sarah Brown’s case her Twitter page has been messed with in an attempt to redirect visitors to a hardcore porn site based in Japan. That’s obviously bad news for her followers – over one million of them.

Sign up to our free newsletter.
Security news, advice, and tips.

Japanese porn website

To Mrs Brown’s credit, she has posted a warning on her Twitter page:

don't touch the earlier tweet - this twitter feed has something very odd going on ! Sarah

Here’s an example of a Twitter profile which is using the exploit to pop-up a message.

Twitter security flaw popping up a message box

It looks like many users are currently using the flaw for fun and games, but there is obviously the potential for cybercriminals to redirect users to third-party websites containing malicious code, or for spam advertising pop-ups to be displayed.

Here’s a quick YouTube video I made demonstrating the exploit live on Twitter:


Hopefully Twitter will shut down this loophole as soon as possible – disallowing users to post the onMouseOver JavaScript code, and protecting users whose browsing may be at risk.

Some users are also seemingly deliberately exploiting the loophole to create tweets that contain blocks of colour (known as “rainbow tweets”). Because these messages can hide their true content they might prove too hard for some users to resist clicking on them.

Rainbow Tweet exploiting security flaw

Right now you might be safer using a third-party Twitter client rather than the website.

Update Twitter says that it is aware of the problem, and hopes to roll out a patch soon.

Response from Twitter

Update 2 Twitter has posted a blog entry going into some detail of what happened, and how it says it has now fixed the problem.

Which means that – if you like – you should be safe to follow me on Twitter at @gcluley to keep up-to-speed on the latest security threats. :) Take care folks.

Graham Cluley is an award-winning keynote speaker who has given presentations around the world about cybersecurity, hackers, and online privacy. A veteran of the computer security industry since the early 1990s, he wrote the first ever version of Dr Solomon's Anti-Virus Toolkit for Windows, makes regular media appearances, and is the co-host of the popular "Smashing Security" podcast. Follow him on Twitter, Mastodon, Threads, Bluesky, or drop him an email.

What do you think? Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.