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:
The following videos are the proof of the concept of the Unrestricted File Upload Vulnerability in Twitter
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.
(Security Affairs – Twitter, Unrestricted File Upload Vulnerability, social media)