A Photo That Can Steal Your Online Credentials?
TedSamsonIW writes "InfoWorld reports on a new potential ploy for stealing Web user's private information: Researcher has found that by placing a new type of hybrid file on Web sites that let users upload their own images, they can circumvent security systems and take over Web surfers' accounts. 'They call this type of file a GIFAR, a contraction of GIF (graphics interchange format) and JAR (Java Archive), the two file-types that are mixed. At Black Hat, researchers will show attendees how to create the GIFAR while omitting a few key details to prevent it from being used immediately in any widespread attack.'"
Just imagine - something as innocent as lolcats could be a potential minefield. God only knows what goatse would do.
I'll pirate your account with my Gif-Yarr!
I warned you all! I've known for years the bad guy from Aladdin would eventually tire of stealing stuff from mysterious caves and start breaking into computers!
"A witty saying proves nothing." - Voltaire
...won't someone think of the PORN!?
The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...
As if tub girl wasn't insidious enough... Now she's going to steal my accounts?
What a roadblock to all those brialliant, anti-social types who won't ever be able to put the last pieces to together as they spend 23 hours a day in front of their "command centers". Sounds like security through obscurity, except they forgot to obscure it.
We might say the same about you. Try to be considerate and civil, it makes you look like less of a tool.
For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
Things like a properly constructed white-list for Noscript, not allowing Java by default, etc. will all protect you from this.
It's a shame that security tools that can help mitigate some of these attacks are difficult to understand and use for many users.
"Upgrade to a hybrid today and get 20% more mileage on your phishing messages"
The mime type says "GIF", but if it looks executable, try to run it anyway. Or maybe it is just Windows. TFA didn't mention which software does this (other than "the browser"). At one point they blame Sun. Huh? Does the GIF have an applet tag? Or does this attack involve running a malicious applet at evil.com, which then loads a JAR from facebook.com (which was uploaded as a GIF) and the JRE runs it as if it came from facebook. *That* would be a Sun problem (and not a "browser" problem).
Well, this proves it again, by making Java so hard to install, Linux avoided yet another threat.
Taxation is legalized theft, no more, no less.
it sounds like what they are doing is creating a specially crafted Java archive (jar) that is disguised as a gif. You upload it to a site, the site stores it on their domain eg: images.somesocialsite.com The attacker would then make a webpage on his site, http://attacker.com/loadgar.html and in it would tell it to include the jar file from images.somesocialsite.com - in this situation the jar would be considered to be "from" the images.somesocialsite.com which would put it in the proper zone to be able to read *.somesocialsite.com cookies.
What site doesn't resize the uploaded image for display? That wouldn't result in "compressed code" it would just be an image.
If i'm reading this correctly, it is a java applet, which if you don't have the runtime installed, or turned off, you'd be ok, but for the millions of users who have no clue about java, they'd be nailed. If you didn't have java will it prompt you to get it, thus assisting the attack? Even a javascript attack would be vicious, as the script would appear to be coming from the site itself, so if I was allowing scripts from facebook, this nasty little bugger could still get through...
I am very curious whether some similar type of exploit could be used on YouTube uploads. Well, I guess we'll know soon.
http://www.infoworld.com/archives/emailPrint.jsp?R=printThis&A=/article/08/08/01/A_photo_that_can_steal_your_online_credentials_1.html
Or Jafar
Jafar's name seems to be derived from a character named Jafar or Giafar in tales of the Arabian Nights, who is the Vizier to the 9th century Abbasid Caliph Harun al-Rashid; this character in turn was based on a real-life vizier, Ja'far bin Yahya Barmaki. Harun and Giafar were the protagonists of many stories in Arabian Nights, but Giafar was never presented as a villain. Harun did have the real Ja'far bin Yahya Barmaki beheaded after a dispute arising from allegations that Ja'far had engaged in an affair with the Caliph's sister. The original tale of Aladdin, a Syrian story not originally attached to the Arabian Nights, features two characters who correspond to Disney's Jafar. One is an unnamed vizier who is jealous of Aladdin but does not serve as a real villain; the other is the major antagonist, an evil magician from the Maghreb in North Africa who introduces Aladdin to his magical lamp.
...
He is shown to be scholarly and learned in arcane lore, his secret chamber filled with strange devices and stacks of tomes, and, as such, he operates more on the level of an alchemist throughout the film's duration than an actual magician. Instead of casting spells, he relies on previously prepared potions capable of producing magical phenomena...
The part I don't get, is that images.somesocialsite.com is presumably sending it as an image/gif mimetype, so why is the browser running it (passing it to the JVM)? This sounds like a browser bug.
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
they are suggesting that BadGuy could upload a 'gif' which is really a jar file to his facebook page.
Then any logged-in facebook user who viewed that 'picture' could have their facebook login cookie stolen.
BadGuy could then use that cookie to look through the private part of your profile, change your password, etc..
This sounds like those tricks where someone writes a code module that compiles in both a C++ compiler and a Pascal compiler, by playing with anomolies in the syntax of the language. Only someone has made a JAR file that looks like a valid GIF file.
I fail to see how this will work though. Even if I could craft such a file, it will have .GIF extension which will make it serve-up as image/gif MIME type so it won't be loaded by the JVM. Now we know that older versions of Internet Explorer will look at the file content not the MIME type - do they still do that? If so, I guess IE might see the file as a JAR not a GIF, but nothing else would. Also - won't that GIF file be in an tag? Surely even IE won't run the JVM for something that isn't in an tag right?
I can put a Java file on my MySpace page anyway, so disguising it as a GIF doesn't really change things. I guess the benefit to the hacker here is that they could do it on sites that normally don't serve Java. And since Java can do basically the same things that Javascript can, it's another XSS attack vector.
Overall, this isn't anything I'm too worried about. Although I'll be very impressed if someone can get a JAR to run from an tag. Also, Kudos to anybody who can make a GIF appear as a JAR. They get points for being inventive.
Jafar?
No... Jew?
First off, what idiot mod'ed you "Troll"?
Secondly, if the user whitelists FaceBook then that would PROBABLY also whitelist the picture/jar that is the exploit which would be downloaded from FaceBook.
Yeah, the security is an issue. At least for right now. It might take a major re-write to kill this exploit. Probably a sandbox where EVERYTHING from a web page would be temporarily stored, then analyzed to see what it was and what the web page reported it as. Probably by digging into the headers of each file and having a setup similar to Apple's for identifying the app that should run a given file.
* resize the image
* crop the image 1x1 pixel smaller
* convert the GIF(ar) to PNG or JPG
* optimize the GIF file
* shrink/reorder the color palette
* edit the comments
Gosh.. really, anything that affects the actual data package, but doesn't visibly hamper valid pictures.
Support FSF: Stop thinking with your wallet, and think with your imagination. (cc/non-commercial)
I've got this photograph in my wallet... and it's gauging my money on a daily basis :/
When you shoot a mime, do you use a silencer?
Indeed.
But you can't normally put your own custom applet up and have it downloaded and run from somewhere under, say, facebook.com. This has implications... the simplest to imagine is that your browser will gladly provide facebook cookies to facebook applets--which is why this particularly affects the type of sites where people stay logged in all day.
There are websites still using Java applets? I thought those died years ago.
TFA says that a user needs to be logged in for this attack to work. This sounds as if the mechanism is the same as or similar to a cross-site request forgery. Shouldn't it be possible to stop the attack with similar countermeasures, such as tokens that need to be submitted along with the request for sensitive information?
.. but just think about how many people happily forward links to all their friends? Who then happily click on the links. Granted, your average Slashdot reader might be too IT literate to fall for this, but Joe Public certainly isn't.
I uninstalled java from my machines years ago.
Does anybody honestly still use it for anthing useful on a webpage?
JAR files are just ZIP archives. ZIP archives are based on the end of the file, where the central directory is located (this is also why you can often unzip a self-extracting exe using a normal unzip application). GIF files, like most other files, are based on the beginning of the file. ZIPs don't care if you shove data in front of them. GIFs don't care if you shove data after them.
$ cat file.gif file.zip > file.gizip .gif or .zip. Both work. You can also substitute JPG instead of the GIF, or any other file type that ignores trailing garbage.
Rename the result to
I'm not sure if there's some kind of trick that is needed for the exploit to work, but the fact that you can make a file that works both as a zip and as almost any other file type has been known for ages.
It is true, java is great big stack of Fail.
With slathering of WTF poured on top.
Why is it so hard to only have politicians for a few years, then have them go away?
NEVER EVER TRUST ANY DATA THE USER SUBMITS!
MMO Quests are like orgasms:
You may solo them, I prefer them in a group.
Anyone who knows much about web browser security will almost certainly have enough to replicate this attack very quickly. The recent DNS flaw was replicated based only on the knowledge that there was a DNS spoofing flaw, some rumours and a few patches.
It would be much better to go with full disclosure, so that at least everyone has access to the same info and can take steps to prevent the attack. It would be impossible to try and inform every affected software developer, including open source projects, and anywhere there is no guarantee that they wouldn't just sell the info on the exploit market anyway.
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
The technique is new, but the concept and prctice of it has been around for years. Does anyone remember the days of javascript embedded gifs? NO? ... Hmmm. I think it's odd that people are just now starting to realize that more things on a site can hold code, besides an applet or widget.
I'm guessing you have it backwards. The referencing webpage marks up the file as a Java object. I imagine the GIF part is to get past the socialsite server's image validity tests so that it will agree to host the file.
Even if Facebook is whitelisted, the applet wouldn't run because it's hosted on a different site.
NoScript checks both the embedding site and the embedded (Java) object against the whitelist to determine if it can be run.
There's a browser safer than Firefox, it is Firefox, with NoScript
When a web server deals with image files, it transmits the contents, it doesn't parse them. This is not an attack against servers, but against other end users.
There ya go! That was much better, and I almost agree with you now ;)
For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
"Jif" would be a better combo, imo. No, I didn't RTFA.
Moderation: +1 pwnage
Sounds familiar...
In the book, Snow Crash, a hacker causes people in their virtual world to "crash" by looking at an animation that works like an executable.
Java is the epitome of bad programming, despite all that you can do with it. It's just a terrible implementation of a great capability. I loathe its insurgence into the mainstream.
Regardless of whether that's true or not... the irony here is that on its launch, Java's use in web browsers- via Applets- was the main thing it was hyped for to the user in the street. And it totally *failed* to achieve mainstream success in that area. Seriously, how often do you see Java applets?
Flash- which used to be a tool for creating lightweight vector-based multimedia- somehow rose to become the tool for embedded apps in web pages. The exact niche that Java was supposed- and failed- to occupy.
I wouldn't even say Flash out-competed or usurped Java Applets. By the time Flash started growing up, Applets had been around for years and had clearly failed to be the success they were supposed to be.
"Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
Just more reason not to use GIFs.
So if they combine two Java archives together, we get the other iconically ridiculed movie? Someone make a "Gifar"/JarJar YouTube mashup!
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
The part I don't get, is that images.somesocialsite.com is presumably sending it as an image/gif mimetype, so why is the browser running it (passing it to the JVM)? This sounds like a browser bug.
I'm guessing you have it backwards. The referencing webpage marks up the file as a Java object. I imagine the GIF part is to get past the socialsite server's image validity tests so that it will agree to host the file.
In my experience, the server should be sending the file with a MINE type of image/gif, so the brwoser should be treating the file as a GIF.
Something I actually tried to do, once:
I uploaded an SVG image to an image hosting website. But, the website, not "knowing" what a SVG file is, sent "Content-type: text/plain". (SVG is XML based, so is actually text.) Several web browsers, including FF and others, dutifully displayed the actual XML text.
I then tried making a webpage included the type attribute, specifiying "xml/xml+svg". The web browsers continued to display the XML text.
Given this observed behavior, I would expect that, when servering up a GIF file, either the server failed to include "Content-type: image/gif", or the browser ignored the contact type from the server. Either of these, IMHO, is a bug.
PS, FYI, I ultimately got the SVG file to be displayed correctly by re-uploading it as an XML file. The server then sent "Content-type: xml/xml" and the web browsers figured out what to do with it.
Don't try to out wierd me, three-eyes. I get stranger things than you, free with my breakfast cereal. --Zaphod Beeblebr
I was wondering how they could actually turn this into an attack vector, but that sounds about right, quite a clever hack too
Presumably any resizing / processing done on the image by the server would destroy the hack tho...
Basically every data format Microsoft uses has some way to embed executable code or scripts. I guess it seemed like a great idea to them in the early 90's, and we live with the pain from that decision every day.
You are in a maze of twisty little passages, all alike.
I've done it with cat and had zero problems unzipping it. I've also done it today with a .gif and a .jar containing an applet and had the applet run. Try it yourself.
Jeez - if you don't understand the joke then just don't mod it. Here - I'll clue you in...
Jeet?
No, jew?
Translation...
Did you eat?
No, did you?
See how that works? Now someone please give the AC the funny mod they should have gotten to start with. This is why I browse +6 on flamebait/troll/offtopic (and -6 on insightful).
the jar would be considered to be "from" the images.somesocialsite.com which would put it in the proper zone to be able to read *.somesocialsite.com cookies.
This is slightly more subtle than it seems. Sure, you can get document.cookie via JSObject, but how do you get cookies for another domain?
Both the server and the browser should check that the content and the extension are consistent. Furthermore, the server should enforce consistency on both upload and download.
Um... how does the java code from the jar end up getting executed anyway? Surely when embedded within an IMG tag the browser will determine that the file is a GIF, and use its own tools. I would find it hard to believe that a browser would ever load the java runtime to display something in an IMG tag. If the browser does do that, that sounds like a major browser flaw.
Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
What would be good is what I proposed _years_ ago:
http://osdir.com/ml/mozilla.security/2002-10/msg00029.html
Then even if someone manages to slip in javascript or other html naughties into an allowed content-type=text/html that's uploaded or emailed to the site, it still won't work on the target's browser.
(if the browser supports the feature, and the website encloses all stuff that _should_ be "plain old harmless stuff" with such tags).
Basically when the browser sees such tags, it will go "Ah, between these tags, I behave as a browser with the fancy stuff disabled". So java, activeX, javascript AND _NEW_STUFF_ that people think up that slips through the upload checks would still be disabled.
That's right, even fancy new stuff that people are thinking of, could be disabled without the website having to keep up with the latest and greatest way to pwn you that the browser or w3c have decided to bless the world with.
It's been 7 years already and everyone seems to be happy to create new "foot guns" for the world but nobody seems interested in making a "foot gun safety".
I have an image BBS system called an Oekaki that accepts image uploads much like the channel boards do. For years, I've had a file type identifier in my code that inspects the file and makes sure it is what it's supposed to be.
Since it's a forum specifically designed for artists, I did this primarily to keep BMP files, Photoshop images, and corrupt PNG files off the board. It's effective at keeping code attacks like this from happening, though.
Turning off Java is a bit of a problem, because Oekaki involves using a Java applet to draw pictures. Perhaps web developers should simply apply the principle of filtering everything that is uploaded. It's not that hard to check image headers and the position of end markers, since (unlike many text formats) today's bitmap image formats still have proper binary headers.
I'm not looking forward to the day when image formats use markup instead of binary headers. There's a lot of opportunity for bad things to hide in there, as any web developer who has had to deal with XSS attacks and intrusive banner ads can tell you.
IE looks at the content instead of the MIME header. Another case where M$ fucks up standards protocols. Firefox does this correctly. This is why you see garbage in your browser instead of pictures/movies on some sites. The server tells Firefox that the content is just text/html, while IE just looks at the file itself and simply ignores the MIME HTTP header.
I've once send a message to Tom's hardware because I could not few their video's in Firefox. They configured their server correctly and everything was dandy. I feel a bit more worried in doing this for all other sites that deliver videos and are frequently have ill-configured servers though. They are not always the places I would like to send emails to.
Wordpress has some themes where when people comment, their web avatar can be used next to their comment. Is this a liability as well? If so, what would be the fix? Thanks,
Reading through the other comments and reading the bug report on Apache, it seems some other piece of software is to blame as well. Just returning text/plain if the content is unknown, WTF are these guys thinking? And why isn't this fixed after ~ 6 years?
The article wasn't clear if this was something specific to the GIF format. Could it be used with PNG, the supposed GIF replacement?
The article implies that the GIF/JAR file has to be from the site you are logged into. Could it come from a third party ad hosted by the site? If not, then servers that upload image files could just convert the images to some standard format (png,jpeg) before serving them out again.
I then tried making a webpage included the type attribute, specifiying "xml/xml+svg". The web browsers continued to display the XML text.
Which is pretty logical, considering the correct MIME type for .svg files is "image/svg+xml". "xml/" isn't (last I checked) a valid prefix at all, and XML-based formats have "+xml" in the end of the latter part, not the beginning!
The MIME types of various XML-based formats are a pretty complex issue; some ill-defined formats (*cough* some OPML hacks) may need to be served as deprecated "text/xml", some as "application/xml", and then there's various text|application|image/*+xml types.
PS, FYI, I ultimately got the SVG file to be displayed correctly by re-uploading it as an XML file. The server then sent "Content-type: xml/xml" and the web browsers figured out what to do with it.
Well, isn't that bad voodoo? One would assume that the correct behaviour when encountering "some random XML stuff" would be to display the file as XML, again, and not make weird assumptions...
That may be true. But not being funny doesn't make it flamebait.
Clever
The server obviously doesn't do a magic check or it would see that it's an applet.
A "magic check" is probably the problem in the first place. GIF files typically start with the string "GIF89a", and have nothing consistent at the end. JAR files (which are ZIP files) aren't required to have anything special at the beginning, but instead have their "signature" near the end of the file (this allows stuff like self-extracting archives to work).
So, your "magic" file could have two different entries:
Depending on the order that these tests are performed, you'll get different results. Where the same file can be interpreted different ways, there is an avenue for attack.
The UTF-7 autodetection bug caused the same kind of problem. If the past couple of years have taught us anything, it's that we need to preserve datatypes along with the data itself, rather than trying to autodetect it later.
http://outcampaign.org/
lord this is prolly just a rar/zip[ file renamed to .gif with the magic cookie in it - u're browser a views an uncompressed (compressed) file (a gif) and runs a browser viewer