Slashdot Mirror


GnuTLS Flaw Leaves Many Linux Users Open To Attacks

A new flaw has been discovered in the GnuTLS cryptographic library that ships with several popular Linux distributions and hundreds of software implementations. According to the bug report, "A malicious server could use this flaw to send an excessively long session id value and trigger a buffer overflow in a connecting TLS/SSL client using GnuTLS, causing it to crash or, possibly, execute arbitrary code." A patch is currently available, but it will take time for all of the software maintainers to implement it. A lengthy technical analysis is available. "There don't appear to be any obvious signs that an attack is under way, making it possible to exploit the vulnerability in surreptitious "drive-by" attacks. There are no reports that the vulnerability is actively being exploited in the wild."

23 of 127 comments (clear)

  1. "malicious server" by bill_mcgonigle · · Score: 3, Informative

    malicious server

    Sorta important - there's not much popular software that uses GNUTLS, but wget is one of them. Since it's almost always used as a client, it's probably wise to use curl -O against unknown servers, until they get this straightened out.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    1. Re:"malicious server" by kthreadd · · Score: 4, Insightful

      Wget can be built for either OpenSSL or GnuTLS.

  2. Basic programming principles what? by maugle · · Score: 5, Insightful

    I don't understand what the programmers of all these crypto libraries were thinking here. Even for the most basic and unimportant program, the rule is "if the data comes from outside, verify!" This is vastly more important when cryptography is involved, so why is it that all these crypto libraries seem to blindly trust whatever the Internet is sending them?!

    1. Re:Basic programming principles what? by QuietLagoon · · Score: 4, Insightful

      I don't understand what the programmers of all these crypto libraries were thinking here. Even for the most basic and unimportant program, the rule is "if the data comes from outside, verify!" This is vastly more important when cryptography is involved, so why is it that all these crypto libraries seem to blindly trust whatever the Internet is sending them?!

      From what I read of the OpenSSL source code, it would be an insult to programmers everywhere to call the people who barfed up the OpenSSL code "programmers".

    2. Re:Basic programming principles what? by rahvin112 · · Score: 3, Insightful

      The actual rule is you always verify data, regardless of source. You might trust internal data to not be intentionally malicious but you can't design something idiot proof because idiots are incredibly ingenious.

    3. Re:Basic programming principles what? by Anonymous Coward · · Score: 2, Insightful

      not exactly lucky ... it's just there so damn many of them ....

    4. Re:Basic programming principles what? by cant_get_a_good_nick · · Score: 3, Interesting

      I think there's a basic issue here, and that's of "what do I want to work on". This is a problem in any project - it's not limited to coding.

      I'm sure GNUTLS is coded how many things are coded. Lets start with a framework, and hang dummy code on it. Say "hey we got here!" when we got a packet. Then you flesh that out, and do what you really should do when you get that. Hey, it works! Beers all around. Then later, you start thinking "hmm, how can this get abused" and you add checks.

      But wait, before you think of how you can get broken, you're like "this code needs real functionality, let me work on this next". And the boundschecks never get coded.

      I'm sure you've been on a project where you thought "i really should cross all the T's, dot all the I's here" then your boss says "it works good enough" and you never get around to making it bulletproof. Or you do the fun drywall project at home, and you already sanded with 150 grit, you just not bother with the 300 grit.. it's good enough.

      OpenSource doesn't mean it's not written by people, with peoples' quirks and issues.

    5. Re:Basic programming principles what? by Just+Some+Guy · · Score: 3, Informative

      I've done code that works on multiple platforms. It used to be really, really gnarly: everything platform was always just a little bit different. And you get code that looks just like what I've seen in the snarky comments.

      No, you don't. If you have a broken printf on a platform, you write code like:

      #ifdef BROKEN_PRINTF
      int GOOD_printf(...) {
      /* Work around the breakage */
      }
      #else
      #define GOOD_printf printf
      #endif

      GOOD_printf("Hello, world!\n");

      so that you've encapsulated the damage to one place in your codebase. You don't sprinkle #ifdef BROKEN_PRINTF a thousand different places in 20 modules if you don't want to go insane trying to keep track of it.

      The OpenSSL devs aren't getting grief for writing complex code. They're getting grief for writing unnecessarily complex code by an order of magnitude, and they've earned every bit of it.

      --
      Dewey, what part of this looks like authorities should be involved?
  3. announcing goatsecret by larry+bagina · · Score: 4, Funny

    There have been too many problems with existing crypto code so I've developed something better: goatsecret. Instead of relying on math, it relies on a frenchman's gaping asshole. Basically, the software breaks your message/file/whatever into small chunks and superimposes the data in the goatsecret image. Sure, it's not encrypted, but who is going to stare into the void just to get your data? No hacker/cracker/big business/three-letter-agency is that desperate.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

    1. Re:announcing goatsecret by Anonymous Coward · · Score: 2, Insightful

      There have been too many problems with existing crypto code so I've developed something better: goatsecret. Instead of relying on math, it relies on a frenchman's gaping asshole. Basically, the software breaks your message/file/whatever into small chunks and superimposes the data in the goatsecret image. Sure, it's not encrypted, but who is going to stare into the void just to get your data? No hacker/cracker/big business/three-letter-agency is that desperate.

      ... neither is the intended recipient of the data.
      That's the only flaw with your scheme I can think of.

  4. Re:~45yrs of buffer overflows... by ledow · · Score: 3, Insightful

    The alternative of runtime-performance hits, and allowing arrays to grow to unreasonable - and uncontrollable - sizes without inserting checks similar to those that combat buffer overflows just seems to be something that nobody wants.

    Fact is, moan all you like, system libraries can be written in any language you like, and interface with C code and C-style functions quite easily. There's nothing stopping - as Windows is moving towards - system libraries being written in a managed language and interfacing with old-style C API's.

    But nobody's doing that. Not because buffer overflow in C isn't a problem, not because they naively think their code is bulletproof. But simply because of reasons of performance, memory use and knock-on library sizes and dependencies.

    Nobody is stopping yourself, or anyone else, from rewriting something as performance critical as GnuTLS in any language you like. But nobody has. And if they have, nobody that develops code that requires GnuTLS uses it.

    For kernels and drivers, I'd fight the corner of "It has to be C, or a similar, dangerous, low-level language". Once you get to the application layer of things like OpenSSL, GnuTLS, or pretty much any library, there's no excuse. Nobody's writing them, and if they are they are losing out to the C-based libraries. And not BECAUSE they are written in C and we all have this nostalgia for crappy C code, not BECAUSE these things must be written in C to work properly, not BECAUSE the API is C-based and not language interfaces with it - but obviously because of other reasons.

    What those exact reasons are, I'll leave others to discuss. But I greatly suspect it's to do with the huge size and impact of such managed languages.

  5. Re:Who uses GnuTLS? by Anonymous Coward · · Score: 4, Informative

    "apt-cache showpkg libgnutls26" says that mutt, claws-mail, empathy, emacs, telepathy, wine, and some qemu stuff uses it.

    So it is not completely unused.

  6. Re:~45yrs of buffer overflows... by Animats · · Score: 3, Insightful

    No, it's a backwards compatibility issue. There's all that C code out there, sort of working. It's not an overhead issue. Most subscript checks in inner loops can be hoisted to the top of the loop and optimized out. For FOR loops, this is almost a no-brainer inside a compiler. The Go compiler, which checks subscripts, does that.

    There are three big memory issues in C: "How big is it","Who deletes it", and "Who locks it?". The language helps with none of those. "How big is it" problems lead to buffer overflows and security holes. "Who deletes it" leads to memory leaks, and occasionally use after deletion. "Who locks it" leads to race conditions. Of these problems, "How big is it" cause the most security trouble.

    C is especially bad because the language doesn't even have a way to talk about the size of an array. When you pass an array to a function, all size info is lost. This sucks.

    C is this way because the compiler had to be crammed in a machine with an address space of 128KB, the PDP-11. We have more memory now. I first wrote C in 1978. We should be past this mess by now.

  7. Re:~45yrs of buffer overflows... by lister+king+of+smeg · · Score: 2

    I'd even go far as to say the problem creeps into larger issues. All the libraries you require are based in C/C++. QT, etc. These code bases are completely massive and even if you run some small "shows a box on screen" app you are calling 3000 lines of possibly broken an insecure code. The solution is move the core libraries away from C to C#, Java, or some other viable candidate that prevents software from "doing bad things". Essentially what the open source community has been saying is "trust us", but who exactly do you trust to carry your wallet? I only trust myself... How about you? Community developed software is great provided it is implemented on a framework that is invulnerable to input errors. I rather have my app crash than get hacked.

    Guess what language the Java VM's or CLR VM are written... C and C++, sometimes assembly.
    So what you are saying is we should not be codeing with libraries that are written in C or C++ instead we should be coding with VMs that are written in C and C++. And how exactly is that any better?

    As for trusting these VM to not let code do bad things you mean like we should trust the VMs who's security was bad enough Homeland security issued an warning to dissable or remove it?

    --
    ---Saying gnome 3 is better than windows 8 not so much a compliment as it is damning with light praise.
  8. Re:Deja Vu? by by+(1706743) · · Score: 2

    Well, this is Slashdot, so most stories are dupes anyway...

  9. Whoops by Anonymous Coward · · Score: 2

    Should have used LibreSSL.

  10. wrong. by Anonymous Coward · · Score: 2, Informative

    C is that way because it had to interface to HARDWARE that doesn't know anything about size limitations.

    And EVERY language you use has to interface at some point where "size" limitations are unknown.

    And if the hardware (ie, the CPU) has such instructions (like the VAX did) you then bump into the problem of lack of portability... And the CPU is then so constrained that it can't evolve either... (also a VAX problem - it had so many things bound to a 32 bit address that it couldn't go to 64 bits, and remain a VAX).

  11. Re:still not seeing a problem by kthreadd · · Score: 2

    Since I'm not using any of those to make calls to unknown servers, I'm not seeing a problem there.

    It's not just that. How do you know you're not making a call to a compromosed server?

  12. Re:C strikes out again by GiganticLyingMouth · · Score: 2

    Or... if you're using C++, use a Standard Library container? They all keep track of their sizes, and can perform runtime bounds checks (by using say, at() rather than the bracket operator). Or Write your own class with an array member and an accessor that does bounds checking. It's not difficult to do. At all. And templates aren't meant for addressing buffer overflow problems, or as a replacement for raw pointer (use STL containers). Or garbage collection (use RAII). I get the feeling you aren't too familiar with C++?

  13. Re:What's the /. FUD "mantra" we all heard? by pushing-robot · · Score: 3, Funny

    "Windows != Secure, & Linux = Secure"??

    It was true for a long time, but then someone trying to be helpful changed it to "Linux == Secure" and it was no longer.

    --
    How can I believe you when you tell me what I don't want to hear?
  14. Re:Who uses GnuTLS? by Anonymous Coward · · Score: 2, Insightful

    The are basically no embedded devices with GnuTLS, it is GPLv3 licensed and there are much more free packages available (OpenSSL, ...) It is also known for being insecure.

  15. Re:~45yrs of buffer overflows... by soccerisgod · · Score: 2

    C is especially bad because the language doesn't even have a way to talk about the size of an array. When you pass an array to a function, all size info is lost. This sucks.

    How is that a problem? Pass the size in a separate variable. Put the array in a struct and add a member for the size. Or add a function to your struct that returns the size. Whatever. The possibilities are there. If you don't use them because programming in C is less cushy than in other languages, the fault is entirely yours. There is nothing in C preventing you from writing proper code. You just have to do it, with the understanding that it will be more work. But it's hardly impossible.

    --
    If a train station is a place where a train stops, what's a workstation?
  16. Re:~45yrs of buffer overflows... by soccerisgod · · Score: 2

    It's a problem because it requires programmers to concern themselves with low-level tedious details that the compiler could handle for them

    So basically your statement can be reduced to is "If you're lazy and stupid, don't use C". I'm fine with that. But I'd like to add that if you're lazy and stupid, don't program at all, become a manager.

    --
    If a train station is a place where a train stops, what's a workstation?