[Full-disclosure] Twitter - Security bug in user profiles [HTML, JS, Malware]
contact at reverseskills.com
Sun Nov 28 11:09:04 GMT 2010
-- [ ABOUT ME
Francisco Alonso - ReverseSkills
Security researcher from Spain. *Nix lover & Hardware Hacking ░▒▓
-- [ ABOUT SERVICE
>From Wikipedia :
Twitter is a website, owned and operated by Twitter Inc., which offers
a social networking and microblogging service, enabling its users to
send and read other users' messages called tweets. Tweets are
text-based posts of up to 140 characters displayed on the user's
profile page. Tweets are publicly visible by default, however senders
can restrict message delivery to their friends list. Users may
subscribe to other users' tweets—this is known as following and
subscribers are known as followers.
All users can send and receive tweets via the Twitter website,
compatible external applications (such as for smartphones), or by
Short Message Service (SMS) available in certain countries. While
the service is free, accessing it through SMS may incur phone service
provider fees. The website is based in San Francisco, California.
Twitter also has servers and offices in San Antonio, Texas and Boston,
-- [ DESCRIPTION OF THE VULNERABILITIES
A security bug in user profiles, allows for the avatar upload files
that are not really images, directly from the web form.
When a user wants to change their profile picture, you can upload any
image in three different formats JPG, PNG and GIF. To upload the image
in any of the above three files are generated two different sizes for
parts of the profile. If you try to upload a JPG and PNG image to be
treated by the GD library, Twitter backend removes any extra content
of the image and check the header correctly.
This does not happen with the application that handles GIF files,
enabling a user to upload content that is not really a GIF file by
simply changing the header. Combined with the possibility of defining
the form 'Content-type' of file you can upload content. Sent HTML and
distribute Malware directly from Twitter's servers (Hosted on Akamai
and Amazon S3) .
Poc easier and less worrisome is this:
http://a2.twimg.com/profile_images/1096102091/file.html [HTML XSS]
We could also play around with the image name filter rise.
-[ form code
Content-Disposition: form-data; name="profile_image[uploaded_data]";
This we can do to send the file in the form of the profile, adding a
NOP (x: ö) to the filename. As the filter removed all the string
"filename.html" but it was uploaded successfully.
For security reasons there has been no further evidence of this kind,
but the possibility exists that the user could move a directory and
overwrite after Twitter legitimate files or images from other
profiles. -- Not tested, but I think it is entirely feasible.--
--[ IMPACT OF THE VULNERABILITIES
- A malicious user can change their profile picture to target
customers through either Twitter or access applications from the Web.
- Can be used to distribute Malware in Twitter.
- Technically it is possible to modify files within that legitimate
Improve image upload filter to allow file uploads correctly GIF,
trying in all cases the images as a new and removing content is not
validated in the file header.
-- Done --
27/09/10 - Bug found
08/11/10 - Twitter has been notified
08/11/10 - Twitter answers (7 minutes)
16/11/10 - Twitter patched security flaw, it is not possible to use it.
28/11/10 - Published
-A response time unmatched in Twitter security team, thanks to Bob
Lord / http://twitter.com/boblord
-Thanks to all the team http://www.securitybydefault.com /
Full-Disclosure is hosted and sponsored by Secunia.