Thursday, 31 October 2013

Twitter Unrestricted File Upload Vulnerability

Security expert Ebrahim Hegazy has found another serious vulnerability in Twitter, he has discovered an Unrestricted File Upload Vulnerability.

The popular Ebrahim Hegazy has found another serious vulnerability in Twitter, the cyber security analyst and Consultant at Q-CERT has discovered a flaw in the social media that allows Unrestricted File Upload.
When a user creates a new application on Twitter from Twitter Developer Center (https://dev.twitter.com/) the procedure allows for the authors to upload an image to associate with the application.
ebrahim Unrestricted File Upload Vulnerability
The image Uploader will check for the uploaded files to accept certain image extensions only, like PNG, JPG while other extensions won’t get uploaded.
The Unrestricted File Upload Vulnerability allowed the expert to bypass this inadequate security check and to successfully upload .htaccess and .php files to twimg.com server. I remind to the readers that twimg.com is working as a CDN (content delivery network) for Twitter which mean that every time user uploads a  file it will be hosted on a different server/subdomain  of twimg.com. The twimg.com was one of the demons attacked by the Syrian Electronic Army during the offensive against Twitter.
In CDN’s usually scripting engines are not allowed to run, the a normal scenarios a successful exploitation of uploading htaccess & PHP files to a server that supports the PHP is:
But in Twitter case the consequences are:
  • It could be used to make twimg.com as a Botnet Command server by hosting a text file with commands, so infected machines would connect to that file to take its commands. Since twimg.com is a trusted domain by users so it won’t grab the attention.
  • Hosting of malicious files.
  • It could be used to upload a text page with a defacement content and then add the infected sub-domains of twimg.com as a mirror to Zone-h.org which would affect the reputation of Twitter.
The following videos are the proof of the concept of the Unrestricted File Upload Vulnerability in Twitter

 http://www.youtube.com/watch?feature=player_embedded&v=4g2uwJ7H7zM

http://www.youtube.com/watch?v=kh4yxZbp6Gw&feature=player_embedded

Twitter recognized the criticality of the Unrestricted File Upload Vulnerability and added Hegazy name to their hall of fame. I personally reached Ebrahim Hegazy that revealed me that he has also found an Open redirection Vulnerability in Twitter on 15th Sept. that has also been fixed, following the POC:
I conclude with a personal consideration, it’s shame Twitter hasn’t a bounty program, in my opinion is fundamental to incentive hackers to ethical disclosure of the bug. An attack against a social media could have serious repercussion on the users and on the reputation of the platform, if hackers sell the knowledge of the flaw on the black market a growing number of cyber criminals could benefit by it.

No comments:

Post a Comment