Slashdot Mirror


Public Exploit For Windows JPEG Bug

Khoo writes "A sample program hit the Internet on Wednesday, showing by example how malicious coders could compromise Windows computers by using a flaw in the handling of a widespread graphics format by Microsoft's software. Security professionals expect the release of the program to herald a new round of attacks by viruses and Trojan horses incorporating the code to circumvent security on Windows computers that have not been updated. The flaw, in the way Microsoft's software processes JPEG graphics, could allow a program to take control of a victim's computer when the user opens a JPEG file." We mentioned this earlier.

20 of 509 comments (clear)

  1. Patch is Already Out by darkmeridian · · Score: 5, Informative

    The patch for this one is already out. Furthermore, SP2 systems do not have this vulnerability unless Office is installed. SP2 by default has auto-updates enabled. And for Office to be exploited in a SP2 system, the user has to open the file manually.

    Code is always buggy. Even Firefox had a JPEG vulnerability of its own. This is dumb ownership, if this bug becomes prevalent.

    --
    A NYC lawyer blogs. http://www.chuangblog.com/
    1. Re:Patch is Already Out by maxwell+demon · · Score: 5, Informative

      Well, you know, that's called a software bug. A software bug is by definition something you didn't intend.

      Actually, it's a buffer overflow. A buffer overflow means that there is some area of memory reserved for some data, and then there's more data written to it than fits in. This causes some other data to be overwritten; if that other data happens to be a return address (basically a number which tells the computer where to continue after finishing the current task), then you can get the computer to execute arbitrary code which is in memory - including the code you just conveniently placed into the memory as "image data".

      I don't know details of the JPEG image format, but with a simple bitmap format, a buffer overflow might happen as follows:

      The image contains the number of pixels, and the bytes per pixel. The program takes those numbers, multiplies them, and reserves that much memory to take the pixel values. Then it reads the rest of the file as image data into that memory.

      Now, this simple program for this simple image format may be easily exploited: Just put more data into the image than the product of number of pixels and bytes per pixel. Then the program as written will not reserve enough memory for that data (because the values at the beginning don't tell the truth), and therefore the data will overwrite anything following the data.

      Ok, the fix is easy: Don't read more data than you allocated memory for. The problem is that on one hand, there are C standard functions which make it easy to get that wrong, and second, there can be more subtle ways to produce the same result. For example, the multiplication could overflow, resulting in too little memory being allocated, while the given number of pixels is read in (under the believe that you have reserved enough memory for that).

      And yes, buffer overflows happen in open source software as well as in Microsoft software.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:Patch is already out by BoldAC · · Score: 5, Informative

      Come on guys! This is slashdot!

      Where is the downloadable link to the second proof of concept code?

      Here's the link to the first POC:
      http://www.gulftech.org/?node=downloads

      The first POC just generates the buffer overflow crash. Interesting enough, on an unpatched system, just having the jpg on your desktop caused by explorer to crash - repeatedly. I am assuming as XP tried to generate the thumbnail. However, if viewed through a web page, I could view it fine.

      I've been looking for the second POC code since yesterday. It supposedly opens a cmd prompt when the crafted jpg is viewed.

      AC

    3. Re:Patch is already out by Trigun · · Score: 5, Informative

      http://www.k-otik.com/
      You can find it all there, including a C program that fires off a local cmd shell.

      Only for use as a security lesson and ethical hacking.

    4. Re:Patch is already out by KidHash · · Score: 4, Informative

      Which isn't really that helpful, however, there's space for 2500 bytes of shell code (ie, lots of space left in the example on k-otik) for writing something with a reverse-shell - in fact, this has already been done, it just isn't public There's also a newer example on k-otik Which adds an administrator account to the system it runs on, however, you'll have to edit some of the code yourself - script-kiddy-proof.

    5. Re:Patch is Already Out by Junks+Jerzey · · Score: 4, Informative

      That's pretty low man. I've coded plenty before and I've never encountered an instance where I can't check to see if a buffer overflow has occurred. I can't help but feel that all of these exploits are just sloppy programming.

      It isn't sloppy programming as much as the rules having changed. It used to be that you'd write an image decoder (or *any* program that reads an external file format), and you'd either (a) assume that the file structure is correct (because if it isn't, then it had to be created by a bad encodder), or (b) do some rudimentary checking to catch basic problems (such as a missing file id tag in the first bytes). And the worst that could usually happen was that your decoder would crash or become unstable. Really, this is how things have been, how coders have worked. Remember, it applies to every single type of external data read into a program: serialized data saved by library classes in C++, Python, etc., bytecode files read by a virtual machine or other interpreter, help file indices, intermediate object files...everything.

      Moreso, just because you don't have buffer overruns doesn't mean you're in the clear. You have to check for tremendous files, too. What if someone passes you an image file that's correct and compressed, but decompresses into a 100,000 by 100,000 32-bit image? Even if you had the memory to decode a large file, the resources it takes up makes it essentiallly a denial of service attack.

      These are tough issues.

  2. Re:Spammers by don_carnage · · Score: 4, Informative

    HTML-formatted email + Outlook = Bad day for Grandma.

  3. Patch is already out by Jeffv323 · · Score: 5, Informative

    Pick your OS and download it here

    Also, if you have SP2 or uh, don't use MS software, you're fine :)

    --
    I'm a minister!
  4. Re:So what? Burn all JPEGs day? by Ford+Prefect · · Score: 4, Informative

    Shall we announce a "Burn all JPEGs" day because of Microsoft security issues now and switch all to PNG?

    Well, you could, but don't forget the recent bugs in libpng... ;-)

    --
    Tedious Bloggy Stuff - hooray?
  5. patch has been available for a while now by jeffs72 · · Score: 5, Informative

    And it actually works fairly well. It scans for any program that reads these files and makes sure they don't have the bug in them. If it can't patch them, it bugs you about it so you can find a fix for the app. Only Microsoft apps of course, I don't think Adobe wants Microsoft pushing out software updates for them.

    Most of the users I have to support aren't savvy enough to add a printer (omg, with active directory it's like 3 mouse clicks) or install software or apply updates (we use some banking software and it notifies you with a text box to click "OK" and then "File, Update" but I still get called on it every time). That's why at our offices we use Microsoft System Update Server (SUS). It lets us approve patches and then roll them out to all the clients in the domain automagically.

    I shudder to think what would happen if I tried to roll out firefox or mozilla to everyone. I'd probably get calls that their "e" was missing and they couldn't connect to the internet. I swear, some people just shouldn't be on computers.

    --
    This article has recently been linked from Slashdot. Please keep an eye on the page history for errors or vandalism.
  6. Re:Single sign-on for a browser? by pcardno · · Score: 4, Informative

    You can do something with Active Directory to enable single sign on so that your browser can use your Windows credentials to figure out who you are.

    An example being that I log into my laptop on the corporate network in the morning, but then never need to log into our Intranet. It uses my Active Directory credentials to figure out who I am, so displays my own customised and personalised Intranet settings.

    I'm not too sure how it works but it's very handy!

    --
    --- Band: Joey Ultra
  7. Re:Can someone confirm... by Sanity · · Score: 4, Informative
    The recent JPEG vulnerability in Firefox is a separate issue. Firefox is OSS, and thus cannot use closed-source libraries such as the MS one in trouble.
    If that were true, then you wouldn't be able to use OSS on a non-OSS operating system, since eventually the OSS needs to link with non-OSS code.
  8. Re:Almost... by YrWrstNtmr · · Score: 4, Informative
    Many companies use outlook as a mail client. Someone could simply include a jpeg image to the mail and since images are loaded by default,

    OL2003 has image loading off by default. "RightClick to display this image."
    Of course, most people are on earlier versions, but at least MS is putting in an effort to stem the tide.

  9. Comment removed by account_deleted · · Score: 4, Informative

    Comment removed based on user account deletion

  10. AutoUpdate not good enuff by DanMc · · Score: 5, Informative
    Autoupdate and Windowsupdate only install a fraction of the patches released for this bug. (Windows OS and IE basically)

    WindowsUpdate does install a "GDI+ Detection Tool", but I have run this tool on systems with unpatched Visual Studio, Outlook, and Office and it does not detect that the patches are missing. I looked at the strings in this tool, and it basically looks like it checks for MS Photo software.

    Manually visiting "officeupdate.microsoft.com" and running those updates will probably cover the most common attack vectors (Outlook, Word), but how many people do this on a regular basis? My users are not admin-level (yet) so they can't use this update site.

    Incidentally, every default configuration of IE/Word I have seen allows DOC files with jpegs to be opened in the browser window with no prompting. It will not be hard to get people to run the exploits, and there's plenty of ways for worms to automate themselves without users opening things.

    I'm working on a script to detect and run the patches (there's about 17 of them for this bug) but it's going to be a while because of the pre-reqs for many of the patches, and the very specific revisions that must match the patch. "If Visio 2002 is installed, detect which Visio SP level is running. If it's SP0 or SP1, run Visio SP2, then reboot, and run GDI patch"...

    Sorry if I'm spreading panic, but this bug sucks.

  11. Re:Almost... by AstroDrabb · · Score: 4, Informative
    We use Netegrity as well. However we went against the single sign-on thing since it was less secure. Our users get stopped by a Netegrity form and enter their username password and then can go to any corporate intranet web app without signing in again until they close their browser or the session expires (about every hour). Firefox/Mozilla already support Windows authentication for single sign-on. It prompts a user for their name and password instead of just silently sending it. The user can even check a "remember password/username" option so they don't have to enter it again. Some management tried to get the admins to turn on windows authentication with Netegrity but the admins and we programmers stood our ground and said how bad an idea it was. Our users can get to all types of personal information and personal financial information on our corporate intranet. It is really dumb to not authenticate a user at least once per session. If a user walked away from their desktop without locking it (happens all the time), anyone could walk up to their box and get to all their personal data if we used just windows authentication. We do have a policy that locks a desktop after 15 minutes, however that is still a 15 minute windows for someone to do get to someone elses personal and financial data.

    Tell your management to turn off the Netegrity/windows authentication and use Netegrity form authentiation over SSL. Also, there is no reason why your users cannot user Firefox/Mozilla since it has had cross-platform support for Windows authentication for a few versions now.

    --
    If Tyranny and Oppression come to this land,
    it will be in the guise of fighting a foreign enemy. -James Madison
  12. Re:Almost... by tcr · · Score: 4, Informative

    Now, to convince my company's managers to switch their userbase to Firefox

    Before we get too smug, the article (anyone read those?) did mention an (albeit unrelated) vulnerability in Moz amongst others (PNG support) from August. Reproduced below.

    To avoid getting the flameproofs on, I should point out that Firefox is my browser of choice. But let's avoid the whole stones and greenhouses scenario, yeh?


    update Six vulnerabilities in an open-source image format could allow intruders to compromise computers running Linux and may allow attacks against Windows PCs as well as Macs running OS X.

    The security issues appear in a library supporting the portable network graphics (PNG) format, used widely by programs such as the Mozilla and Opera browsers and various e-mail clients. The most critical issue, a memory problem known as a buffer overflow, could allow specially created PNG graphics to execute a malicious program when the application loads the image.

    Among the programs that use libPNG and are likely to be affected by the flaws are the Mail application on Apple Computer's Mac OS X, the Opera and Internet Explorer browsers on Windows, and the Mozilla and Netscape browsers on Solaris, according to independent security researcher Chris Evans, who discovered the issues.

    --


    Information wants to be beer.
  13. Re:Almost... by dtfinch · · Score: 4, Informative

    This usually works:
    rundll32 advpack.dll,LaunchINFSection %systemRoot%\INF\msmsgs.inf,BLC.Remove

  14. Re:hmm someone predicted this by stromthurman · · Score: 4, Informative

    And for further information, the virus MacAfee reported on was called Perrun. You can read more about it here. The advisory was issued in mid 2002, and is entirely seperate from the issue at hand.

    --
    I have discovered a truly remarkable sig which this margin is too small to contain.