Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

A Photo That Can Steal Your Online Credentials?

Posted by ScuttleMonkey on Fri Aug 01, 2008 02:20 PM
from the free-fear-mongering dept.
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.'"
+ -
story

Related Stories

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • by Channard (693317) on Friday August 01 2008, @02:23PM (#24438833) Journal
    Just imagine - something as innocent as lolcats could be a potential minefield. God only knows what goatse would do.
    • by Anonymous Coward on Friday August 01 2008, @02:25PM (#24438869)

      4chan is fucked, /b/ is going to spend all day trying to hack eachother.

    • by ya really (1257084) on Friday August 01 2008, @02:30PM (#24438997)

      Just imagine - something as innocent as lolcats could be a potential minefield. God only knows what goatse would do

      There's no actual pictures involed though, just a java applet masquerading as a gif file to the browser (so no kitties harmed). Now, they could give a user a link saying, "Here bez sum picz of lolcatz, come lookz," which would then cause them to "download" what they think is a gif (though it will never show an image). I'm not sure about others, but I tell my browsers to ignore java. Anything written as a java applet is not worth viewing anyways, aside from security risks.

      • Re: (Score:3, Informative)

        by gd2shoe (747932)
        Who says it wont display an image? An applet can render an image and do nothing else. Most users wouldn't know that it was an applet. If the users can anticipate there being an image in that location (often, not always) then it makes sense to keep the subterfuge going.
      • Re: (Score:3, Informative)

        by MozeeToby (1163751)

        I think you've misunderstood what the hack is doing here. It isn't someone posting a picture which, when downloaded, infects your computer. This is you uploading a picture which infects the server the next time it is viewed. Basically, it looks like a gif when you upload it, but when the server goes to display the image next time it sees java code instead and runs it; theoretically allowing you to craft a java applet that can pull information off of their servers.

        I say theoretically because there's still

          • by Nazlfrag (1035012) on Saturday August 02 2008, @03:17AM (#24445887) Journal

            Correct. The code hidden in the image file will be executed by whatever browsers view it, not executed by the server. Even if the server does parse it, it would just be looking for a signature. It has enough similarity to fool the server into thinking its a valid GIF file, but the end users browser will render it as a JAR file (or possibly both).

      • by clone53421 (1310749) on Friday August 01 2008, @04:00PM (#24440719) Journal

        There's no actual pictures involed though, just a java applet masquerading as a gif file to the server (so no kitties harmed).

        You're slightly mistaken. The server thinks it's a GIF; the browser figures out that it's actually an applet and starts Java. Since it's coming from the same server, the applet is able to interact with the rest of the page and see the site's cookies, and it can then transmit whatever stuff it discovers to a third party. As you said, not having the Java plugin would thwart the attack.

        Also, I hate to get on my soapbox, but file extensions are a good thing. In this case, the extension is the only thing that the user has to tell them what sort of content is being delivered... when the file type doesn't match the extension (or MIME type), the browser should complain. This "magic" [wikipedia.org] stuff where the extension is ignored is dangerous.

        • Re: (Score:3, Insightful)

          by mopower70 (250015)

          Also, I hate to get on my soapbox, but file extensions are a good thing. In this case, the extension is the only thing that the user has to tell them what sort of content is being delivered... when the file type doesn't match the extension (or MIME type), the browser should complain. This "magic" [wikipedia.org] stuff where the extension is ignored is dangerous.

          Then please don't because you have no idea what you're talking about. File extensions are arbitrary, irrelevant, meaningless naming conventions based on absolutely nothing, while "magic" is determined by examining the actual contents of the file.

          If you understood what you were talking about and you wanted to label anything "dangerous", you'd be saying that relying on file extensions to convey any serious information about the content of the data is stupid and potentially dangerous. I can name a file any

            • Re: (Score:3, Interesting)

              by Rob Kaper (5960)

              I knew somebody would flame me for my opinion, but look at the facts.

              File extensions are, currently, the sole determining factor that Windows machines use to determine what a file is.

              That's a shortcoming of Windows, it's not a shortcoming of other systems such as the magic database.

              Yes, but extensions aren't interchangeable. Your malicious .exe won't run if you rename it .pdf. It's a safety feature, and it's very useful.

              Then why does malicious Java archive run when you rename it .gif? I thought they weren't interchangable?

              Furthermore, on the internet, the extension is the only way a user can tell what a file is.

              You can't trust something as arbitrary as a filename, extension or content-type given by a remote server. You have to check the file itself. Now I won't expect an end user to do this manually, which is why the magic database is so useful.

              Since TFA states that the server thinks the so-called GIFAR is a .gif, it'll send a content-type: image/GIF header. It's dangerous and stupid for the browser to ignore (1) the .gif extension AND (2) the image/GIF content-type and launch Java.

              It's fine for the browser to ignore them because the server cannot be trusted to supply the correct information. It's dangerous and stupid for the browser to run Java code without warning, especially if it allows it to be done from inside the img tag because it can know the data is not a valid image by simply checking it first.

              I do think it's a flaw of the server to not verify this itself when storing the so-called image, but it's a bigger flaw of the client to trust every server will do this and no single server will abuse it.

                • Re: (Score:3, Informative)

                  As a side note, this exact same problem came up not too long ago when .asf files could be disguised as .mp3's and Windows Media Player would play them. It was a problem because .asf files are insecure.

                  As another example, you can take any image file that Preview will open, rename it with the extension of any other image file that Preview opens, and both Explorer and Preview will still display it... and Explorer will display no indication that it isn't what the extension says it is. It's not as dangerous as t

    • by The Ultimate Fartkno (756456) on Friday August 01 2008, @03:10PM (#24439899)

      God only knows what goatse would do.

      Talk about a gaping security hole...

  • by Paradigm_Complex (968558) on Friday August 01 2008, @02:27PM (#24438919)
    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!
  • please... (Score:5, Funny)

    by pohl (872) on Friday August 01 2008, @02:27PM (#24438929) Homepage

    ...won't someone think of the PORN!?

  • Oh no (Score:4, Funny)

    by fortyonejb (1116789) on Friday August 01 2008, @02:28PM (#24438953)
    As if tub girl wasn't insidious enough... Now she's going to steal my accounts?
  • by Lord Kestrel (91395) on Friday August 01 2008, @02:34PM (#24439113)

    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.

    • Actually, my guess is that this is some sort of automatic file type detection where the browser tries to detect the type of file and use the appropriate plugin (thus causing the JRE Applet Plugin to potentially get selected). If that's the case, NoScript may not recognize it, though disabling Java should fix it.
    • by khasim (1285)

      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 an

  • "Upgrade to a hybrid today and get 20% more mileage on your phishing messages"
  • by CustomDesigned (250089) on Friday August 01 2008, @02:35PM (#24439123) Homepage Journal

    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).

    • by Bogtha (906264) on Friday August 01 2008, @02:59PM (#24439669)

      The article was light on details, but it sounds like an extension of a known attack, and if this is the case, then it's not Windows, but Internet Explorer. Internet Explorer ignores the Content-Type header in various circumstances, in violation of the HTTP 1.1 specification.

      This matters because services like Facebook serve these fake "images" provided by their users to Internet Explorer and explicitly tell Internet Explorer that they are images. Internet Explorer then happily ignores them and tries to guess what type of file it is on its own. If the file looks a bit like HTML and you click on a link to it, Internet Explorer will happily execute Java and JavaScript on that page within the security context of the domain serving it.

      If you've wondered why these types of services force you to save images when you try to view them outside of the context of a web page, now you know why. It's because it's the only reliable way to ensure that Internet Explorer doesn't execute it. Think of it as a straight-jacket to stop a mentally ill person from hurting themselves.

      It's okay though, Microsoft are fixing the issue in Internet Explorer 8. By making Internet Explorer respect the HTTP 1.1 specification? Of course not! By adding a new proprietary header attribute [msdn.com].

        • by Bogtha (906264) on Friday August 01 2008, @06:14PM (#24442443)

          Because of the number of legacy servers on the web (e.g. those that serve all files as text/plain)

          If you missed it, that was a thinly-veiled jab at Apache. Check out Bug #13986 [apache.org]. You know you aren't doing well when an author of the HTTP 1.1 specification shows up on your bug tracker to post a "WTF?" comment :).

  • Linux (Score:5, Funny)

    by Darkness404 (1287218) on Friday August 01 2008, @02:35PM (#24439139)
    Well, this proves it again, by making Java so hard to install, Linux avoided yet another threat.
  • Thumbnails (Score:2, Insightful)

    by omnichad (1198475)
    What site doesn't resize the uploaded image for display? That wouldn't result in "compressed code" it would just be an image.
  • YouTube? (Score:3, Insightful)

    by LM741N (258038) on Friday August 01 2008, @02:39PM (#24439213)

    I am very curious whether some similar type of exploit could be used on YouTube uploads. Well, I guess we'll know soon.

  • 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 fi

  • by ak_hepcat (468765) <leif@NoSPam.denali.net> on Friday August 01 2008, @02:56PM (#24439591) Homepage Journal

    * 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.

    • Re: (Score:3, Insightful)

      by ignoramus (544216)

      You're right, of course. Problem is mainly that it's one of those "if everybody does X, all will be fine" solutions.

      Right now, all sites that provide for image uploads would need to act or all users would have to disable Java. Reminiscent of the recent DNS caching issue, or 3/4 of the proposed solutions for spam... there's a long turnaround, if it works out at all.

      And if we somehow made the applet file format different, more strict to avoid it masquerading as another file type, how would that affect the ji

  • by marcansoft (727665) <.hector. .at. .marcansoft.com.> on Friday August 01 2008, @03:03PM (#24439757) Homepage

    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
    Rename the result to .gif or .zip. Both work. You can also substitute JPG instead of the GIF, or any other file type that ignores trailing garbage.

    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.

    • We might say the same about you. Try to be considerate and civil, it makes you look like less of a tool.

    • by Anonymous Coward on Friday August 01 2008, @02:36PM (#24439151)

      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 [attacker.com] 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.

      • by Sloppy (14984)

        The attacker would then make a webpage on his site, and in it would tell it to include the jar file from images.somesocialsite.com

        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.

          • by UnderCoverPenguin (1001627) on Friday August 01 2008, @04:40PM (#24441345)

            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.

    • by Adriax (746043)

      The point was to slow the kids down by making them figure out the fine details themselves, giving browsers and image sites time to fortify against this attack.

    • Re: (Score:3, Informative)

      Security through obscurity does, in fact, keep things secure for a period of time. Hell, password protection is security through obscurity.

      This is sort of a weak attack, if I understand what they're doing. The web browser sees the file as an image when you upload it. The server, on the other hand, sees it as a JAR file, and when it is accessed the next time, executes it. If it works, this is a pretty decent hack, but to actually get user information, you'd need a bit more info. First, they need the JVM i
      • Wow...RTFA...I was way off. But I don't quite understand what would make Java open these image files... Do they have ".jar" extensions? shouldn't facebook and the like be...I don't know...not allowing those?
      • Re: (Score:3, Insightful)

        by sakdoctor (1087155)

        How is password protection security through obscurity? I can think of no case where this is true.

        • Re: (Score:3, Informative)

          Obscurity: hiding so that the proper user knows the secret will be allowed in.

          password: secret word/phrase. Can be brute forced, cracked, found hiden on a post-it, or just plain guessed at. Absolute worst case puts password at 2^8 per character, minus stated password rules.

    • by pjt33 (739471) on Friday August 01 2008, @02:49PM (#24439465)
      In terms of creating something which is both a gif and a jar, it's a simple case of cat myimg.gif myapplet.jar. The fact that you can cat a gif and a zip file and get something which conforms to both specifications has been known for years. The interesting bit will be the way they turn the Facebook img tag into an applet tag or otherwise persuade the browser to execute the applet.
      • Re: (Score:2, Interesting)

        by Vectronic (1221470)

        Or Jafar [wikipedia.org]

        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...

    • 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..

    • OK, so this attack can allow bad guys to put java applets in web pages which appear to be GIF images. So what? You can already put a java applet directly in a web page.

      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

    • Re: (Score:3, Informative)

      by Tony Hoyle (11698)

      Except the attack fails if the image is modified in any way, fails if the server does minimal validation, *and* it only works in IE because that ignores mime types from the server.

      I doubt there's an attack surface worth the effort. You can bet facebook does checks.