Slashdot Mirror


CERT Warns Of Multiple Vulnerabilities In Libpng

jefftp writes "CERT announced today that there are several vulnerabilities in libpng, one is a buffer overflow which could potentially cause a PNG image file to execute arbitrary code. Libpng release 1.2.6rc1 addresses the problems covered by this CERT announcement, and can be obtained from the libpng Sourceforge project. A fully tested version is to be released in the next few weeks."

259 comments

  1. Didn't this happen with BMP? by Anonymous Coward · · Score: 0

    Well, at least there's no internal JMP-like instruction in PNG...

    On the plus side, PNG adoption (and this vulnerability) isn't as wide-spread as it could be if certain software were more popular.

    1. Re:Didn't this happen with BMP? by noselasd · · Score: 5, Informative

      Well, _lib_png have many, many jmp like instructions, they're called
      function calls, and if you manage to overwrite the return address on the stack, you can make it jump anywhere, like the code you injected.
      Hopefully it's just the stack you can overflow, most of us should run with a no executable stack theses days, no harm done(well, it probably crashes.. )

    2. Re:Didn't this happen with BMP? by bl8n8r · · Score: 1

      > PNG adoption (and this vulnerability) isn't as
      > wide-spread as it could be if certain software
      > were more popular.

      Hold that crack pipe a moment - the fact that
      IE renders PNG files will make possible the ability
      to exploit this just as easily as if it were on Linux. You are fishing.

      --
      boycott slashdot February 10th - 17th check out: altSlashdot.org
    3. Re:Didn't this happen with BMP? by Anonymous Coward · · Score: 0

      Hold that crack pipe a moment - the fact that IE renders PNG files will make possible the ability to exploit this just as easily as if it were on Linux.

      Only if IE uses libpng. And I don't see any evidence that it does.

    4. Re:Didn't this happen with BMP? by FireFury03 · · Score: 2, Interesting

      most of us should run with a no executable stack theses days

      Ah, you mean the vast majority of people are now running Athlon64's? (tip: Plain IA32 CPUs don't support the NX bit).

    5. Re:Didn't this happen with BMP? by moonbender · · Score: 1

      Hm. It isn't acknowledged in the IE About window - but the libpng license doesn't require them to do that, anyway. But I guess the half-baked PNG support in IE is a sure sign that it doesn't use libpng...

      --
      Switch back to Slashdot's D1 system.
    6. Re:Didn't this happen with BMP? by gl4ss · · Score: 1

      tip: you don't need it in hardware..

      --
      world was created 5 seconds before this post as it is.
    7. Re:Didn't this happen with BMP? by FireFury03 · · Score: 1

      errm... how?

      How exactly do you stop the cpu executing the stack if there is no way to mark it as non-executable?

    8. Re:Didn't this happen with BMP? by Anonymous Coward · · Score: 1, Informative
      How exactly do you stop the cpu executing the stack if there is no way to mark it as non-executable?
      Put it in a different segment. Like the OpenWall patch does for Linux. On IA32 machines (386 and up), you can mark an entire segment non-excutable; you just can't mark individual pages.
    9. Re:Didn't this happen with BMP? by Anonymous Coward · · Score: 0

      Read the Intel developers manual on e.g. segmentation and paging.
      There are programmer available bits in a pte...

    10. Re:Didn't this happen with BMP? by noselasd · · Score: 3, Informative

      This explains how it's done:
      http://people.redhat.com/mingo/exec-shield/ ANNOUNC E-exec-shield

    11. Re:Didn't this happen with BMP? by Anonymous Coward · · Score: 0

      you don't need it in hardware...

      Yes, you do. What you mean to say is that x86 supports NX on a per-segment basis rather than per-page.

      You can use this per-segment NX to create a non-executable stack, but as with all things segmented, it's a major pain in the butt to set up. Surprisingly enough, Windows does not support it.

      No-execute stack isn't a silver bullet anyway, you just have to simulate a call to the function that clears the NX bit instead of a direct jump into the buffer. It gives ASCII-armor teeth, but it's ultimately useless alone.

  2. Firefox by dolmen.fr · · Score: 2, Interesting

    Is Mozilla/Firefox/Thunderbird using this lib ?

    1. Re:Firefox by black+mariah · · Score: 5, Informative

      Yes. Most everything on Linux that reads or writes PNG's uses it.

      --
      'Standards' in computing only impress those who are impressed by things like 'standards'.
    2. Re:Firefox by beardz · · Score: 4, Informative

      New builds of Mozilla / Firefox / Thunderbird have been released to patch four potential security vulnerabilities including the libpng issue

    3. Re:Firefox by CTho9305 · · Score: 1

      This was one of the security fixes (arguably the only exploitable hole) that was included in yesterday's releases, 1.7.2, 0.9.3, and 0.7.3.

    4. Re:Firefox by Anonymous Coward · · Score: 0

      Dang. There goes my plan to deal with people who link directly to images hosted on my web server.

    5. Re:Firefox by timeOday · · Score: 1

      Next question: are you running Mozilla/Firefox/Thunderbird as root?

    6. Re:Firefox by Minna+Kirai · · Score: 1

      are you running Mozilla/Firefox/Thunderbird as root?

      And another question: Is all of the valuable data on your computer owned by root, or do you occasionally do important work as a user?

      Ever type your credit-card into Mozilla/Firefox/Thunderbird?

    7. Re:Firefox by Anonymous Coward · · Score: 0

      Oh my GOD!?! Thank goodness I am using a much more secure browser like Internet Explorer.

    8. Re:Firefox by respite · · Score: 1
      Yes, but the recent updates seem to have fixed this issue. I've visisted all the crasher png's and Firefox just says:
      The image http://scary.beasts.org/misc/pngtest_bad.png cannot be displayed, because it contains errors.
    9. Re:Firefox by joeljkp · · Score: 1

      No, he's right. Mozilla-based apps use libpr0n to render images. Don't know if that somehow links to libpng as well, though.

      --
      WeRelate.org - wiki-based genealogy
    10. Re:Firefox by Anonymous Coward · · Score: 0

      libpron is just the wrapper Gecko uses to provide a consistent API - underneath, it uses libpng, libjpeg, etc.

    11. Re:Firefox by Mika24 · · Score: 1

      Ok since you didn't answer the question about FireFox/Mozilla on windows systems does it affect thsose users also???

      --
      http://www.npcgaming.com Dedicated Gaming Servers
    12. Re:Firefox by black+mariah · · Score: 1

      It should be resoundingly fucking obvious that if I don't answer a question, then I have no fucking clue what the answer is. Google is your friend.

      --
      'Standards' in computing only impress those who are impressed by things like 'standards'.
  3. Mozilla by KidSock · · Score: 2, Interesting

    So does mozilla statically or dynamically link with libpng?

    1. Re:Mozilla by slashdevslashtty · · Score: 4, Informative

      According to this, libpng is part of the source tree. My guess is static.

      --


      M$ Lawyer: But `gcc /dev/random -o kernel.dll` is our trade secret!
    2. Re:Mozilla by jrockway · · Score: 1

      Interesting. I wonder if this type of exploit could be prevented if the library was written in, say, java instead? Any experts that know for sure?

      --
      My other car is first.
    3. Re:Mozilla by Theril · · Score: 5, Funny

      Sure it could. Implement image loading and rendering in Java and nobody has patience to load images anymore.

    4. Re:Mozilla by evil_one666 · · Score: 2, Informative

      I wrote a GIF library in JAVA to display animated gifs on java 1.0 and it was reeeeeeeaaaaaally sloooooooow. It would however not be possible to exploit a buffer overflow on such a decompressor...

    5. Re:Mozilla by forgoil · · Score: 4, Informative

      Buffer owerflow attacks won't happen in languages which doesn't "support" that feature, such as perl, python, ruby, java, C# (any managed code), or managed C++ for that matter.

      Another way of killing the problem is using the NX (I hope I got that correct) instruction/bit in newer CPUs and simply separate code and data, and not allow execution in a data segment. Win SP2 does this, I am sure Linux does/will soon, one of the BSDs have done stuff like this for a while, etc.

      So yes, you would prevent it. But then again, calling a javalib from C... :)

    6. Re:Mozilla by FireFury03 · · Score: 2, Informative

      Another way of killing the problem is using the NX (I hope I got that correct) instruction/bit in newer CPUs and simply separate code and data, and not allow execution in a data segment. Win SP2 does this, I am sure Linux does/will soon

      Yep, Fedora Core 2 has done this since one of the early kernel revisions (I think it was when they went from 2.6.5 to 2.6.6)

    7. Re:Mozilla by Anonymous Coward · · Score: 2, Informative

      " Buffer owerflow attacks won't happen ... using the NX"

      No, you can still overflow the buffer, thus being able to modify the return pointer, and some variables. What does this mean? If you were lucky/elite, you could get it to jump to a different function. Sure it's not executing your own instructions from the stack, but it's still control.

      thanks,
      jacob

    8. Re:Mozilla by GoCoGi · · Score: 1

      Buffer owerflow attacks won't happen in languages which doesn't "support" that feature, such as perl, python, ruby, java, C# (any managed code), or managed C++ for that matter. In theory this is true, but to actually run such a program you need a compiler/interpreter for that language, which could contain bugs, so buffer overflows could be possible. Of course the Java programmer by definition can't introduce a buffer overflow exploit into his Java code, so it will always be the Java interpreter/compiler's fault.

    9. Re:Mozilla by thedillybar · · Score: 1
      What the hell are you talking about?

      >I wonder if this type of exploit could be prevented if the library was written in, say, java instead?

      Sure it could be prevented. It can also be prevented when written in C. See release 1.2.6rc1.

      If you're starting the arguement that Java is inherently more secure, and therefore everything should be written in Java, it's not worth the flamewar.

    10. Re:Mozilla by Tom7 · · Score: 1

      Yes, it could of course be prevented, like most other security holes.
      Java has a bad reputation for being slow, but there are plenty of natively-compiled languages that are quite fast and would at worst result in a denial-of-service (exception) if they had this bug, never execution of arbitrary code.

      It is still a wonder to me that people who claim to be concerned about security choose C for their projects.

    11. Re:Mozilla by Minna+Kirai · · Score: 1

      Buffer owerflow attacks won't happen in languages which doesn't "support" that feature,

      Pedantically, buffer overflows can still happen in any of those languages. But the easily-exploitable subset called stack overruns cannot. And without stack overruns, the difficulty of convincing a buffer overflow to actually do something harmful is great indeed- but it is a theoretical possibility.

    12. Re:Mozilla by tungwaiyip · · Score: 1

      That's a false sense of comfort. These scripting languages often provide features via a wrapper to an underlying C library, libpng is an plausible example, either because the library is more available in C or because of performance reason. The possiblity of buffer overflow would be greatly reduced it the application is written purely in those language. But still the interpreter themselves are often written in C and still pose a potential problem.

    13. Re:Mozilla by AsparagusChallenge · · Score: 1

      It depends.

      Compiling Mozilla with "ac_add_options --with-system-png" at the .mozconfig file would make it dynamically linked if you wanted to.

    14. Re:Mozilla by jesser · · Score: 1

      Static, I think. Upgrade to Mozilla 1.7.2 or Firefox 0.9.3 (both released yesterday) to pick up the libpng fixes.

      --
      The shareholder is always right.
  4. Diagram by skraps · · Score: 2, Funny

    Here is a .PNG file with a diagram that explains the problem.

    --
    Karma: -2147483648 (Mostly affected by integer overflow)
    1. Re:Diagram by skraps · · Score: 0, Redundant

      Uhhhh. Lighten up mods, it's a *JOKE*. The linked file is a *PNG*. Get it?

      --
      Karma: -2147483648 (Mostly affected by integer overflow)
    2. Re:Diagram by Anonymous Coward · · Score: 0

      No. Whats so cool/funny about that ?
      So someone renamed the file, but the server gives
      the appropriate mimetype and/or the browser figures it out itself. Big deal.

    3. Re:Diagram by Anonymous Coward · · Score: 1, Insightful

      Jesus. It must be retard night on slashdot.
      The file is actually a GIF. Check the header. "GIF89a".
      The post claims it is a PNG that explains the "problem".
      If you just read an article about a PNG exploit, and then are stupid enough to click a link that purports to go to a PNG file, you are a dumbass, as the picture informs you.
      Since it is actually a GIF, there is no actual harm in viewing the file.
      Is that really so hard to piece together?
      Perhaps you don't think it's funny. Slashdot's moderation system doesn't have an "Unfunny" option - and for a good reason: dipshits like yourself who would misuse it.

    4. Re:Diagram by Anonymous Coward · · Score: 0

      Actually, meta-mod does have an unfunny option.

      All moderations are meta-modded fair or unfair, except funny, which is meta-modded funny or unfunny.

      No, that does not make sense.

    5. Re:Diagram by Anonymous Coward · · Score: 0

      "Is it ever not retard night on slashdot?"

      Yes, sometimes it's retard day.

    6. Re:Diagram by john_sheu · · Score: 0

      Erm...aren't PNG's supposed to *replace* GIFs?

    7. Re:Diagram by Anonymous Coward · · Score: 0

      Perhaps you don't think it's funny. Slashdot's moderation system doesn't have an "Unfunny" option - and for a good reason: dipshits like yourself who would misuse it.

      Actually it would probably prevent some misuse. Now dipshits mod something they think is unfunny as overrated, or troll, or flamebait, which causes karma loss, "unfunny" like "funny" on the other hand wouldn't affect karma.

  5. Old news by Anonymous Coward · · Score: 2, Interesting

    ...thanks to the Debian Security mailing list, my systems were secured against this hours before it even made it to /.

    1. Re:Old news by Anonymous Coward · · Score: 0, Flamebait

      ...thanks to the Debian Security mailing list, my systems were secured against this hours before it even made it to /.

      Hours? Hours makes it old news? Jesus.

      There's a submission review procedure before stuff gets posted on slashdot. That takes time.

    2. Re:Old news by LiquidCoooled · · Score: 5, Funny

      "Submissions review procedure" ?

      Taco: "Wooah! this Doom 3 is excellent!!!!"

      Michael: "Anyone else gettin 503s?"

      Simoniker: "Is anybody doing ANY work?"

      Tim: "Simon - yer, just gettin submissions - omg, another 400"

      Taco: "Die scum die!!"

      Michael: "I give up, anyone wanna 7up?"

      Taco [Looking up from game for a minute] "Yer go on then!"

      Taco: "Tim, Throw another story onto the site, the natives are gettin restless."

      Tim: "eeny, meeny miny mo...."

      --
      liqbase :: faster than paper
    3. Re:Old news by pilkul · · Score: 1
      Yes I make mistakes. Don't we all?

      I dont.

    4. Re:Old news by LiquidCoooled · · Score: 1

      dont tell porkies!

      --
      liqbase :: faster than paper
  6. Ah-ha! by iamdrscience · · Score: 5, Funny

    You all complained about Internet Explorer not being able to display PNGs correctly, but who's laughing now! Obviously they broke PNG support intentionally for security reasons. Once again, Microsoft comes through on the cutting edge.

    1. Re:Ah-ha! by Nerull · · Score: 5, Informative

      I know its a joke, but it seems to work in IE as well, or at least an example PNG crashes it, i suppose one could be crafted for IE to exploit it.

    2. Re:Ah-ha! by billatq · · Score: 2, Interesting

      Someone who saw the leaked source code a while back happened to mention to me that Internet Explorer uses libpng for rendering PNG files--it's just broken because it uses such a friggin' old version of it. So there's a good chance that IE is affected too.

    3. Re:Ah-ha! by MyHair · · Score: 1

      Someone who saw the leaked source code a while back happened to mention to me that Internet Explorer uses libpng for rendering PNG files--it's just broken because it uses such a friggin' old version of it. So there's a good chance that IE is affected too.

      Cool! Maybe the update will fix PNG transparency on IE!?

  7. well by Anonymous Coward · · Score: 3, Funny

    it's a good thing all of the porn sites i visit use jpegs

    1. Re:well by Anonymous Coward · · Score: 0

      Ha, you would think !? They're just renamed (about 179 times on average I would imagine).
      Most of them are actually .exe trojans hidden inside what you think are .jpg files.

    2. Re:well by Anonymous Coward · · Score: 0

      Who fucking cares, exe trojans don't to shit to my Linux

    3. Re:well by 9-bits.tk · · Score: 1
      *smacks Anonymous Coward*

      Porn sites??!! What would your mother say???

  8. I think by slashdevslashtty · · Score: 1

    I think this was one of the vulnerabilities in Mozilla (Suite, Firefox, Thunderbird) that they already fixed and featured on /.

    --


    M$ Lawyer: But `gcc /dev/random -o kernel.dll` is our trade secret!
    1. Re:I think by slashdevslashtty · · Score: 1

      Ok, I found the bug report: here.

      --


      M$ Lawyer: But `gcc /dev/random -o kernel.dll` is our trade secret!
  9. Updates by Sunspire · · Score: 3, Informative

    Fedora Core 1 and 2 already have backported security updates for this as 1.2.5-7 and 1.2.5-8 respectively since yesterday. Much better than having to install a release candidate.

    --
    It's like deja vu all over again.
    1. Re:Updates by City+Jim+3000 · · Score: 1

      Forgive a Fedora rookie, but how can I get updates for my RedHat 9 system? I'm guessing the Fedora project has some kind of "backporting" to RedHat 9, no?

      I'm running some kind of yum-thing to update, but I've forgot what settings I have in it.

    2. Re:Updates by Sunspire · · Score: 1

      There's the Fedora Legacy project that backports security fixes for RH9 and in the future also for old Fedora Core releases. There's already some testing packages for RH9 available in Bugzilla, once they're approved they'll be up on the RH9 advisories page. You should use yum to download and install the new packages, it's all explained on the website.

      --
      It's like deja vu all over again.
    3. Re:Updates by spottedkangaroo · · Score: 1
      Woah, watch out.

      I applied the all_patches from 1.2.5 and the resulting libpng 1.2.5 is still vulnerable!

      The remote execution bug was posted to bugtraq yesterday and I don't think there's a patch for 1.2.5!

      This broken image is from the bugtraq post. If it crashes your browser, you're not fixed.

      --
      Imagine if you weren't allowed to use roads because a bus company complained about your driving 3 times. --skunkpussy
    4. Re:Updates by whovian · · Score: 1

      I followed your broken image links with firefox-0.9.3 on Fedora Core 2 with libpng-1.2.5-5. The browser doesn't crash, just gives an error message. I was expecting a crash. Odd.

      --
      To-do List: Receive telemarketing call during a tornado warning. Check.
    5. Re:Updates by spottedkangaroo · · Score: 1
      Perhaps that update actually contains the demo-patch from bugtraq then.

      my mistake.

      --
      Imagine if you weren't allowed to use roads because a bus company complained about your driving 3 times. --skunkpussy
    6. Re:Updates by nstrom · · Score: 1

      Correct - FB1.9.3 has a fix for bug 251381.

    7. Re:Updates by nstrom · · Score: 1

      I mean FF1.9.3 of course. Lack of coffee this morning :P

    8. Re:Updates by jrockway · · Score: 1

      Wow, that crashes safari. Any updates from Apple or anything like that yet?

      --
      My other car is first.
    9. Re:Updates by Anonymous Coward · · Score: 0

      I think you need more coffee. Since we're on the subject of making useless corrections, I believe it would be FF 0.9.3 =)

  10. Bug? it's a feature! by barcodez · · Score: 4, Funny

    a buffer overflow which could potentially cause a PNG image file to execute arbitrary code

    This is not a bug it's a feature; the libpng team are obviously trying to get a piece of the ActiveX control market...

    --

    ----
    1. Re:Bug? it's a feature! by Keeper · · Score: 1

      Unfortunately, this technique violates Eolas's patents regarding running code in a browser downloaded from an external source with a seamless user experience...

  11. YBHT HAND! by Anonymous Coward · · Score: 0

    And you are, in fact, blazingly naive...

  12. Re:php ! by Anonymous Coward · · Score: 0

    Well actually I am blind you insensitive clod!

  13. Re:php ! by Anonymous Coward · · Score: 5, Funny

    Seriously, we need a "Dumbass" mod option

  14. Around the world.... by Neo-Rio-101 · · Score: 1

    Suddenly MRTG gets a mind of its own and starts spewing out more than just TCP connection data reports!

    --
    READY.
    PRINT ""+-0
    1. Re:Around the world.... by Anonymous Coward · · Score: 0

      In 2004, MRTG became self aware...

  15. Gentoo by AliasTheRoot · · Score: 2, Interesting

    I just emerge synced and the latest version available is still libpng-1.2.5-r7

    1. Re:Gentoo by Sunspire · · Score: 4, Informative

      Yeah it's still not fixed, but when an updated package is available it will still most likely simply be versioned 1.2.5-r8. You can keep a watch on the package and see immediately when it's fixed here.

      --
      It's like deja vu all over again.
    2. Re:Gentoo by Anonymous Coward · · Score: 0, Flamebait

      Could it be that Mandrake and Fedora have their patched code out faster than the elite gentoo team that is supposed to be poised on the bleeding edge of our scene? My "newbie" distro has been patched and secure for many hours and you gentoo zealots are still scratching your asses...

      Heck you don't even need to wait for them to make a binary! It should've been done by now surely...

    3. Re:Gentoo by AliasTheRoot · · Score: 0

      good post, I didn't know about that - if i had moderation turned on i'd give you a +1 informative.

    4. Re:Gentoo by AliasTheRoot · · Score: 1

      I know this is flamebait, but i'm rising to it:

      wtf is this newbie vs zealot crap?

      i chose gentoo because i like portage, and i find the way things are laid out to be more similar to the solaris and bsd boxes i'm paid to admin. there's nothing wrong with fedora or mandrake (which you dont use), but if Linux is about anything, it's about choice, and my choice is to use a distro that i feel comfortable with.

    5. Re:Gentoo by Anonymous Coward · · Score: 0

      wtf is this newbie vs zealot crap?
      i chose gentoo because i like portage, ... it's about choice, and my choice is to use a distro that i feel comfortable with.


      Absolutely. It's just that a few rabid Gentoo advocates got Gentoo a bad rep.

    6. Re:Gentoo by AliasTheRoot · · Score: 3, Insightful

      just ignore advocates, they'll go away eventually :)

      gentoo is good for me, i don't think it's good for everyone - but i'm not everyone, i'm me.

      my wife and my mother both use win2k and thats whats good for them, i help them out with patches and suchlike but neither of them really want to care about having gcc or whatever installed.

      like i said, it's all about choice.

    7. Re:Gentoo by Anonymous Coward · · Score: 0

      Whaddaya know, I clicked the link, and it appears it's been patched since you posted it.

    8. Re:Gentoo by keesh · · Score: 1

      Wait for the rsync mirrors to catch up with cvs. -r8 has been in CVS for a while...

      RCS file: /var/cvsroot/gentoo-x86/media-libs/libpng/libpng-1 .2.5-r8.ebuild,v

      revision 1.3
      date: 2004/08/05 10:22:53; author: ciaranm; state: Exp; lines: +2 -2
      Stable on sparc, bug #59424

      revision 1.2
      date: 2004/08/05 10:20:27; author: lu_zero; state: Exp; lines: +2 -2
      marked ppc

      revision 1.1
      date: 2004/08/05 10:02:19; author: plasmaroo; state: Exp;
      Security bump for bug #59424.

    9. Re:Gentoo by Anonymous Coward · · Score: 0

      viewcvs doesn't work in realtime. It can lag behind the main cvs tree by up to an hour.

    10. Re:Gentoo by Anonymous Coward · · Score: 0

      Gentoy is for ricers. You're being tarred with the same brush as all the fucking wannabe pricks who don't know a CFLAG from a whole in the heads. Get out quick, before the stupid infects you, too.

    11. Re:Gentoo by Anonymous Coward · · Score: 0

      A whole what in what heads?

    12. Re:Gentoo by hundalz · · Score: 1
      From the gentoo-announce mailing list:
      Resolution
      ==========

      All libpng users should upgrade to the latest stable version:

      # emerge sync

      # emerge -pv ">=media-libs/libpng-1.2.5-r8"
      # emerge ">=media-libs/libpng-1.2.5-r8"

      You should also run revdep-rebuild to rebuild any packages that depend
      on older versions of libpng :

      # revdep-rebuild
      Hope this helps! :)
    13. Re:Gentoo by AliasTheRoot · · Score: 1

      You know, if I had to pick the thing I thought was the most useless overhyped waste of time about Gentoo, it would be compiling all that crap to make it run.

      Thankfully it's a one shot deal and when you've done it once it is pretty much over with.

      I have really conservative use flags, probably the only slightly wierd one is SSE for my P4, which probably makes mplayer eat 1% less cpu.

      The absolute biggest strength about gentoo for me is portage, i'm from a freebsd background and just plain like how portage works. I also like the stripped out nature of the distribution, if you've spent most of your time adminning solaris or bsd boxes and then come to linux, you'll probably be just plain horrified at the crap that gets put into /bin or /etc on a linux machine.

      Anyway, I could care less about tweaking 0.1% extra out of my pc, but portage makes it easier to keep it up to date and gentoo isn't completley braindead about its filesystem layout.

    14. Re:Gentoo by uid8472 · · Score: 1

      I seem to recall reading, a few days ago, a Gentoo security advisory about libpng, wherein was recommended upgrading to at least 1.2.5-r7, which had a fix. Was that the same bug as this?

    15. Re:Gentoo by uid8472 · · Score: 1

      Answering myself: judging by the more recent advisory, it's not, or there were more bugs than -r7 fixed, or something.

  16. It's a decoder problem by Snaapy · · Score: 5, Informative

    "And how many PHP sites/scripts dynamically generates .png files ? Quite a lot I'd think, so, webservers might be vunerable, but it seems
    like a longshot to try to inject something to such scripts."

    Did you read the article? You don't seem to understand the point here.

    The bug affects only loading of PNG images. One can make a specially crafted PNG image which has some invalid fields causing problems in the decoder. The invalid handling of these special error cases may cause an application crash or potential execution of arbitary code in the application which uses libpng.

    It is not possible to introduce malicious RAW image data to the encoder. And even if it was possible, you should be able to pump data directly in the encoder, which is not a usual case with dynamically generated images. So, your PHP site is safe.

    However, libpng is the most commonly used PNG implementation due to it's free licence. These bugs affect to very many applications (graphics applications, Office applications, user interface managers, browsers, etc.) which happen to use PNG.

    A similiar case like this was zlib bugs some time ago.

    1. Re:It's a decoder problem by Anonymous Coward · · Score: 0

      Ok, I know of quite a lot sites allowing you to upload pictures to
      e.g. a gallery. Pictures are then often scaled.
      (Which means both encoding and decoding.)

    2. Re:It's a decoder problem by mindriot · · Score: 1

      But wouldn't it still be possible to write a php script that, using libpng, loads a png file, and upload a malicious png for it to load? Yeah, encoding a png is probably safe. But, I mean, do something like this:

      $im = imagecreatefrompng("test.png");
      imagepng($im);

      ...and a malicious test.png will have to get loaded first.

      Well, of course you won't be able to execute arbitrary code as root (just as www-data or something, and you can already do that in your php script :)). But I'm not so sure how much a malicious png could actually take down in a crash.

    3. Re:It's a decoder problem by Anonymous Coward · · Score: 0

      Now, who's laughing? I knew my Captain Crunch secret decoder ring would come in handy some day. Muwhhahahahahahah!

      Laugh at me, will you? Just wait till I get out of this padded room....

    4. Re:It's a decoder problem by 0x0d0a · · Score: 1

      However, libpng is the most commonly used PNG implementation due to it's free licence. These bugs affect to very many applications (graphics applications, Office applications, user interface managers, browsers, etc.) which happen to use PNG.

      Note that this is an issue that has not recieved enough attention. These days, data files are transfered around a lot. Sure, people are terribly careful about network code, anything reading data from the network, but how careful are they in checking data that they're reading from "local" files? How secure is MS Office at reading MS Office files, or OpenOffice at reading OpenOffice files? What about libvorbis? How about id3 tag readers? The problem is exacerbated when authors of network applications treat code that reads "trusted", "local" files (i.e. libraries to parse files) as safe, and automatically hands off data to such libraries.

  17. Buffer overflow *again*? by Anonymous Coward · · Score: 2, Interesting

    We've all heard about buffer overflow problems in countless programs and libraries again and again. I'm not a programmer, but as I under stand it, the problem is writing to unallocated memory areas. But this is not a new problem, it has happened for ages. Is it really that difficult to avoid? I understand that libpng as a "building block" library needs good performance, but is it really that much of a problem to write things in safer programming languages that don't allow these kind of problems? Can some seasoned programming gurus here enlighten me here?

    1. Re:Buffer overflow *again*? by Anonymous Coward · · Score: 1, Informative

      The safer languages would be e.g. python or java. You want an interpreter to decode your images ?
      Anyway shit happens.

      An error ?:

      int main()
      {
      char str[] = "Hello";
      char *tst = malloc(strlen(str));
      strncpy(tst,str,strlen(str));
      }

      An error ?:

      void doFoo(int i* , int length) // i - array of ints, length - lenght of array
      {
      int j;
      for(j = 0 ; j length; j++){
      dosomething(i[j]);
      }
      }

      Depending on context both can be fatal.

    2. Re:Buffer overflow *again*? by Anonymous Coward · · Score: 0

      Maybe one of these days the D programmning language will replace C and C++ (it is binary compatible with C and existing libraries need not be lost). It manages memory like most modern languages but is not interpreted so it will not have the atrocious performance of scripts or .net or java (whatever they say about improved performace... they ARE slow. Whatever the benchmark says, you can painfully tell when you are running a program in java and the like)

    3. Re:Buffer overflow *again*? by Anonymous Coward · · Score: 0

      I'm a programmer and no, buffer overflow are NOT difficult to avoid ! For incompetent programmer, the simplest solution is simply to stop using stupid languages like "C".

    4. Re:Buffer overflow *again*? by IamTheRealMike · · Score: 1
      Technologies like execshield can help with this. I'd be interested to know if execshield prevented this problem being exploited.

      Yes you could reimplement libpng in a safe language that allowed for C export like D or maybe (with some hackery) Java. Nobody has though.

    5. Re:Buffer overflow *again*? by Anonymous Coward · · Score: 1, Funny

      They're trivial to avoid (read: impossible) in nearly every popular language except C, C++, or assembler. The future of computers is definatey having a simple, trusted kernel and running everything else with either proof-carrying code or in a virtual machine (or some combination of both!). I don't know what these people are doing with PNG's that they're absolutely convinced no language besides C can do it fast enough (I call BS). At least they could use OCaml and get better performance than C without buffer overflows.

    6. Re:Buffer overflow *again*? by Anonymous Coward · · Score: 0

      Input data verification has plenty of problems with managed memory too - you can easily crash a program by supplying it with bad data, so managed memory languages still need data verification.

      What you can do with non-managed memory languages to remove all buffer overflow is the use the right tools (no, not a managed heap :) ) but something like splint or
      Prefast

    7. Re:Buffer overflow *again*? by Minna+Kirai · · Score: 1

      Simply put, if you are working in a language where you have control of the memory you use;

      That's not an answer, but an evasion. The question then becomes "Is it really that difficult to avoid languages where you have control of the memory?"- and as we all know, the answer to that is NO.

      There are no real obstacles to safer languages, it's just the historical inertia of the "good enough" C-compatible environment that keeps us there.

  18. Re:php ! by xenoandroid · · Score: 1

    You don't know how many times I've thought that when moderating.

  19. Re:php ! by dolmen.fr · · Score: 3, Insightful

    The article is about PNG, not PHP.

    Of course, but this means that free PHP hosting services are at risk, as some malicious users will try to exploit this flaw on the server side.

  20. PNG security threat by Anonymous Coward · · Score: 2, Funny

    Is there oil at Papua - New Guinea?

    1. Re:PNG security threat by MavEtJu · · Score: 1

      Is there oil at Papua - New Guinea?

      With the risk of being non-funny: yes.

      And the Australian government is making sure that they're getting their 'fair' share of it!

      --
      bash$ :(){ :|:&};:
  21. @Mozilla/FireFox-users: No Panic! by Anonymous Coward · · Score: 1, Informative

    The yesterday release of M1.7.2 and FF0.9.3 are fixed. Source: http://www.heise.de/security/news/meldung/49786
    (German site) :)

    1. Re:@Mozilla/FireFox-users: No Panic! by Anonymous Coward · · Score: 0

      Hmmm... I see someone was faster. Sorry :(

    2. Re:@Mozilla/FireFox-users: No Panic! by Anonymous Coward · · Score: 0

      (German site)

      Aah, I'm reliefed.

  22. WinXP by Anonymous Coward · · Score: 1, Interesting

    Sorry I am kinda new to png stuff... can anyone explain how this might effect my Windows XP box? Should I go get the patch for my system? btw I am running Windows XP professional with service pack 1. Thanks in advance.

    1. Re:WinXP by Anonymous Coward · · Score: 0

      yes - if you download a png file on winxp it will delete your entire c:\ drive.

    2. Re:WinXP by Anonymous Coward · · Score: 2, Informative

      Sorry I am kinda new to png stuff... can anyone explain how this might effect my Windows XP box? Should I go get the patch for my system? btw I am running Windows XP professional with service pack 1. Thanks in advance.

      ! - in case this is for real.

      PNG is an image format. It's very popular. There's a free (not copyleft free) library that anyone can put in their software to handle the PNG format.

      There's a problem with this free library. If you're using software with a broken version of this library, you'll need to update the software.

      The XPSP2RC has either fixed or sidestepped the issue. If you want that, you can get it from Windows Update (v5). But it's still a release candidate so you might prefer to wait.

  23. Combine this... by cperciva · · Score: 4, Informative

    ... with this, and Linux gets to join the "visit a malicious website and get rooted" crowd.

    1. Re:Combine this... by caluml · · Score: 1
      All I get is this:
      [+] mmaped uncached file at 0x40014000 - 0x40015000
      [+] mmaped kernel data file at 0x4014c000
      [-] Race lost 0, use another file!
      Terminated
      No matter which file I try.
      Running 2.6.7-gentoo-r10
    2. Re:Combine this... by achurch · · Score: 2, Informative

      As far as I can tell, that only lets you read memory, which doesn't let you root anything. In fact, I tried the test and though it claimed to have worked, all I got was /proc/mtrr followed 64MB of zeros, which seems odd since my machine's been up long enough that all my physical memory should have been stomped on at some point.

      So yes, these are both serious problems, but they still don't boost Linux up into that vaunted "rootable group". (:

    3. Re:Combine this... by thinkninja · · Score: 1

      Well, it all depends on what the attacker gets from the kernel memory dump. Could be that they get sensitive information or it could be they get nothing that would help in privilege escalation. I'd rather close that door altogether, myself by using 2.6.8-rc or 2.4.27.

      But, please, unless GP has written a proof of concept that shows Linux is rootable via rendering a webpage, he should stop posting flamebait and go back to working on his 'depenguinator'.

      --
      "The number of Unix installations has grown to ten, with more expected." (Unix Programmer's Manual, 2nd ed.; june 1972)
    4. Re:Combine this... by BillyBlaze · · Score: 1

      Unix guarentees that new pages are zero-filled, and this can happen in the background. (You can't make that assumption in programming because the stack could have grown bigger than it is now, and function obviously don't zero the stack they used.)

    5. Re:Combine this... by Anonymous Coward · · Score: 0

      Maybe, and if you're foolish enough be logged in as root.

  24. The latest SP2 fixes it. by WhoDaresWins · · Score: 5, Informative
    I know its a joke, but it seems to work in IE as well, or at least an example PNG crashes it, i suppose one could be crafted for IE to exploit it.
    Well using XP SP2 RC2 build 2162 it does nothing in IE other show a broken image link. Whatever Microsoft did in SP2, it seems to have mitigated it. They did recompile major parts of the OS for SP2 with the /GS VC++ stack checking compiler flag. That could have caught it. Or it could be that they were informed about it before full disclosure and they fixed it in SP2. Or that they don't use libpng and their library does it correctly or they fixed the issue by themselves. Whatever be it they seem to have taken care of it. BTW the built-in Windows Picture and Fax Viewer also doesn't crash (nor does mspaint). You can test this out yourself if you have SP2 (don't know if builds earlier than 2162 fix it though) using this image link (Warning! Will crash non patched browsers!) from the original disclosure.

    Its reassuring that for once MS has already taken care of some security issue (for XP SP2 at least).
    1. Re:The latest SP2 fixes it. by Chester+K · · Score: 1

      don't know if builds earlier than 2162 fix it though

      No crash in a fully patched IE from XP SP1.

      --

      NO CARRIER
    2. Re:The latest SP2 fixes it. by forgoil · · Score: 1

      Could be NX as well:)

    3. Re:The latest SP2 fixes it. by Nerull · · Score: 3, Informative

      Try This image

      I got it from the bugzilla entry about the libpng issues.

      Actully, that image and the one above produce 2 diffrent effects in IE now that ive tested both, maybe its a diffrent issue that got mixed in the same bugzilla entry.

    4. Re:The latest SP2 fixes it. by gosand · · Score: 1
      (Warning! Will crash non patched browsers!)

      Thanks for the link. This is one reason that I have an external application set up to handle images. Irfanview reports this as an invalid PNG. Of course, if it were embedded in a web page...

      --

      My beliefs do not require that you agree with them.

    5. Re:The latest SP2 fixes it. by Pxtl · · Score: 1

      Brought down my IE too, and I'm all updated on this XP box.

    6. Re:The latest SP2 fixes it. by Mononoke · · Score: 1
      Brought down Safari version 1.2.2 (v125.8) also.

      --
      NetInfo connection failed for server 127.0.0.1/local
    7. Re:The latest SP2 fixes it. by rasz · · Score: 1

      Opera 7.54 - nothing happened

    8. Re:The latest SP2 fixes it. by Anonymous Coward · · Score: 0

      "The image "http://www.graphicsmagick.org/libpng/beta/samples /bigw.png" cannot be displayed, because it contains errors."

      Netscape 7.1

    9. Re:The latest SP2 fixes it. by AliasTheRoot · · Score: 1

      404 file not found on the latest IE for win2k, will check it with firebird when i get home.

    10. Re:The latest SP2 fixes it. by Troed · · Score: 1

      Opera are _fast_ - it crashes 7.53 so that's what the update is for.

    11. Re:The latest SP2 fixes it. by NaDrew · · Score: 1
      (Warning! Will crash non patched browsers!)
      Opera 7.53/3850 on XP Pro SP1 crashed when it tried to load that file. I note that Opera 7.54 is now available, but the changelog doesn't mention PNG fixes.
      --
      Vista:XPSP2::ME:98SE
    12. Re:The latest SP2 fixes it. by NaDrew · · Score: 1

      7.54 crashes as well.

      --
      Vista:XPSP2::ME:98SE
  25. Arbitrary Code...? by Anonymous Coward · · Score: 2, Funny

    What is arbitrary code? How is it any different as compared to any other computer code, say a piece of software?

    1. Re:Arbitrary Code...? by Anonymous Coward · · Score: 1, Informative

      It isn't. It just means code that is not part of the program itself, but
      rather code that is injected into the program/software, and the software
      is then tricked to running that code.

    2. Re:Arbitrary Code...? by GregChant · · Score: 1

      Not entirely true. Arbitrary code is any code or script that has been written to perform an arbitrary task; malicious or otherwise. Arbitrary code is equivalent to saying "random sourcecode x".

    3. Re:Arbitrary Code...? by Anne+Thwacks · · Score: 1

      Bill Gates has a patent on arbitrary code. (Or maybe that was SCO).

      --
      Sent from my ASR33 using ASCII
  26. Where did you get the example PNG ? by Gopal.V · · Score: 1

    There's this custom PNG decoder ... and I'm just curious

    1. Re:Where did you get the example PNG ? by WhoDaresWins · · Score: 1

      I got the link from the original full disclosure over here. See near the end of section 1. That link is given in the CERT alert.

    2. Re:Where did you get the example PNG ? by Nerull · · Score: 1

      http://www.graphicsmagick.org/libpng/beta/samples/ bigw.png Got it from bugzilla.

  27. esr, not rms. by Anonymous Coward · · Score: 0

    nT

  28. Why do you guys even try?? by ModernGeek · · Score: 0, Offtopic

    I dont' get trolling, it isn't funny, and thanks to moderation, it isn't even annoying. So, why do people still try, I don't see a fucking point. It's stupid, it's old, and I'm feeding one.

    --
    Sig: I stole this sig.
    1. Re:Why do you guys even try?? by Anonymous Coward · · Score: 0

      Why? Google for "trolls", top hit.

  29. Debian by Fuzzums · · Score: 3, Interesting

    Within an hour (or so) after the CERT-mail I also got the Matt Zimmerman-mail.

    Fixed :)
    I love this!

    Thanks Guys!

    --
    Privacy is terrorism.
    1. Re:Debian by Anonymous Coward · · Score: 0

      Fixed :)
      I love this!


      Except it has been sitting there in the code for a long, long time for all to see and exploit. So much for thousands of eyes examining the code :)

  30. ror by Anonymous Coward · · Score: 0

    no yuo!

  31. Fucking incompetent idiots. by Anonymous Coward · · Score: 0

    Did it ever occur to the authors of the library that input data could be from hostile source?

  32. SuSE patch also already available by Anonymous Coward · · Score: 2, Informative

    I just patched my SuSE box. Man that was fast ... or perhaps .. it is because Germany is 6 hours ahead of me.

  33. Attribution? by Quixote · · Score: 2, Interesting
    Would it be too much to ask whose code was it that had the vulnerability?

    I think it is time we started attributing vulnerabilities to the authors (just as we do with companies).

    1. Re:Attribution? by FireFury03 · · Score: 2, Insightful

      If you do that (which is probably a good idea) you'll need to weight it based on the amount of code written by that author that _could_ contain a security hole. Otherwise the stats will just show that the authors who write 99% of the complex network-facing code are responsible for most security holes.

    2. Re:Attribution? by pclminion · · Score: 2, Insightful
      I think it is time we started attributing vulnerabilities to the authors (just as we do with companies).

      Terrible idea. I can tell you right now, if I knew I'd be held personally responsible for bugs in open source software I contributed to, I would not contribute. If you want me to take responsibility for my bugs, give me money.

      If you don't like buggy free software, don't use it. What you're describing sounds almost like an inverse meritocracy, where people get branded if they don't write code that's "good enough." All that serves to do is scare people away from contributing.

      What's really irritating to me, is that often times the people bitching the loudest are unwilling and unable to contribute to such projects themselves. Sorry, but I'm not going to subject myself to a bunch of amateur sideline criticism. It ain't worth it.

    3. Re:Attribution? by ricmoo · · Score: 1

      I think it's a great idea! I don't know how many of us would actually stop coding OSI if we were going to have our name stapled to serious vulnerabilities.

      I'd sooo put bugs like this on my resume...

    4. Re:Attribution? by mewphobia · · Score: 1
      Would it be too much to ask whose code was it that had the vulnerability?

      Yes.

      I think it is time we started attributing vulnerabilities to the authors (just as we do with companies).

      Yes, we do it to companies. Note that this is different from doing it to individuals inside companies. So you're basically wanting to punish open source authors for giving up their free time as opposed to being paid for what they do?

      I'm sure that if a bug is found in a piece of code (say libpng) the author certainly knows who they are, and going to be more careful. Why is that not enough?

      The open source movement should be about rewarding the efforts of others. It should be about pushing people up. What you're suggesting is akin to a lynching.

      Furthermore, open source already has an inherit method of dealing with bugs! As soon as they are found, someone releases a patch! Who would of thought!

    5. Re:Attribution? by pilkul · · Score: 1

      Horrible idea IMHO. What good would that do? You think there would be less bugs? Most developers are already doing their best to avoid all security problems, but they're only human and some slip through the cracks. Your proposal would only discourage developers from working on a project for fear of being branded a bugster, and would do nothing at all for security.

    6. Re:Attribution? by Anonymous Coward · · Score: 0
      The open source movement should be about rewarding the efforts of others.

      Yes, reward for the effort, and acknowledge your mistakes. It goes both ways.

      As soon as they are found, someone releases a patch!

      Except the bug should not have been there in the first place!

  34. Spoken like a true AC... by Anonymous Coward · · Score: 0

    Java is not interpreted. Your Java example might cause an ArrayIndexOutOfBoundsException (or whatever the hell they're called), but it sure as hell isn't going to allow someone to insert random data into the heap/stack and have it executed with the privileges of the user running java.

    1. Re:Spoken like a true AC... by Anonymous Coward · · Score: 0

      Java is not interpreted. Your Java example

      I'm not the same AC, but ...

      I don't see any Java example. I see two C examples. First one uses C string functions, second one uses pointers.

    2. Re:Spoken like a true AC... by Anonymous Coward · · Score: 0

      there was no java example, you java-minded anonymous coward!

      or does java support pointers now ???? have malloc and strncpy finally made it to java??? i doubt it.

      not everything that looks like C or C++ is java.

    3. Re:Spoken like a true AC... by Anonymous Coward · · Score: 0

      Java is not interpreted.

      It may not be technically interpreted. But it is not compiled down to actual machine code. It is compiled to Java byte code which is interpreted. Java is very slow compared to c/c++. So it is not practical for many applications.

    4. Re:Spoken like a true AC... by shish · · Score: 1
      It is compiled to Java byte code which is interpreted

      No, it's compiled to bytecode for distribution, and then compiled to binary on the fly whenever you run it. Java could be the same speed as C++, it's just that Sun haven't done as much optimisation as the GCC guys have.

      --
      I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    5. Re:Spoken like a true AC... by Anonymous Coward · · Score: 0

      No, it's compiled to bytecode for distribution, and then compiled to binary on the fly whenever you run it.

      It could be compiled when you run it. Most implementations of the Java VM still interpret it.

    6. Re:Spoken like a true AC... by Minna+Kirai · · Score: 1

      Java could be the same speed as C++

      So long as "compiling to binary on the fly" takes ZERO time.

      But actually, GCC can compile Java to binary ahead of time, just like it does with any C++ code. But having experimented with this, it doesn't go any faster than Java in a VM on the same machine... which could either indicate the VM is compiling very well, or (more likely) that GCC isn't very optimized for Java inputs.

  35. opensource and security risks ! by chrisranjana.com · · Score: 0

    Even though open source has security risks it is much less than closed source systems like ....

    --
    Chris ,
    Php Programmers.
  36. How old is it REALLY? by goldspider · · Score: 0, Flamebait

    How long has this vulnerability been in libpng? It's easy to claim that Linux has zero-hour responses to bugs when you announce vulnerabilities after they're patched, but what I'd like to know is how long this has been a problem.

    --
    "Ask not what your country can do for you." --John F. Kennedy
    1. Re:How old is it REALLY? by jrockway · · Score: 1

      > How long has this vulnerability been in libpng?

      Forever. Are you happy with that answer? That proves, once and for all, that Linux fucking sucks. I mean how could the DUMBFUCK developers let a bug like that through!?!?!

      Seriously, though. People make mistakes. The libpng people made a mistake. They fixed it, and nobody got hurt. So I don't see the problem.

      If it's news to you that OSS isn't bugfree, then you need to wake up. The difference between OSS and M$ (et. al.) is that the OSS people fix bugs/'ploits faster. See how you can get a fixed version RIGHT NOW? Where's the fixes for MSIE?

      --
      My other car is first.
    2. Re:How old is it REALLY? by NineNine · · Score: 1

      See how you can get a fixed version RIGHT NOW?

      Programmers and advanced sysadmins can get a fixed version right now. Every normal person has to wait "a few weeks".

    3. Re:How old is it REALLY? by Waffle+Iron · · Score: 2, Informative
      Programmers and advanced sysadmins can get a fixed version right now. Every normal person has to wait "a few weeks".

      Umm... the point-and-drool update utility in my SuSE box automatically installed the patch last night. No programming or advanced sysadmining was required on my part.

    4. Re:How old is it REALLY? by NineNine · · Score: 1

      Most people don't use SUSE. Most people use Windows. I use Firefox on W2K. How do I get this new patch, huh?

    5. Re:How old is it REALLY? by Waffle+Iron · · Score: 1

      Well, I guess that could be a problem. I personally don't use Firefox, mainly because it's still in beta and doesn't yet integrate with my system's package management. (Plus, it doesn't offer huge feature improvements over Konqueror or Mozilla.) The non-beta browsers that did come with my system, however, are already fixed.

    6. Re:How old is it REALLY? by Daltorak · · Score: 1

      Here's the fix for MSIE, dated August 1st:

      http://www.microsoft.com/technet/security/bullet in /MS04-025.mspx

      You asked...

    7. Re:How old is it REALLY? by AstroDrabb · · Score: 1

      How about just download the new version? Or did you mean how are you supposed to know about it if you are not a geek and read it on /.? Well, go under Tools -> Options -> Advanced, you should see a section called Software Update. Firefox will check periodically for newer version, or you can click the big button labeled Check Now if you want to do it manually. So non-techie Firefox users will get a notice that there is a newer version. Wow, isn't technology great!

      --
      If Tyranny and Oppression come to this land,
      it will be in the guise of fighting a foreign enemy. -James Madison
  37. Fucking Microsoft security holes! by NineNine · · Score: 0, Flamebait

    I am SO sick of these Microsoft security holes. Plus, a fix in "a few weeks"? What are they thinking? Jesus, if this were open source, we'd have a fix *today*, and we probably wouldn't have had this happen in the first place!! What am I supposed to do about my machine during the next "few weeks"? Make sure that avoid all sites with PNG files, even though I don't know if they have any until I surf to them? Piece of shit company...

    Oh wait...

    Ooops. Just re-read the article. Yaaay Open Source! I'm so glad that they've been open about this bug, and are fixing it so quickly! Good job guys!

  38. Proof of Concept image by JUSTONEMORELATTE · · Score: 1

    Man, whatever happened to popping up a Solitaire game to prove that you could execute arbitrary code? Now we've got an example image which crashes the browser (Netscape 7.1) and locks the profile, so the only way I can get back to bitch about it is to cold boot the damn (win2k) machine.

    damn kids these days.

    --

  39. Perfect for spyware... by Call+Me+Black+Cloud · · Score: 1, Funny


    ...because, as you know, in Soviet Russia pr0n watches you!

    Sorry, it's early for me. I'm not warmed up yet. They'll get better...

  40. Another exploit in libpng by ShadowRage · · Score: 4, Interesting

    image bombs. basically, you create a 190000x190000 pixel monochrome image, save it, and it compresses to 43 kb

    anyone opens it... *BAM* it expands into 2gb of ram.

    1. Re:Another exploit in libpng by Anonymous Coward · · Score: 0

      That's hardly an exploit is it? What exactly do you expect it to do with a 190000 x 190000 image?

      If you zip up 2GB of zeroes, e-mail the resulting tiny file to someone and they open it, it is ,amazingly enough, going to consume 2GB of memory. Do you think that's an exploit too?

      Now if opening the image causes your house to burn down, your wife to leave you and your pet dog to get gang-raped then you might have a point.

    2. Re:Another exploit in libpng by thogard · · Score: 4, Interesting

      This is a problem? I've got about 300 people try to anon-proxy through one my servers every day. When they ask for a gif (or png or whatever) would be a nice to give them something to make them go away.

    3. Re:Another exploit in libpng by Minna+Kirai · · Score: 1

      BAM* it expands into 2gb of ram.

      *BAM* it reveals that the client-software shouldn't have been naively decompressing the whole file, but only the part it was going to display. (Loading more data from the file when the user begins scrolling)

      But seriously folks, this is an example of why DoS attacks can't really be automatically prevented. There's no strict boundary between a legitimate use of heavy resources and intentional squandering of resources.

      What if someone wants to store 190000 pixels of black? On the other hand, if I'm browsing the web on my PDA, then a 1280x1024 image will just about bomb me out.

    4. Re:Another exploit in libpng by sploo22 · · Score: 1

      Good idea! I'll start up the Gimp and make one of those myself. Be back in just a second. ... ... ...

      *CONNECTION TIMEOUT*

      --
      Karma: Segmentation fault (tried to dereference a null post)
    5. Re:Another exploit in libpng by jefp · · Score: 1

      I've been using the equivalent in GIF for years, but I had to write a custom program to create the file. No image editor could do it.

      I guess I could adapt the program for PNG.

    6. Re:Another exploit in libpng by lubricated · · Score: 1

      care to link to such an image?

      the way you say it should be easy to create.

      --
      It has been statistically shown that helmets increase the risk of head injury.
    7. Re:Another exploit in libpng by Krunch · · Score: 1
      Here you go.
      $ perl -e 'use GD; $size = 190000; $img = new GD::Image($size, $size); $img->colorAllocate(0,0,255); print $img->png'
      Bypassing libGD to create the PNG "manually" would probably be faster but I don't have enough knowledge about PNG to do that.
      --
      No GNU has been Hurd during the making of this comment.
    8. Re:Another exploit in libpng by ShadowRage · · Score: 1

      http://www.acidchat.net/images/fuck_you_celeste.pn g

      was meant for a certain bitch.

    9. Re:Another exploit in libpng by lubricated · · Score: 1

      cool, that worked

      --
      It has been statistically shown that helmets increase the risk of head injury.
    10. Re:Another exploit in libpng by lubricated · · Score: 1

      actually IE opens it just fine, mozilla based browsers under linux crash

      --
      It has been statistically shown that helmets increase the risk of head injury.
  41. BOEM. by leuk_he · · Score: 2, Informative

    Microsoft internet explorer has encountered a problem ands needs to close. we are sorry for the inconvience.

    bla bba
    [x] restart mirosoft internet explorer ...

    [b]WOW[/b], it is a portable bug!

    can anybody tell us if this is exploitable?

  42. 5 informative... my ass! (in jpeg!) by Anonymous Coward · · Score: 0

    Moderators moderate this parent away. links to bugzilla from /. do not WORK for years!!!

    he could have linked to the NEW RELEASE!

    1. Re:5 informative... my ass! (in jpeg!) by beardz · · Score: 1

      Right, and you're not capable of copy and pasting the link into a new browser window? More to the point, since when is a demonstration of the png fault been considered a new version of anything? (ie, your "NEW RELEASE link?) Whatever :)

  43. With security holes like this... by Anonymous Coward · · Score: 0

    ...maybe these guys should upgrade to a decent OS like Windows :-)

  44. Standardized Libraries by Teancum · · Score: 1

    The LibPNG library is merely a standardized library for reading and writing PNG files. It has been ported to many platforms and is even LGPL'd.

    This makes it a two-edged sword in some ways, because nothing is specifically keeping you from writing your own implementation of the PNG specification, but most people are generally lazy and grab whatever is at hand, particularly if it is well written.

    The trick is to keep the formal specification seperated from the implementation so the implementation doesn't become the specification. Particularly with multimedia data formats, I've seen this happen far too often. PNG is particularly well designed in this regard, so you don't have to specifically condemn the format, just a particular library for problems like the CERT warning. Some formats are much worse in this regard.

    That issues like this are coming up is more of a sign that the library is being widely used. One way to prevent issues like this from really taking over is to provide alternative implementations, so a "virus writer" couldn't depend on a specific implementation for an exploit like this.

    1. Re:Standardized Libraries by thebatlab · · Score: 1

      Are you off your rocker? "Dum de dum...I need to display some PNGs in my program. Rather than use the widely known and used libpng I think I'll write my own entire library". Umm ever here of not re-inventing the wheel? NIHS? Re-use?

      "but most people are generally lazy and grab whatever is at hand"

      It has nothing to do with laziness and if you can't see that then I never want you to write any software for me.

      "One way to prevent issues like this from really taking over is to provide alternative implementations, so a "virus writer" couldn't depend on a specific implementation for an exploit like this."

      At some point this argument stops holding water. And that point was yesterday! There is nothing wrong with having one major implementation of a widely used multimedia format. I know, I know. "But look at the vulnerabilities". Yup, and they're all fixed now so everybody can update their apps easily and away they go. Otherwise who's to say that out of the myriad of implementations you're hoping for, 1/4 won't have exploits in them?

    2. Re:Standardized Libraries by Anonymous Coward · · Score: 0

      Are you off your rocker? "Dum de dum...I need to display some PNGs in my program. Rather than use the widely known and used libpng I think I'll write my own entire library". Umm ever here of not re-inventing the wheel? NIHS? Re-use?

      Many readers will overlook an erroneous trivialization of the work required to produce quality software, so many posts use such a trivialization to seem insightful when they're really spouting a bunch of garbage. Heck, occasionally these crackpots will say that someone should fork Mozilla to fix one lousy bug!

  45. Bugs in Compilers... by Tom7 · · Score: 2, Interesting

    On the other hand, it's quite difficult for a bug to creep into a compiler's bounds checking code (which is typically very simple). I know of no such historic examples, though perhaps this is because relatively few apps actually use safe compiled languages. (It would presumably have to be matched by a bug in the application code...) Interpreters and JIT compilers are much more subject to this kind of problem, particularly if they are written in C themselves. ;) There have been a few JVM exploits historically, though it is still much easier to make a secure JVM than to make tens of thousands of secure applications.

    Finally, remember that even C has the burden of bugs in its compiler, runtime, and libraries, so this argument is useless at differentiating between C and safe compiled languages (unless you can argue that the latter have more complicated support code).

  46. Canary by bsd4me · · Score: 3, Informative

    You can protect against this to. The technique is put a ``canary'' on the stack frame and make sure it is still there before you return.

    There are at least two patches to gcc that do this. One is called ProPolice. The name of the second is escaping me right now. OpenBSD includes ProPolice by default.

    Google on stack-smashing protectors for more info.

    --

    (S(SKK)(SKK))(S(SKK)(SKK))

    1. Re:Canary by RLW · · Score: 1

      Or just write good code that includes bounds checking .

      Jeepers.

      Never use strcpy, always use strncpy. Make sure the code can determine the size of the destination and never copy more than it can hold. Employ smart buffers that won't let you over run what they can hold. This type of exploit has been to widely known of to simply ignore it. besides it's good programming practice that should have been followed to begin with.

    2. Re:Canary by Minna+Kirai · · Score: 1

      Or just write good code that includes bounds checking .

      Or just never crash your car. That way, you don't need a seatbelt or airbags.

      In fact, if these stupid humans would stop being making mistakes, all kinds of problems would just go away. The nerve of some people; making the world a more dangerous place, just because they happen to be fallible!

    3. Re:Canary by Fenris+Ulf · · Score: 1
      Never use strcpy, always use strncpy.

      It's a tragedy that this won't be modded funny.

      And on the off chance that you're serious, don't use strncpy, since it doesn't terminate your strings if it hits the byte limit.

      Personally, I'm a fan of snprintf(), and I think the last few decades of Unix would have been a lot safer had it existed in K&R stdio.

    4. Re:Canary by runderwo · · Score: 1
      Yes, because clearly it is a difficult and convoluted procedure to set the last byte in the string to 0 after using strncpy().

    5. Re:Canary by Annoying · · Score: 1

      To make a mockery of your point, it is equally difficult and convoluted to do proper bounds checking isn't it?
      Yet it doesn't happen, as setting the last byte in a string to 0 might often not happen. I'm not a programmer really so I don't know what occurs if the last byte of a string isn't null, it might be less dangerous than buffer overflows but it doesn't sound like strncpy() is any more fool-programmer-proof.

    6. Re:Canary by inflex · · Score: 1

      Actually, you might be meaning "strlcpy". strncpy is just as bad almost as strcpy.

      The key issue is (quoted from the man page)

      "The strncpy() function is similar, except that not more than n bytes of src are copied. Thus, if there is no null byte among the first n bytes of src, the result will not be null-terminated."

      Which basically means that you still stand the risk of having strings which aren't terminated correctly (not quite a buffer overflow at the strncpy point, but will create interesting problems later).

      Either use strlcpy or snprintf.

      PLD.

    7. Re:Canary by Krunch · · Score: 1
      The name of the second is escaping me right now.
      I think it's StackGuard.
      --
      No GNU has been Hurd during the making of this comment.
    8. Re:Canary by Anonymous Coward · · Score: 0

      I know a CS professor that goes by runderwo... you aren't he, are you?

  47. Official Language-based security thread! by Tom7 · · Score: 2, Insightful

    (This troll would be more effective if not posted anonymously.)

    Indeed this flamewar has been repeated many times. Safe languages do indeed provide protection from these kinds of attacks and typically at a fairly small speed penalty (depending on the language; the number-two language on that list is safe and places above C++!).

    See the earlier slashdot discussion for loads of argument. ( here for my perspective--note, I am a tower-in-the-sky PhD student in programming languages, but I do write lots of code in many languages, including C and C++.) I am still boggled that programmers who claim to be interested in security (and who moreover claim to be uninfluenced by marketing and "cool", but rather by technical concerns) still choose C or C++ for their projects.

    1. Re:Official Language-based security thread! by timeOday · · Score: 1
      I am still boggled that programmers who claim to be interested in security (and who moreover claim to be uninfluenced by marketing and "cool", but rather by technical concerns) still choose C or C++ for their projects.
      I agree that unsafe languages are on the way out for most applications in the long run. There's just no reason NOT to prevent these errors automatically. Code reviews and "being careful" are not solutions. There's no good reason for a language to be full of "undefined behavior" black holes.

      And yet I'm a hypocrite, as I use C++ for most things (except Perl for text processing and little utilities). Why? Because the maturity of the tools, availability of libraries, and performance.

      I don't feel performance and GUI appearance are inherintly degraded by VM's, but in today's world, they are. Every Tom Dick and Harry has an interpreted scripting language with a bunch of different unstable GUI bindings, but that's not good enough.

      I'm afraid that Linux is losing ground to MS on this front. Microsoft's CLR is here to stay and has good development tools. Soon most apps for Windows won't have buffer overflows or invalid pointers anymore. They'll still be open to other things, like email worms, but regardless it will seem increasingly senseless and frustrating when yet another buffer overflow attack is found in a Linux app.

    2. Re:Official Language-based security thread! by Dr.+Manhattan · · Score: 1
      I am still boggled that programmers who claim to be interested in security (and who moreover claim to be uninfluenced by marketing and "cool", but rather by technical concerns) still choose C or C++ for their projects.

      For some types of programs, performance (in speed and resource use) really really matters. There are targets that current VMs just can't meet. These situations are becoming increasingly rare (indeed, IMHO they are the distinct minority at this point, thank goodness), but they do exist.

      Careful design can minimize a lot of this. I chose C for my secure networking program, but made sure it couldn't be subject to buffer overflow and other such attacks. If you look at the design goals and restraints, I think you'll agree that C was the right choice.

      --
      PHEM - party like it's 1997-2003!
    3. Re:Official Language-based security thread! by Tom7 · · Score: 1

      I agree with you, and there is a definite social and tool-availability pressures that make modern languages harder to use. But these problems are easily solved with a community effort, which is something that open source folks are good at!

      I also agree that I think windows will see a real security benefit from the .NET CLR (maybe only because it will allow programmers to more easily integrate newer and more secure languages with the OS API), and I think it's sad that linux will have to play catch-up.

      By the way, safe languages by no means need a VM. SML and O'Caml are both natively compiled, fast, and safe.

    4. Re:Official Language-based security thread! by Tom7 · · Score: 1

      There are targets that current VMs just can't meet.

      True, but there exist several fine safe languages that don't use VMs.

    5. Re:Official Language-based security thread! by Anonymous Coward · · Score: 0

      See the earlier slashdot discussion [slashdot.org] for loads of argument. ( here [spacebar.org] for my perspective--note, I am a tower-in-the-sky PhD student in programming languages, but I do write lots of code in many languages, including C and C++.) I am still boggled that programmers who claim to be interested in security (and who moreover claim to be uninfluenced by marketing and "cool", but rather by technical concerns) still choose C or C++ for their projects.

      "It is a poor carpenter that blames his tools."

      C and C++ do suffer from buffer overflow attacks, but it is possible to guard against such attacks. If there were a (preferably standard) safer array construct in C that everyone could use instead of plain old arrays, then C could be almost as safe as other languages. Unfortunately, there seems to be a lot of inertia that keeps everyone from adopting a non-standard safer container. However, we could, in theory make the language much safer than it is today without replacing it altogether.

  48. Topic is wrong by Anonymous Coward · · Score: 0

    If this had been a Windows problem I suspect the Topic would have been Bug or Security, obviously since it's Linux we couldn't put it there, hmm programming that sounds nice.

  49. Har har. You are teh clevar. by Ayanami+Rei · · Score: 0, Troll

    You've got the slashbot MINDSET pat down. Maybe you can pretend to be a slashdotter in the TALENT SHOW.
    Also, your website sucks.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  50. Kind of amusing, since... by devphil · · Score: 1


    ...a few months ago, there was a /. article roasting someone at an antivirus software company for suggesting that "JPEGs may open holes to viruses" and "we may have to give up the JPEG format."

    Slashdot readers were waiting in line to flame the guy for suggesting that mere image files could have any possible security implications ("it's just a data file, it doesn't contain code, he's obviously clueless, unlike me and everyone who agrees with me"), and raising the spectre of having to abandon JPEGs because of a virus ("dumbass, we can fix anything, we're invulnerable").

    The mockers were partly right, in that of course such a hole would be patched and we could all move on with out lives; nobody's suggesting today that PNG be abandoned, and if libjpeg were discovered to secretly transmit an email calling for the assassination of Ronald McDonald when asked to display an image of a taco, nobody sane would call for dropping JPEGs, either.

    But hopefully some of the 10-year-olds flaming away then with "no simple data file can open a door to a virus or have any security effect, cuz the contents aren't executed as code, l00zer" will get a bit of an education today. You only hope the contents aren't executed as code...

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:Kind of amusing, since... by slamb · · Score: 1
      But hopefully some of the 10-year-olds flaming away then with "no simple data file can open a door to a virus or have any security effect, cuz the contents aren't executed as code, l00zer" will get a bit of an education today. You only hope the contents aren't executed as code...

      Indeed. I've noticed recently some .pdf files that can crash Apple's Preview.app. That makes me nervous, since often such crashes are exploitable. I wonder how long it is before someone makes malicious .pdfs...we're used to those being safe, but maybe they aren't.

    2. Re:Kind of amusing, since... by jack_csk · · Score: 1

      Then Microsoft will declare that document files are formatted texts and can't execute code.
      Oh...wait... they can.

  51. Mitigation... by Chief+Typist · · Score: 2

    It appears to me that this problem exists at both the client and the server.

    Updating a server to use the patched version of libpng is an obvious first step. You don't want the buffer overflow compromising security as you deliver a .png file (which would only be an issue if you read the .png from the server before delivery.)

    The tricky part is what to do with the .png files that have been tampered with. You don't really want to serve those up to clients -- you'd be delivering a security risk. There will be a significant lag before client software is updated -- browsers and anything else that streams .png over a network connection will be at risk during this time.

    It seems to me that there's a need for some kind of scanning tool that checks for bogus .png files. At the server side, you could scan for compromised files and get rid of them.

    Does such a tool exist?

    -ch

  52. Interesting synchronicity by mwood · · Score: 1

    Someone was asking on a mailing list why Mozilla fanboys think their browser is so much more secure than the Internet Explorer fanboys' browser. (My words, not his.) The same day, the PNG vulnerability came out. THE SAME DAY, the patched Mozilla, Firefox, etc. were released. I was using the new Mozilla an hour after I learned (via mail from US-CERT) about the vulnerability in a third-party library that Mozilla uses.

    I consider the question answered.

  53. Where's the outcry? by rd_syringe · · Score: 2, Insightful

    If this was a Microsoft thing, Slashdot would be all over it. Arbitrary code execution from an IMAGE READING LIBRARY?!

    Just the obligatory "perspective" post. :)

    1. Re:Where's the outcry? by aardvarkjoe · · Score: 0, Troll

      But it's OK, really, since it's open source. Everyone who installed Mozilla audited all the code before using it.

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    2. Re:Where's the outcry? by sdcharle · · Score: 1
      Yeah, if it were a Microsoft vulnerability, which headline would we see:
      • Vulnerability in Windows Threatens National Security
      • There is a buffer overflow or something in sumrndmlib.dll
    3. Re:Where's the outcry? by Anonymous Coward · · Score: 0

      Perspective my ass. If this was a Microsoft thing, you wouldn't know about for YEARS and even then Microsoft would deny it until some third party came out with the exploit at which point they would drag their feet in coming up with a patch.

      But, even with all your complaining, here the story is on the front page of Slashdot. What was that about "Slashdot would be all over it"? Looks like they are already, but you're too much of an idiot to recognize that fact.

      And while we're at it, let us not forget that CERT warned people away from Internet Explorer recently. Why don't you put that in your pipe and smoke it you fucking crackhead.

      Again, perspective my ass. How garbage like this gets modded up is beyond me.

  54. [SOLVED, partially] Re:Buffer overflow *again*? by cpghost · · Score: 1

    A lot of problems (though not all) would go away with the right GCC extension.

    --
    cpghost at Cordula's Web.
  55. Sandbox for a browser by iamacat · · Score: 1

    Why give an application accessing potentially hostile content unlimited access to your system. I am surprised you Linux users don't already run Mozilla chrooted or VMed. I might try that for Safari once I figure out all the dependencies.

    1. Re:Sandbox for a browser by Anonymous Coward · · Score: 0

      chroot? VM? Dependencies? WTF? Just create a restricted user account just for browsing and su before starting the browser. Delete and recreate the account one in a while if you're feeling particularly paranoid.

    2. Re:Sandbox for a browser by iamacat · · Score: 1

      This depends on the whole system being secure - no programs setting wrong permissions for temporary files, no public-accessible stuff in home directories. Me, I would rather put a criminal in jail than let him wonder around and make sure everyone else got bars on the windows.

  56. Crashes Safari by spitzak · · Score: 1

    Tried the above image in Safari on OS/X and it went bye-bye after a great deal of disk thrashing. Offered me the chance to submit a bug report to Apple, but I didn't bother, as I figure somebody else has told them already...

  57. Interesting by Anonymous Coward · · Score: 0

    A while ago I created a 1280x1024 black and white checkerboard pattern PNG using the GIMP. Strangely, this file was able to crash some viewers and looked wrong in others. I still have the file sitting around but I never got around to reporting the bug to the relevant parties. I wonder if it could be related to these vulnerabilities.

    1. Re:Interesting by Anonymous Coward · · Score: 0

      After writing the parent post, I decided to see how bad the effects of the image were. Not only did the image viewer (feh) lock up, so did X, and I was unable to do ctrl-alt-f1 (although I was able to move my mouse cursor). My remedy involved logging in via my Sony Clie and killing X (the KILL signal was required). This worked, but my virtual consoles were left in an unusable state, with 1 and 2 pixel wide vertical stripes of white, separated by 1 pixel wide stripes of black.

    2. Re:Interesting by Anonymous Coward · · Score: 0

      Send a copy of the image to glennrp at imagemagick.org and he'll diagnose it.

  58. libpng? by xmorg · · Score: 1

    gif is still better, it shows up transarent colors.

    1. Re:libpng? by maunleon · · Score: 1

      What color is a trans[p]arent color?

  59. Re:php ! by Anonymous Coward · · Score: 0

    Well good fucking luck exploiting it on the server side considering it's a client side problem!

  60. File is offline now. by leuk_he · · Score: 1

    Somebody did not like the traffic and took the file down.

  61. What makes you think it isn't a Microsoft thing? by juhaz · · Score: 1

    Programs: libpng users including mozilla, konqueror, various e-mail clients, generally lots. Also reports that some versions of IE are vulnerable to some of the problems.

    I don't know if pngfilt.dll includes libpng code, but if it doesn't, then they've apparently managed to make same mistakes on their own.

  62. Re:What makes you think it isn't a Microsoft thing by JKR · · Score: 1
    What makes you think it isn't a Microsoft thing?

    Well, maybe the fact that MS didn't write libpng? D'uh.

  63. WTF? by Anonymous Coward · · Score: 0

    You've always been a weak-ass troll, but now you're just fucking pathetic. Swallow a gun and do us all a favor.

  64. Re:What makes you think it isn't a Microsoft thing by juhaz · · Score: 1

    It doesn't matter who wrote what.

    If Microsoft, or Mozilla Foundation, or $SOFTWARE_VENDOR chooses to include public domain or BSD licensed code into their application, they're from thereon just as much responsible for any holes it may create in that app as if they'd written it themselves.

    When you're creating a piece of software from smaller modules you check that they're safe whether particular code comes from Microsoft Employee 12323154, anonymous patch in bugzilla, libpng folks or $WHATEVER, and if you don't, then it's your fault, whichever it was, simple, right?