CERT Warns Of Multiple Vulnerabilities In Libpng 259
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."
Firefox (Score:2, Interesting)
Re:Firefox (Score:5, Informative)
Re:Firefox (Score:2)
Where's the outcry? (Score:3, Insightful)
Just the obligatory "perspective" post.
Re:Firefox (Score:4, Informative)
New builds of Mozilla / Firefox / Thunderbird have been released to patch four potential security vulnerabilities including the libpng issue [mozilla.org]
Re:Firefox (Score:2)
Re:Firefox (Score:2)
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?
Mozilla (Score:3, Interesting)
Re:Mozilla (Score:4, Informative)
Re:Mozilla (Score:2)
Re:Mozilla (Score:5, Funny)
Re:Mozilla (Score:2, Informative)
Re:Mozilla (Score:5, 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, 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...
Re:Mozilla (Score:3, Informative)
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)
Re:Mozilla (Score:2, Informative)
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
Canary (Score:4, 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.
Re:Canary (Score:2)
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.
Re:Canary (Score:2)
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!
Re:Mozilla (Score:2)
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.
Bugs in Compilers... (Score:3, Interesting)
Re:Mozilla (Score:2)
>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 [sourceforge.net].
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.
Re:Mozilla (Score:2)
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.
Diagram (Score:2, Funny)
Old news (Score:2, Interesting)
Re:Old news (Score:5, Funny)
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...."
Re:How old is it REALLY? (Score:2)
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
Re:How old is it REALLY? (Score:3, Informative)
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.
Ah-ha! (Score:5, Funny)
Re:Ah-ha! (Score:5, Informative)
The latest SP2 fixes it. (Score:5, Informative)
Its reassuring that for once MS has already taken care of some security issue (for XP SP2 at least).
Re:The latest SP2 fixes it. (Score:2)
No crash in a fully patched IE from XP SP1.
Re:The latest SP2 fixes it. (Score:2)
Re:The latest SP2 fixes it. (Score:4, Informative)
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.
Re:The latest SP2 fixes it. (Score:2)
BOEM. (Score:3, Informative)
bla bba
[x] restart mirosoft internet explorer
[b]WOW[/b], it is a portable bug!
can anybody tell us if this is exploitable?
Re:The latest SP2 fixes it. (Score:2)
Re:The latest SP2 fixes it. (Score:2)
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...
Proof of Concept image (Score:2)
damn kids these days.
--
Where did you get the example PNG ? (Score:2)
Re:Where did you get the example PNG ? (Score:2)
Re:Where did you get the example PNG ? (Score:2)
Re:Ah-ha! (Score:3, Interesting)
well (Score:3, Funny)
Kind of amusing, since... (Score:2)
...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
Updates (Score:4, Informative)
Re:Updates (Score:2)
http://www.mandrakesoft.com/security/advisories?n
Re:Updates (Score:2)
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 [voltar.org] is from the bugtraq post. If it crashes your browser, you're not fixed.
Re:Updates (Score:2)
Re:Updates (Score:2)
my mistake.
Re:Updates (Score:2)
Re:Updates (Score:2)
Re:Updates (Score:2)
Bug? it's a feature! (Score:5, Funny)
This is not a bug it's a feature; the libpng team are obviously trying to get a piece of the ActiveX control market...
Re: (Score:2)
Gentoo (Score:3, Interesting)
Re:Gentoo (Score:5, Informative)
Re:Gentoo (Score:2)
RCS file:
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.
Re:Gentoo (Score:2)
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.
Re:Gentoo (Score:4, Insightful)
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.
Re:Gentoo (Score:2)
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 w
Buffer overflow *again*? (Score:2, Interesting)
Re:Buffer overflow *again*? (Score:2)
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.
Official Language-based security thread! (Score:3, Insightful)
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 [debian.org] (depending on the language; the number-two language on that list is safe and places above C++!).
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
Re:Official Language-based security thread! (Score:2)
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 hole
Re:Spoken like a true AC... (Score:2)
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.
Re:Spoken like a true AC... (Score:2)
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.
PNG security threat (Score:2, Funny)
Re:PNG security threat (Score:2)
With the risk of being non-funny: yes.
And the Australian government is making sure that they're getting their 'fair' share of it!
Combine this... (Score:5, Informative)
Re:Combine this... (Score:2)
Running 2.6.7-gentoo-r10
Re:Combine this... (Score:3, 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". (:
Re:Combine this... (Score:2)
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'.
Arbitrary Code...? (Score:2, Funny)
Re:Arbitrary Code...? (Score:2)
Re:Arbitrary Code...? (Score:2)
Debian (Score:4, Interesting)
Fixed
I love this!
Thanks Guys!
SuSE patch also already available (Score:2, Informative)
Attribution? (Score:3, Interesting)
I think it is time we started attributing vulnerabilities to the authors (just as we do with companies).
Re:Attribution? (Score:3, Insightful)
Re:Attribution? (Score:3, Insightful)
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
Another exploit in libpng (Score:5, Interesting)
anyone opens it... *BAM* it expands into 2gb of ram.
Re:Another exploit in libpng (Score:5, Interesting)
Re:Another exploit in libpng (Score:2)
*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?
Standardized Libraries (Score:2)
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 bec
Re:Standardized Libraries (Score:2)
"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 implemen
Mitigation... (Score:3)
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
The tricky part is what to do with the
It seems to me that there's a need for some kind of scanning tool that checks for bogus
Does such a tool exist?
-ch
Interesting synchronicity (Score:2)
I consider the question answered.
Re:Didn't this happen with BMP? (Score:5, Informative)
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.. )
Re:Didn't this happen with BMP? (Score:3, Interesting)
Ah, you mean the vast majority of people are now running Athlon64's? (tip: Plain IA32 CPUs don't support the NX bit).
Re:Didn't this happen with BMP? (Score:2)
Re:Didn't this happen with BMP? (Score:2)
How exactly do you stop the cpu executing the stack if there is no way to mark it as non-executable?
Re:Didn't this happen with BMP? (Score:4, Informative)
http://people.redhat.com/mingo/exec-shield
Re:Didn't this happen with BMP? (Score:2)
> 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.
Re:Didn't this happen with BMP? (Score:2)
Re:php ! (Score:5, Funny)
Re:php ! (Score:3, Insightful)
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.
It's a decoder problem (Score:5, Informative)
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.
Re:It's a decoder problem (Score:2)
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:
...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 ma
Re:It's a decoder problem (Score:2)
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
Re:WinXP (Score:2, Informative)
! - 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