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."

79 of 127 comments (clear)

  1. Who uses GnuTLS? by Anonymous Coward · · Score: 1

    Everything I know of uses OpenSSL.

    1. 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.

    2. Re:Who uses GnuTLS? by r1348 · · Score: 1

      If that makes you feel safe...

    3. Re:Who uses GnuTLS? by OdinOdin_ · · Score: 1

      But no major server software that another party can connect remotely to exploit.

    4. Re:Who uses GnuTLS? by Boltronics · · Score: 1


      $ apt-cache rdepends libgnutls26 | tail -n +3 | wc -l
      497

      Oh crap...

      --
      It's GNU/Linux dammit!
    5. Re:Who uses GnuTLS? by LMariachi · · Score: 1

      Don't know about the others, but mutt has an option to compile with OpenSSL instead.

    6. 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.

    7. Re:Who uses GnuTLS? by TheRealLifeboy · · Score: 1

      Ho, that's what you think! Have a look at this: chromium-browser is in there as well! $ apt-cache showpkg libgnutls26 Package: libgnutls26 Versions: 2.12.23-12ubuntu2.1 (/var/lib/apt/lists/za.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_main_binary-amd64_Packages) (/var/lib/dpkg/status) Description Language: File: /var/lib/apt/lists/za.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages MD5: 07e09..... Description Language: en File: /var/lib/apt/lists/za.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en MD5: 07e091.... 2.12.23-12ubuntu2 (/var/lib/apt/lists/za.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages) Description Language: File: /var/lib/apt/lists/za.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages MD5: 07e09141.... Description Language: en File: /var/lib/apt/lists/za.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en MD5: 07e091.... Reverse Depends: qemu-system-x86,libgnutls26 2.12.17-0 qemu-system-sparc,libgnutls26 2.12.17-0 qemu-system-ppc,libgnutls26 2.12.17-0 qemu-system-misc,libgnutls26 2.12.17-0 qemu-system-mips,libgnutls26 2.12.17-0 qemu-system-arm,libgnutls26 2.12.17-0 libgnutls26:i386,libgnutls26 2.12.23-12ubuntu2.1 libgnutls26:i386,libgnutls26 2.12.23-12ubuntu2.1 libavformat54,libgnutls26 2.12.17-0 libav-tools,libgnutls26 2.12.17-0 gstreamer1.0-plugins-bad,libgnutls26 2.12.17-0 samba-libs,libgnutls26 2.12.17-0 qemu-system-x86,libgnutls26 2.12.17-0 qemu-system-sparc,libgnutls26 2.12.17-0 qemu-system-ppc,libgnutls26 2.12.17-0 qemu-system-misc,libgnutls26 2.12.17-0 qemu-system-mips,libgnutls26 2.12.17-0 qemu-system-arm,libgnutls26 2.12.17-0 libvirt0,libgnutls26 2.12.17-0 libvirt-bin,libgnutls26 2.12.17-0 libgnutlsxx27,libgnutls26 2.12.23-12ubuntu2.1 libgnutls26-dbg,libgnutls26 2.12.23-12ubuntu2.1 libgnutls-openssl27,libgnutls26 2.12.23-12ubuntu2.1 libgnutls-dev,libgnutls26 2.12.23-12ubuntu2.1 gnutls-bin,libgnutls26 2.12.17-0 empathy,libgnutls26 2.12.17-0 libgnutls26:i386,libgnutls26 2.12.23-12ubuntu2 libgnutls26:i386,libgnutls26 2.12.23-12ubuntu2 libgcrypt11:i386,libgnutls26 2.12.7-3 xxxterm,libgnutls26 2.12.17-0 xfce4-mailwatch-plugin,libgnutls26 2.12.17-0 xen-utils-4.4,libgnutls26 2.12.17-0 wmbiff,libgnutls26 2.7.14-0 wine1.6-amd64,libgnutls26 weechat-plugins,libgnutls26 2.12.17-0 weechat-curses,libgnutls26 2.12.17-0 weechat-core,libgnutls26 2.12.17-0 webfs,libgnutls26 2.12.17-0 vpnc,libgnutls26 2.12.6.1-0 sogo,libgnutls26 2.12.17-0 slrnpull,libgnutls26 2.12.17-0 slrn,libgnutls26 2.12.17-0 shishi-kdc,libgnutls26 2.12.17-0 scrollz,libgnutls26 2.12.6.1-0 rsyslog-gnutls,libgnutls26 2.12.17-0 qutim,libgnutls26 2.12.6.1-0 python-gnutls,libgnutls26 2.4.1 prelude-manager,libgnutls26 2.12.17-0 postal,libgnutls26 2.12.6.1-0 plasma-widget-mail,libgnutls26 2.12.6.1-0 pianobar,libgnutls26 2.12.17-0 pacemaker-remote,libgnutls26 2.12.17-0 pacemaker-mgmt-client,libgnutls26 2.12.17-0 pacemaker-mgmt,libgnutls26 2.12.17-0 openconnect,libgnutls26 2.12.17-0 nzbget,libgnutls26 2.12.17-0 nullmailer,libgnutls26 2.12.17-0 ngircd,libgnutls26 2.12.17-0 newsbeuter,libgnutls26 2.12.17-0 mutt-patched,libgnutls26 2.12.17-0 msmtp-gnome,libgnutls26 2.12.17-0 msmtp,libgnutls26 2.12.17-0 mpop-gnome,libgnutls26 2.12.17-0 mpop,libgnutls26 2.12.17-0 minbif,libgnutls26 2.12.6.1-0 mandos-client,libgnutls26 2.12.6.1-0 libyaz4,libgnutls26 2.12.17-0 libxmlsec1-gnutls,libgnutls26 2.12.17-0 libwireshark3,libgnutls26 2.12.17-0 libvmime0,libgnutls26 2.12.17-0 libucommon6,libgnutls26 2.12.17-0 libsope1,libgnutls26 2.12.17-0 libshishi0,libgnutls26 2.12.17-0 libpiano0,libgnutls26 2.12.17-0 libpam-pin,libgnutls26 2.12

    8. Re:Who uses GnuTLS? by TheRealLifeboy · · Score: 1

      Dang! And I can't even edit that messy post!

  2. "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 bill_mcgonigle · · Score: 1

      Have you even read the analysis ?

      Did you notice that dependency tree only applies to voidlinux? Looking quickly, a few distros that were building wget against GNUTLS (wget is a GNU product), e.g. arch, are now building it against openssl, which is a step in the right direction (probably, maybe, ifs/ands/buts/save-us-libressl).

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

      Exim uses gnutls on debian (and ubuntu, and probably other derivates).

    3. Re:"malicious server" by kthreadd · · Score: 4, Insightful

      Wget can be built for either OpenSSL or GnuTLS.

    4. Re:"malicious server" by Carnildo · · Score: 1

      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.

      wget can be built against OpenSSL, and curl can be used with GnuTLS.

      --
      "They redundantly repeated themselves over and over again incessantly without end ad infinitum" -- ibid.
  3. Laugh by koan · · Score: 1

    I saw the patch first thing, then the warning telling me it wasn't trusted.

    --
    "If any question why we died, Tell them because our fathers lied."
  4. 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 Arakageeta · · Score: 1

      It seems like taint tracking and sanitation should be pervasive and explicit. This can be partially enforced by type enforcement, no?

    2. 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".

    3. Re:Basic programming principles what? by Anonymous Coward · · Score: 1

      It all comes down to money and time in the end. Input verification type errors like this are the most common bug in all software, but most of those don't involve exploits just screw up something you are doing. The weakness is really in the fact that C/C++ are extremely long in the tooth with the way that they handle bounds checking and really -- we have CPU cycles to burn across the board at this point. If this were implemented in Java, C#, or any other modern language it just would be simply impossible to have the problem. It's very hard to prevent errors that are caused by undefined responses -- the way to do so is to quit using languages that permit them. I rather have a program crash land than run an exploit.

    4. 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.

    5. Re:Basic programming principles what? by Anonymous Coward · · Score: 1

      As someone who works on closed source software, let me tell you there is all sorts of bullshit that goes on with ignoring things until there is a financial advantage not to. Also anything with the word Enterprise or Cluster is usually a hackjob.

    6. Re:Basic programming principles what? by FatdogHaiku · · Score: 1

      ...but you can't design something idiot proof because idiots are incredibly ingenious.

      And incomprehensibly lucky...

      --
      You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
    7. Re:Basic programming principles what? by mean+pun · · Score: 1

      It seems like taint tracking and sanitation should be pervasive and explicit. This can be partially enforced by type enforcement, no?

      This is possible in almost any modern language, although in some languages the code will be so horrible you can wonder if the cure isn't worse than the disease. For example, in C you could wrap tainted data in a struct that is only touched by a few select sanitisation functions. (You would still have to make sure no lazy or malicious code pokes around in the struct, or casts away this protection, but you could write a tool to check that.) Similar for languages like Python, although again it is easy to get around the isolation, so discipline and checking is still required. Languages like Java (or Swift :-)) are strict enough that you can almost completely enforce this isolation rather than rely on disciplined programming (I say almost because you cannot block access to I/O functions, so in principle you could still ignore the isolation, and directly access the tainted data). In C++ you can make the isolating `wrapper' almost transparent, but all the C trickery is still available.

      I think it is fair to say that an important reason that these techniques are not used is cultural. Building a watertight taint wrapper in C (the most common language for this kind of code) is tricky and boring, and there is a lot of Real-Programmers-don't-Need-Handholding mentality among C programmers.

    8. Re:Basic programming principles what? by gbjbaanb · · Score: 1

      you're not up to date are you - about 20 years out of date TBH.

      C++ has had bounds checking of arrays for decades, either through guard pages at both ends, or with decent containers.

      sure, when working with C constructs, you're falling back to C, but even then you could enable memory guard pages in most compilers. Its just that these are generally only enabled in debug builds (as if you don't spot the bug when you're testing debug, you're not likely to find it in release builds either I guess).

    9. Re:Basic programming principles what? by Anonymous Coward · · Score: 1

      The rule should be to always verify, regardless of where the data comes from. You can catch a lot of bugs by not being too presumptuous about complex data structures or formats you receive from "trusted" callers.

      But I'm not advocating belt & suspenders programming. That's usually bad engineering. Bridge builders don't decide to just toss in a few more girders "just to be on the safe side". Writing algorithms that are robust and resilient without being redundant takes a very thoughtful approach.

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

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

    11. 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.

    12. Re:Basic programming principles what? by rsclient · · Score: 1, Offtopic

      Actually, most of the comments I've seen about the OpenSSL code are immature, and show a lack of appreciation for the changes in the industry.

      Like, remember that if-isupper-then-tolower code? Well, back in the day, tolower on most platforms would just bit-bang in a '1' bit. That will convert A to a, but also converts at-sign to back-tick. In "modern" toolchains, this doesn't happen any more; tolower is expected to handle all chars, and work correctly.

      But -- as a developer, can you prove that every system that you're running on has a proper implementation of tolower? It's easy for me; I only work with one version of Visual Studio, and I can quickly prove that tolower work.

      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.

      --
      Want a sig like mine? Join ACM's SigSig today!
    13. 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?
    14. Re:Basic programming principles what? by soccerisgod · · Score: 1

      That's exactly the problem. If you think to add features first, security later you have already made a fundamental mistake. Writing secure code is not a matter of adding extra checking later. It means writing good, proper code right from the start. One of the most obvious consequences of that is not to use functions like sprintf at all, but use substitutes that allow and in fact demand proper length checking.

      My $0.05: Of course managers never see a business case for adding security checking later. There is no obvious way it will make the company more money, so something "more important" will take precedent. But on the other hand, not writing secure code right from the start also means the programmer is not making a habit of writing good code. It shows a serious problem with their attitude toward their own work. That is not to say that there won't still be mistakes made, but a lot of them can be prevented right from the start.

      --
      If a train station is a place where a train stops, what's a workstation?
    15. Re:Basic programming principles what? by TheRaven64 · · Score: 1

      Closed-source for-profit software is typically backed by a company that is willing to (but not always competent at) fire bad programmers whose contributions end up adding more work for others than solving problems.

      The problem with this idea is that it assumes that it's easy to attribute costs to a particular programmer. The Heartbleed bug added a new feature (yay! Marketing checkbox!) and sat undiscovered for a couple of years. Do you think that the developer would have been fired immediately after introducing it in a closed-source environment?

      --
      I am TheRaven on Soylent News
    16. Re:Basic programming principles what? by TheRaven64 · · Score: 1

      Almost right, except that you stick #define printf GOOD_printf at the end of the #ifdef block and then always use printf(), don't force everyone reading the code to work out that GOOD_printf() means printf().

      --
      I am TheRaven on Soylent News
    17. Re:Basic programming principles what? by Just+Some+Guy · · Score: 1

      That works, too. OpenSSL took the route of using the macro names everywhere (calling them BIO_*), which kind of makes sense because printf wouldn't necessarily have the behavior documented in a contributor's printf(3) man page. That could be a whole 'nother world of hurt.

      --
      Dewey, what part of this looks like authorities should be involved?
    18. Re:Basic programming principles what? by TheRaven64 · · Score: 1

      OpenSSL took the worst possible route. They had FOO_{standard library function} and BAR_{standard library function}, and also just used the unadorned library function. The FOO_ variant had some special behaviour, the BAR_ version was sometimes the standard library version and sometimes their own (depending on both the platform and the function - in some cases they always wrote their own even when there's an adequate - or even better - version shipped with the platform, in some cases they made a per-platform decision about it).

      --
      I am TheRaven on Soylent News
    19. Re:Basic programming principles what? by cwsumner · · Score: 1

      ... But I'm not advocating belt & suspenders programming. That's usually bad engineering. Bridge builders don't decide to just toss in a few more girders "just to be on the safe side". Writing algorithms that are robust and resilient without being redundant takes a very thoughtful approach.

      They used a dangerous speed hack, in a message that was used occasionally and was non critical.
      The speed hack was why the out-of-range was not detected. That is not good programming, or good judgement.

    20. Re:Basic programming principles what? by cwsumner · · Score: 1

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

      That's true.
      But it is not an excuse.

  5. 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.

    2. Re:announcing goatsecret by GameboyRMH · · Score: 1

      I have developed a program that cracks goatsecret output: goatsextract. It is able to automatically extract the data from a frenchman's gaping asshole, without the user ever viewing the goatsecret image. Requires imagemagick, tesseract and leptonica.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    3. Re:announcing goatsecret by Noryungi · · Score: 1

      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.

      ... Except if the recipient is French, of course!

      (By the way, wasn't the goatse.cx guy American?)

      --
      The right to offend is far more important than the right not to be offended. (Rowan Atkinson)
  6. ~45yrs of buffer overflows... by devloop · · Score: 1


    ...at least since C was initially created (and perhaps even before that).

    When do We accept that this is a failure intrinsic to the programming languages themselves and move on to correct it?

    http://en.wikipedia.org/wiki/B...

    1. Re:~45yrs of buffer overflows... by Narcocide · · Score: 1

      As soon as Ruby can walk the walk that they so brazenly talk while maintaining an acceptable performance level. People who *don't* design languages for a living still have to care about how the execution times for simple tasks affects their clients' operating costs. A true carpenter doesn't blame his tools for his own mistakes.

    2. Re:~45yrs of buffer overflows... by mindmaster064 · · Score: 1

      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.

    3. 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.

    4. 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.

    5. 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.
    6. Re:~45yrs of buffer overflows... by Anonymous Coward · · Score: 1

      I think it's a bit weak to blame the programming language on sloppy programming. Since when do we blame the tools for shoddy workmanship?

    7. Re:~45yrs of buffer overflows... by Anonymous Coward · · Score: 1

      Managed languages have a few problems.

      First of all, they're slow due to JIT compiling. "Wait, what?" I hear you ask. Isn't JITting supposed to be faster? That's what we've all been told, right? No. JITting is faster than interpretation, including bytecode interpretation. JITting is not faster than raw machine code. Period. The fact that it has to be JITted is overhead enough to make it slow when compared to something that needs no immediate compilation. Now, that's not to say it doesn't help in certain cases. Anything using reflection is definitely going to benefit from the flexibility afforded by the approach. But anyone who has worked with managed code knows that reflection is a performance killer of epic proportions and should be used sparingly.

      Second of all, managed languages don't bootstrap. They have dependencies. At a minimum, they require some kind of runtime environment. That runtime environment has to be written in some language. It didn't just appear out of thin air. It has to boil down to machine code at some point. Sure, you could make an ASIC, but for this kind of situation those are called "processors with microcode support", and then you're making your own machine code that just happens to align with an emulator you previously wrote for another platform.

      None of this is to say that most programming shouldn't be done in a managed environment. Just don't get the grand idea that everything should be managed code. Especially things like encryption.

      Encryption should, ideally, be a system device. That way, the device endpoint can be mapped to either a hardware implementation or a software virtual implementation and can be remapped as needed. It would also allow for multiple parallel implementations to be in use in the same system, just like you might have multiple network devices of various types and specifications.

    8. Re:~45yrs of buffer overflows... by lgw · · Score: 1

      The performance hit and need for the runtime is a big problem in many ways. Compiling to native code is the right path to jumping those hurdles. For C#, .NET Native is quite interesting. I can think of so many ways MS could ruin this, but the prospect of a stand-alone exe compiled from C# is exiting.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    9. Re:~45yrs of buffer overflows... by Anonymous Coward · · Score: 1

      "system libraries can be written in any language you like"

      Let me know when your language of choice can make a system call without using assembly...

    10. Re:~45yrs of buffer overflows... by mindmaster064 · · Score: 1

      Yes, but it's easier to worry about one library (the VM) than 5000. Also the need for "compiling" is caused by the limitation that your OS cannot directly digest the bytecode. If it could there is nearly no need for a C++ glue layer other than a very minimal one that can easily be secured. If it can read that code then the C++ dependency goes away outside of the small bit riding right on the hardware. Put C where it belongs -- touching the hardware -- move the standard libraries into the virtual sandbox. No more problems.

    11. 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?
    12. Re:~45yrs of buffer overflows... by antientropic · · Score: 1

      How is that a problem? Pass the size in a separate variable.

      You've just answered your own question. It's a problem because it requires programmers to concern themselves with low-level tedious details that the compiler could handle for them - details that they are in fact likely to get wrong. (E.g., you have to pass the correct size value, you have to remember to check it everywhere, and so on.)

      Decades of buffer overflows should be sufficient evidence that this is not a good approach. Unfortunately, many programmers stubbornly refuse to see the obvious.

    13. 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?
    14. Re:~45yrs of buffer overflows... by david_thornley · · Score: 1

      FWIW, Heartbleed didn't fail because of anything inherent to C (I don't know about the Gnu stuff). It wasn't a buffer overflow; it was a matter of leaving raw memory in the buffer. Using "calloc" instead of "malloc" consistently would have prevented exploitation.

      I'd say that, if developers didn't use the safety features immediately available in C, they'd have screwed up in any language.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  7. Windows never looked so good by Anonymous Coward · · Score: 1

    Na-na-na-na-na.

    1. Re:Windows never looked so good by Anonymous Coward · · Score: 1

      Rest assured the Windows bugs are there. It's just that only malicious individuals and GO's know about them and they ain't saying shit because they use them[or sell them].

    2. Re:Windows never looked so good by Anonymous Coward · · Score: 1

      Yup. Good thing that no open-source libraries are available for Windows, right? And, I mean, Microsoft is perfect. Not like they release thousands of bug fixes for each iteration of their operating systems.

      Thank you for your infinite wisdom, AC.

  8. C strikes out again by Animats · · Score: 1, Flamebait

    This is C code, the only major language that doesn't know how big its arrays are. After 30 years of buffer overflow bugs, you'd thing we'd have something better now for low-level programming. The higher level stuff, where you can use garbage collection, is in good shape, with Java, C#, Python, etc. resistant to buffer overflow problems. C and C++, though, are still broken. C++ tries to paper over the problem with templates, but the mold (raw pointers) keeps seeping through the wallpaper.

    I've tried. Here's my paper on a stricter version of C that's object-compatible with existing C code. It's techncally possible to fix this problem. The political problems are huge.

    1. Re:C strikes out again by Greyfox · · Score: 1

      The programmers always know how big those arrays are. They're just lazy or bad in a variety of ways. It's easy enough to bound a read or copy to a specific size. They just never actually do. I've been on a couple of big C projects and a few smaller ones and the programmer always know what they're working with in a specific function. The problem is never that they don't know how big that specific thing is. The problem is they make no effort to validate the size, or that the pointer's not null, or that someone put good data in it. The number of ways programmers will find to be bad or lazy are countless, and I don't think you can make a language that will account for all of them while still being useful.

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    2. Re:C strikes out again by Anonymous Coward · · Score: 1

      That "stricter version of C ... " is also slow.

      Runtime checks are already possible... but are slow to use. And the runtime checks STILL have to be implemented by something that doesn't have runtime checks...

      C is what it is. Good for implementing whatever you want. And that means it has to allow you to do things that shoot yourself in the foot.

      C is used to implement programs for things from an 8 bit processor used for controllers (see PIC for an example - some only have 256 bytes of ram, and 2K of rom; Think all that forced runtime checks will fit?) to 64 bit supercomputers.

      It is the portable assembler of the age.

    3. 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++?

    4. Re:C strikes out again by techno-vampire · · Score: 1

      I haven't done any programming in years, but when I did, I worked in C. On every project that I worked on, we were expected to use strncpy() instead of just strcpy() to make sure that we didn't copy more bytes than we had room for. AFAIK, not one of those projects ever had a buffer overflow issue. Why this isn't the standard now is beyond me.

      --
      Good, inexpensive web hosting
    5. Re:C strikes out again by Greyfox · · Score: 1

      I should point out that the same programmers are usually the ones with tons of null pointer exceptions in their java logs that no one ever reads. You'd think someone would read the log every so often, say "Hmm. There are a lot of exceptions in here. Maybe I should fix a few of them since the stack trace points you right to the line where the exception occurred!" Nope! Not so much!

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    6. Re:C strikes out again by coolsnowmen · · Score: 1

      I don't know in this particular case. But in general, C compilers are much easier to write than c++ compilers; so they exist on more platforms.

    7. Re:C strikes out again by david_thornley · · Score: 1

      To be pedantic, strncpy() isn't just a limited version of strcpy(), and was designed for a different use (copying into a fixed-length area of memory). Always put the terminating '\0' at the end of the buffer to be safe.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    8. Re:C strikes out again by david_thornley · · Score: 1

      That's why you use an optimizing compiler when you need things to be fast. It can normally figure out when it can skip the first two instructions, or do it only once.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    9. Re:C strikes out again by techno-vampire · · Score: 1

      Yes indeed. And, of course, make sure that if the maximum number of bytes are copied the \0 will still be there. Avoiding buffer overruns in C isn't rocket surgery, it's just a matter of common sense and good programming habits.

      --
      Good, inexpensive web hosting
  9. Re:Deja Vu? by by+(1706743) · · Score: 2

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

  10. Whoops by Anonymous Coward · · Score: 2

    Should have used LibreSSL.

  11. Re:still not seeing a problem by by+(1706743) · · Score: 1

    Yeah but since we're now thinking about this GnuTLS bug, I'm sure "telepathy" will start making calls to unknown servers.

    I'll...I'll show myself out.

  12. 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).

  13. 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?

  14. Re:Who uses GnuTLS? FileZilla by Bacon+Bits · · Score: 1

    FileZilla uses GnuTLS because the maintainer decided OpenSSL had an API that was too unwieldy.

    --
    The road to tyranny has always been paved with claims of necessity.
  15. Re:Who uses GnuTLS? FileZilla by Bacon+Bits · · Score: 1

    Note: Patch for FileZilla is already available. Update to 3.8.1 which uses GnuTLS 3.2.15.

    --
    The road to tyranny has always been paved with claims of necessity.
  16. Re:What's the /. FUD "mantra" we all heard? by Anonymous Coward · · Score: 1

    Shut up. ***I*** am APK.

    APK

  17. 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?
  18. Re:Security by Obscurity only... apk by lhunath · · Score: 1

    First of all, none of this has anything to do with "Linux". These are all user-land libraries and tools you're referring to. They are all available for Linux, BSD and Windows alike; including OpenSSL and GnuTLS.

    Secondly, "top dog" has nothing to do with any of this either. Software such as OpenSSL and GnuTLS needs to be secure. That means that there should be no exploits. The amount of people "attacking" it is irrelevant given those constraints. Whether 1 researcher is looking for bugs or 10.000 criminals are trying to exploit it is irrelevant. None of them should be able to find anything useful.

    Lastly, Windows as much as any other proprietary solution is completely irrelevant to this discussion to anyone with a sensible opinion on the topic. That's not because proprietary software is worse than free software, it's because proprietary software can never offer the kinds of security guarantees that free software can by mere virtue of their insistence on secrecy. What that means is, even if there is a proprietary replacement of OpenSSL for which no exploit is published in 10 years, you could never trust that the NSA, the Russians, the Chinese or the Iranians don't have a way in. You can't even trust that they haven't forced the company to add in back-doors and keep them secret. Essentially, proprietary software loses by default and free software is the only useful thing we have left, even if it sometimes fails at keeping its promises.

    --
    ``OK, so ten out of ten for style, but minus several million for good thinking, yeah?''
  19. Indeed, wrong by Animats · · Score: 1

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

    That's what programming languages are for - to allow better abstractions than the hardware provides. That's what higher level languages are for. At the assembly code level, few assemblers know about array size, but C is not an assembly language. C knows about loops, and scope, which the hardware does not. This allows optimization of checks, which can often be hoisted out of a loop. (For non-compiler people, "hoisting" means moving a computation upwards in code, so that it's done earlier, preferably once per loop instead of once per iteration. Most optimizing compilers do some hoisting.)

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

    To what? Even when you go to an I/O device, you're usually telling a DMA controller what the size of the buffer is.

    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).

    The VAX had integer overflow checking, which wasn't used much. I once rebuilt the UNIX command line tools on a VAX with the entry masks for functions set to raise a hardware exception on overflow. About half of the tools broke. The VAX machines were heavily microcoded, with explicitly sequential semantics within instructions. As a result, some of the fancier instructions were unreasonably slow. DEC had a terrible problem making VAX machines go faster. Then they went in the other direction with the Alpha, which was a very basic RISC machine. That went fast, but never caught on. All of this is irrelevant to modern computing.