Slashdot Mirror


Serious Network Function Vulnerability Found In Glibc

An anonymous reader writes: A very serious security problem has been found and patched in the GNU C Library (Glibc). A heap-based buffer overflow was found in __nss_hostname_digits_dots() function, which is used by the gethostbyname() and gethostbyname2() function calls. A remote attacker able to make an application call to either of these functions could use this flaw to execute arbitrary code with the permissions of the user running the program. The vulnerability is easy to trigger as gethostbyname() can be called remotely for applications that do any kind of DNS resolving within the code. Qualys, who discovered the vulnerability (nicknamed "Ghost") during a code audit, wrote a mailing list entry with more details, including in-depth analysis and exploit vectors.

34 of 211 comments (clear)

  1. Switch back to original Linux libc? by BaronM · · Score: 5, Funny

    The libc -> glibc switch was so much fun, that I think we should do it again in reverse!

  2. Re:Open source code is open for everyone by Anonymous Coward · · Score: 5, Insightful

    I don't get it. Proprietary software has all sorts of serious vulnerabilities. Why is it that when a vulnerability is found in FOSS, you people all come out and mock it while ignoring all the incompetence of proprietary software?

    FOSS *is* more secure, and that's true even with the occasional vulnerability. You're extremely illogical to point to some vulnerabilities and conclude that it isn't more secure. How many vulnerabilities are not known about because no one can look at the source code?

  3. Re:Open source code is open for everyone by Wootery · · Score: 5, Insightful

    So long as we're writing in C, this kind of thing (buffer overflows in particular) will probably continue.

    (Lest I start a flame-war: C is awesome in its way, but more than almost any other language, it really does make it easy to miss things like this.)

  4. Re:Open source code is open for everyone by Serenissima · · Score: 3, Funny

    I don't get it......Why is it that when a vulnerability is found in FOSS, you people all come out and mock it while ignoring all the incompetence of proprietary software?

    I see that this is your first visit to Slashdot. Welcome!

    --
    Give a man a fire and he'll be warm for a day. But light a man on fire and he'll be warm for the rest of his life.
  5. Heartbleed by ArchieBunker · · Score: 3, Insightful

    How many years was Heartbleed around before anyone noticed? Apparently "many eyes" were not reading that bit of code.

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
    1. Re:Heartbleed by Anonymous Coward · · Score: 4, Insightful

      How many years have various bugs been in proprietary software that no one has noticed (and most don't have a chance to notice)? This is just illogical thinking.

      Yes, we get it. Software is made by humans. Mistakes will be made, whether it's free/open source or not. The point is, FOSS provides more security by allowing more eyes to see the code and the ability to get anyone to publicly audit the code. Sometimes big vulnerabilities won't be discovered for a long time, but that applies even more to proprietary software; don't forget that.

    2. Re:Heartbleed by serviscope_minor · · Score: 4, Insightful

      Apparently "many eyes" were not reading that bit of code.

      Will you please actually read the quote rather than quoting an inorrect interpretation. The quote is:

      "given enough eyeballs, all bugs are shallow"

      It means that once a bug is found, it is shallow, i.e. quick and easy to solve for someone. It doesn't and never did mean that all bugs will be found.

      --
      SJW n. One who posts facts.
    3. Re:Heartbleed by Anonymous Coward · · Score: 2, Insightful

      Even fewer people do it for free.

      No one has any evidence on that, one way or the other.
      What we do know is, it's illegal to fix proprietary software.

    4. Re:Heartbleed by grcumb · · Score: 2, Insightful

      Will you please actually read the quote rather than quoting an inorrect interpretation. The quote is:

      "given enough eyeballs, all bugs are shallow"

      It means that once a bug is found, it is shallow, i.e. quick and easy to solve for someone. It doesn't and never did mean that all bugs will be found.

      Actually, it's unfortunate, but I think he did mean that:

      Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix will be obvious to someone.

      That's his longer version of the same slogan - literally the next sentence in the essay.

      It's possible to read that as meaning that every problem —once it's been found— will be fixed quickly and relatively easily, but Occam's razor says that we should understand discovery of the problem to be implicit in this statement.

      But... you are right to say that FOSS is far better at fixing known bugs than proprietary software. By the late '90s, I was so sick of having my professional reputation as a systems software developer tarnished by bugs, poor quality and stupid release cycles that I stopped supporting Windows entirely. Dropped the entire proprietary ecosystem and moved to Linux and FOSS. I can't say it's been perfect, but I've slept way better since then.

      --
      Crumb's Corollary: Never bring a knife to a bun fight.
    5. Re:Heartbleed by Curunir_wolf · · Score: 2

      At least in proprietary software, people are paid to do it.

      If you really believe that is true, I suggest you provide a list of all the companies advertising on Dice looking for "source code vulnerability auditors." Can't find any? That's because companies pushing out commercial software don't give a crap. It's hard enough just getting the get-the-features-out-focused managers to get why you're spending time writing tests, much less doing code reviews to look for vulnerabilities. I've even heard them say things like "It's not necessary because I found this free tool on the Internet that scans all your code for that, so we don't need to do manual work like that."

      --
      "Somebody has to do something. It's just incredibly pathetic it has to be us."
      --- Jerry Garcia
  6. From TFA by Cola+Junkee · · Score: 5, Informative

    " - We identified a number of factors that mitigate the impact of this bug. In particular, we discovered that it was fixed on May 21, 2013 (between the releases of glibc-2.17 and glibc-2.18). Unfortunately, it was not recognized as a security threat; as a result, most stable and long-term-support distributions were left exposed (and still are): Debian 7 (wheezy), Red Hat Enterprise Linux 6 & 7, CentOS 6 & 7, Ubuntu 12.04, for example. "

    So it's actually already been fixed. All that's needed here is for some distributions to push the fix out.

    --

    f u cn rd ths, u r prbbly a lsy spllr.

    1. Re:From TFA by OzPeter · · Score: 2

      So it's actually already been fixed. All that's needed here is for some distributions to push the fix out.

      But .. but now it has a CVE number and everything - so it must be scary

      --
      I am Slashdot. Are you Slashdot as well?
    2. Re:From TFA by XXeR · · Score: 4, Informative

      But .. but now it has a CVE number and everything - so it must be scary

      Written by somebody who clearly neither manages a large amount of hosts exposed to the Internet nor manages multiple environments in which there are some new hosts that are luckily patched along side other older hosts that have to run *slightly* older releases of distro's for one reason or another.

      This IS a big deal.

    3. Re:From TFA by msobkow · · Score: 3, Informative

      I just installed glibc updates for Debian, so I presume the fix has been pushed.

      --
      I do not fail; I succeed at finding out what does not work.
    4. Re:From TFA by phantomfive · · Score: 2
      Here's a better explanation of the flaw. It's actually a fairly limited vulnerability:

      At most sizeof(char *) bytes can be overwritten (ie, 4 bytes on 32-bit machines, and 8 bytes on 64-bit machines). Bytes can be overwritten only with digits ('0'...'9'), dots ('.'), and a terminating null character ('\0').

      With only being able to overwrite 4 bytes max, you would think not much could be done, and indeed, mostly they were only able to make things crash. Most servers don't do dns lookup of a remotely supplied address, but mail-servers can, to verify the sender is correct.

      Astonishingly, even without being able to write assembly shell-code, they were able to get the Exim mail server to execute arbitrary remote commands. That is the only vulnerability found so far.

      --
      "First they came for the slanderers and i said nothing."
    5. Re:From TFA by phantomfive · · Score: 3, Informative

      Also, please note, it's not enough to call gethostby functions for this bug to be a vulnerability. For it to be a vulnerability, you need several things:

      1) A (more or less) specific sequence of function calls. Merely calling gethostby* itself won't do it.
      2) The eventual call to gethostby on a string supplied by a hostile user.
      3) Have another buffer hostile users to fill (not overflow).
      4) A weakness of your program structure that allows four bytes to reference the other buffer.
      5) Include a service that runs things on the command line.

      Exim allowed all of those. You might be able to get away without number 5 present, but the program would need some other weakness to make it exploitable.

      --
      "First they came for the slanderers and i said nothing."
    6. Re:From TFA by phantomfive · · Score: 2

      I just checked my version of Unix, /sbin/ping is owned by root, but SUID bit is not set. I'm guessing SUID isn't very common for ping anymore (of course, not long ago, people were still writing shell scripts with SUID).

      --
      "First they came for the slanderers and i said nothing."
  7. Re:Open source code is open for everyone by jythie · · Score: 5, Insightful

    I am suspicious of any C coder (myself included) who does not acknowledge this basic problem ^_^

  8. Not all code is vulnerable - getaddrinfo() is fine by tlhIngan · · Score: 4, Informative

    The affected call is gethostbyname() and friends, which have been deprecated by the more protocol-transparent getaddrinfo()/getnameinfo() set of APIs. If you use IPv6, getaddrinfo() is the only way (gethostbyname() and friends are AF_INET (IPv4) functions only), but they're protocol transparent ways to do DNS lookups (they can return AF_INET, AF_INET6 and any other valid address supported by the system and DNS).

    Deep down, if you look closely, they mention that code using getaddrinfo() is not vulnerable to the bug.

    Shortly after learning about getaddrinfo() I stuck to using it - far easier to use than gethostbyname() and less messy in the end. The only complication is having to call freeaddrinfo() when you're done.

  9. Re:Not all code is vulnerable - getaddrinfo() is f by BlueBlade · · Score: 2

    However, it's not like gethostbyname() is a rare call. I suspect that well over 99% of net-aware applications are still using it. This affects just about everything that's talking over the internet.

    --
    Religion is the best example of mass psychosis
  10. Think you're immune from attacks? by Rinikusu · · Score: 5, Funny

    Don't be so glib, see?

    I'll be here all night folks. Tip your servers. Make sure they're bolted in, though.

    --
    If you were me, you'd be good lookin'. - six string samurai
    1. Re:Think you're immune from attacks? by grcumb · · Score: 5, Funny

      Don't be so glib, see?

      I'll be here all night folks. Tip your servers. Make sure they're bolted in, though.

      Don't blow your stack if nobody applauds. It's just that we're overflowing with bad puns, and the funny bits get flipped around, and in the end all we see is some stupid zero on the stage who's only in it for the cache anyway.

      --
      Crumb's Corollary: Never bring a knife to a bun fight.
  11. Shallow bug doesn't mean non-existent. Fix obvious by raymorris · · Score: 5, Insightful

    In case you're unaware, "bugs are shallow" doesn't mean they don't exist.

    ESRs complete sentence is:

    "given enough eyeballs, all bugs are shallow; or more formally: Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix will be obvious to someone."

    In other words, someone will quickly quote Adam Savage and say "THERE'S your problem!". :)

    The difference between a deep bug and a shallow bug is is what happens after you notice a problem. A shallow bug is right there, at the surface. Function foo() is supposed to return x, but instead it returns x -1, and there is the line of the code that's the problem.

    A deep bug is one where you look at function foo(), which creates an instance of class Bar, which is subclassed from IEParser, which calls friend class HTML4Lexer, which has function TagAtrribute() - but TagAtrribute() returns the correct value, so how the heck is it wrong in Bar? Then when you found out WHY it's wrong, you can't come up with any way of fixing it without rewriting the HTML specification.

    Heartbleed is actually a great example. Many people looked at it right away and within an hour or so there was a patch available. Those may people discussed the three or four proposed long-term solutions and in about 24 hours we agreed on that Florian's solution was best. Florian was one of the many eyes, and the bug was shallow to him - "he fix will be obvious to someone", and that someone was Florian.

  12. Re:Accidental bugs? by ScentCone · · Score: 2

    There must be agencies seeding these projects, commercial and open source, with toxic contributors injected there to deliberately contaminate the code with such bugs. The further fact that one never sees responsible persons identified, removed and blacklisted suggests that contamination is top down.

    Or, you are yourself a toxic seed planted by The Man in order to foment FUD and make good people not want to be part of these projects. Or something like that. Give it a rest with the absurd conspiracy crap.

    --
    Don't disappoint your bird dog. Go to the range.
  13. Re:Open source code is open for everyone by myowntrueself · · Score: 3, Informative

    FOSS *is* more secure, and that's true even with the occasional vulnerability.

    Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooool.

    Its true *ESPECIALLY* with the occasional vulnerability because thats a vulnerability thats been found, publicised and fixed unlike in the proprietary shit where the vulnerability will be found by a limited group of people and kept secret so they can use it.

    --
    In the free world the media isn't government run; the government is media run.
  14. Re: Accidental bugs? by lazybeam · · Score: 2

    Never attribute to malice that which is adequately explained by stupidity.

    There are too many stupid people in the world. Stupidity isn't necessarily a permanent thing: it could be caused by time constraints, personal problems or even lack of/too much caffeine. Or just because one doesn't think of the problem from start to finish.

    But then this could be what "they" want you to believe :)

    --
    --
    no sig for you. come back one year.
  15. Raspbian vulnerable by redelm · · Score: 5, Informative

    According to directions side-thread, glibc versions prior to 2.19 are vulnerable. Checking my machines, Slackware-current and Lubuntu-14.10 are fine. Only my poor tiny Raspberry Pis are vulnerable (2.13). But they run slowly enough I can watch the gethostbyname() lookups myself :)

  16. Re:Open source code is open for everyone by phantomfive · · Score: 2

    People who think that Java (or C#, or Python) language will fix their security problems write more security bugs than C programmers who work around the weaknesses of their language.

    Similarly, people who think Java (or C#, or Javascript) will fix the problem of memory leaks, are probably leaking memory all over the place. Recently I've been fixing a bunch of memory leaks in Javascript.....if you attach something to the DOM, make sure you have a plan for getting it off, otherwise you're probably leaking.

    --
    "First they came for the slanderers and i said nothing."
  17. Re:Open source code is open for everyone by myowntrueself · · Score: 3, Informative

    FOSS *is* more secure, and that's true even with the occasional vulnerability.

    Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooool.

    Its true *ESPECIALLY* with the occasional vulnerability because thats a vulnerability thats been found, publicised and fixed unlike in the proprietary shit where the vulnerability will be found by a limited group of people and kept secret so they can use it.

    Oh, you mean those nice folks over in Eastern Europe?

    and the intelligence network of the 5 main english speaking nations...

    --
    In the free world the media isn't government run; the government is media run.
  18. Re:Open source code is open for everyone by peppepz · · Score: 4, Informative
    In fact, the bug had already been audited and fixed, almost two years ago, when the security researchers found a way to exploit it. From TFA:

    We identified a number of factors that mitigate the impact of this bug. In particular, we discovered that it was fixed on May 21, 2013 (between the releases of glibc-2.17 and glibc-2.18)

    Current glibc release is 2.20. That's three relases without the bug already.

    Nothing to see here, move along.

  19. Re:Not all code is vulnerable - getaddrinfo() is f by tlhIngan · · Score: 2

    However, it's not like gethostbyname() is a rare call. I suspect that well over 99% of net-aware applications are still using it. This affects just about everything that's talking over the internet.

    True, but gethostbyname() is ancient and if the program wants to support IPv6, you can't use gethostbyname(). So I think the number of programs actually vulnerable is far lower. Remember, gethostbyname() only works with AF_INET - while getaddrinfo() works with AF_INET, AF_INET6 and any other protocol that uses sockets (since it returns

    struct sockaddr*

    making life really easy).

    So a lot of older code is vulnerable, newer code less so. it's been around about 15 years or so.

  20. Re:NSA by ledow · · Score: 2

    Your assumption is only one person did an analysis.

    Do you have any idea how many people have combed over glibc and either reported or exploited issues found?

    Hell, read the article - THE PROBLEM WAS PATCHED before he found it. What we're talking about is some old distros are still distributing that code unpatched, and that's the real problem.

    We can all jump to conclusions but, personally, I doubt the NSA have anywhere near the capabilities they (and you) suggest. These people are in the art of deception. They don't need to crack something, they just need to make you think they have.

    In the grand scheme of things, any secure system is out of their reach anyway, whether it uses this code or not. The systems they're interested in are likely running under much more strict scrutiny and a single attempt to exploit such things would raise alarms and even accusations of initiating cyber-wars.

    To be honest, I'll put my trust in a planet full of people checking open code casually than a select group of "experts" hunting out these flaws.

    People are being paid, worldwide, to find and fix these flaws in major commercial companies and just as security researchers, in universities or for their own personal reputation.

    Next, we'll be in the "acres of supercomputers" and "boxes in every ISP" bollocks. You know what? If I were the NSA, that's EXACTLY what I'd want you to think.

    They're either incompetent (fucking up Elliptic Curves in public forums and being spotted instantly), or they're not (in which case you can't believe anything they say and likely won't know what the REAL trick is).

  21. Re:Open source code is open for everyone by phantomfive · · Score: 5, Insightful

    Managed languages (like Java and C#) give you a "secure-by-default" memory and execution model that's a lot harder to accidentally mess up.

    If you think managed languages will prevent you from leaving security vulnerabilities, you are either not writing significant server software, or your software has vulnerabilities.

    The hardest security problems to solve aren't the overflows, it's the features given to users. Think of VB macro viruses, that spread wildly in a managed language. Wordpress is another example of software written in a managed language with tons of exploits.

    There are so many examples of exploits in managed systems that it's a display of ignorance to claim otherwise. .Net is especially bad in this regard, not because C# is inherently more insecure, but because the community applauds and encourages ignorance, and even makes people feel bad for knowing things. See this presentation for an example. Notice (for example) his micro-agressions against people who understand garbage collection. The implication is you don't need to think about it, C# will take care of memory.......which if you take seriously, means you'll be leaking crap all over the place and someone like me will have to come clean it up for you.

    --
    "First they came for the slanderers and i said nothing."
  22. Re:Not all code is vulnerable - getaddrinfo() is f by spitzak · · Score: 2

    As pointed out in the article, the program must use gethostbyname() on a name supplied by the attacker.

    A much more mitigating factor is that the bug is only exercised if the name looks like a numerical id, and according to their search most software first checks this using inet_aton() and only calls gethostbyname() if this fails, thus avoiding the bug.