Slashdot Mirror


Bug In the GnuTLS Library Leaves Many OSs and Apps At Risk

New submitter williamyf writes "According to this article at Ars Technica, '[A] bug in the GnuTLS library makes it trivial for attackers to bypass secure sockets layer (SSL) and Transport Layer Security (TLS) protections available on websites that depend on the open source package. Initial estimates included in Internet discussions such as this one indicate that more than 200 different operating systems or applications rely on GnuTLS to implement crucial SSL and TLS operations, but it wouldn't be surprising if the actual number is much higher. Web applications, e-mail programs, and other code that use the library are vulnerable to exploits that allow attackers monitoring connections to silently decode encrypted traffic passing between end users and servers.' The coding error may have been present since 2005."

42 of 231 comments (clear)

  1. Now we'll find out... by Anonymous Coward · · Score: 3, Insightful

    ...who has been surreptitiously using GPL'd code in their proprietary stacks...

    1. Re:Now we'll find out... by kthreadd · · Score: 2

      GnuTLS is actually under the lesser GPL.

    2. Re:Now we'll find out... by WaffleMonster · · Score: 3, Insightful

      ...who has been surreptitiously using GPL'd code in their proprietary stacks...

      Why would anyone bother when they could just use OpenSSL and not have to worry about it?

  2. Fortunately not OpenSSL by Carewolf · · Score: 2

    Thank god it is in gnuTLS that is not used by any applications serious about security. Just checked, only printer drivers seems affected in my Debian installation.

  3. We all knew it was coming... by neiras · · Score: 5, Informative

    From February 16 2008: Howard Chu of OpenLDAP: GnuTLS Considered Harmful

    Looking across more of their APIs, I see that the code makes liberal use of strlen and strcat, when it needs to be using counted-length data blobs everywhere. In short, the code is fundamentally broken; most of its external and internal APIs are incapable of passing binary data without mangling it. The code is completely unsafe for handling binary data, and yet the nature of TLS processing is almost entirely dependent on secure handling of binary data.

    Incredible that GnuTLS is used anywhere at all. It's just mind boggling.

    1. Re:We all knew it was coming... by sk999 · · Score: 4, Informative

      Just downloaded the latest patched source code. Here's the summary:

      find . -name '*.c' | xargs grep strlen | wc -l
      522

      find . -name '*.c' | xargs grep strcat | wc -l
      44

      Just as flawed as ever.

  4. With enough eyes... NOT by williamyf · · Score: 4, Interesting

    I have always been critical about that conventional wisdom of "With enough eyeballs, all bugs are shallow".

    I contend that is inacurate. With enough QUALIFIED AND MOTIVATED eyes, all bugs are shallow, and sometimes, some FOSS project lack enough Qualified eyes.

    This bug, the KDE one, or even the Metafile bug in windows (and more importantly in WINE) among many others, show that many eyes are not enough.

    Again one needs MOTIVATED AND QUALIFIED eyes AAAAAND good QA and test cases.

    Cheers

    --
    *** Suerte a todos y Feliz dia!
    1. Re:With enough eyes... NOT by rmstar · · Score: 3, Insightful

      Again one needs MOTIVATED AND QUALIFIED eyes AAAAAND good QA and test cases.

      Perhaps using a safety aware language like Ada would be helpful too. C is known to be brittle, yet people insist in writing all sorts of mission critical code in it. I really wonder why.

  5. Re:God by Anonymous Coward · · Score: 2, Funny

    It has gnu in the name. RMS is easily confused for the guy with the beard that people follow with religious vigor.

  6. Severe, and yet not severe. by Frobnicator · · Score: 3, Informative

    The bug requires a carefully-crafted certificate. That certificate will verify as valid and trusted when it should not be. The connection will still be secure, it will just be with an untrusted person.

    So basically it allows a very dedicated attacker to forge a cert and become a MitM attack.

    We all know governments have done this for years. It is widely known that root CA certificates have been violated by spy agencies. A few searches on Google will show bunches of news stories where attackers (all types, government attackers, ID theft attackers, etc) have made fake certificates, abused the CA model, and engaged in similar MitM attacks to what this allows.

    SSL/TLS communications are just as secure as they always were. If you have personally verified and trusted the certificates the attack wouldn't work, it is only when your trust model allows a cert that you don't personally trust to be used in authentication, and even then it still allows a secure connection but to a wrongly-trusted individual.

    The flaw is the trust model and using a cert that you don't personally trust to be valid, which is a well-known issue.

    --
    //TODO: Think of witty sig statement
    1. Re:Severe, and yet not severe. by Anonymous Coward · · Score: 2, Insightful

      "The connection will still be secure, it will just be with an untrusted person."

      What are you smoking? A connection with a MITM is not "secure". This is WORSE than sending data in plaintext.

    2. Re:Severe, and yet not severe. by rritterson · · Score: 2

      Your reasoning is a bit circular. This bug allows governments to do MitM attacks. Governments have already been doing MitM attacks, perhaps by exploiting this bug. Therefore, this bug is no big deal?

      SSL/TLS communications are just as secure as they always where, which is to say broken in a widely used library under an implementation/trust model is that is very widely used.

      --
      -Ryan
      AUWYHSTOT (Acronyms are Useless When You Have to Spell Them Out Too)
    3. Re:Severe, and yet not severe. by Frobnicator · · Score: 2

      SSL/TLS communications are just as secure as they always were.

      No, it is not.

      CA model is much more important than the public CA "trust". There is nothing stopping an application designer from using private CAs for their application. This bug breaks the trust to any CAs, including the private ones.

      Let's think about it (as a thought experiment) what is required for this to be an effective attack.

      SSL spoofing is already a common attack. Not just France and the NSA but also regular old password-sniffers. This vulnerability falls under the same class of attack as SSL spoofing; a trusted certificate is secretly replaced by an untrusted certificate.

      There were some common examples right after unicode was allowed in domain names and people came up with similar-looking links for major companies with unicode symbols that look identical to the ascii glyphs. That will be one comparison. The other comparison will be for a government-style ssl spoof attack.

      First, the attacker must redirect you from the legitimate site to their illegitimate site. This is equally difficult with or without the TLS attack. The government-style attack could intercept the traffic over the wire and redirect you to the bad MitM manually. The fake link version could use bad links in phishing emails or spamming the internet with the fake link to the MitM server. Other options include host entries and software secretly installed on the machine. In any event, the bug does not affect this most difficult step.

      Second, they need to appear as a valid connection. For the TLS bug, the attacker must create a false certificate that will test as valid. With the bug being known, that is pretty easy. Then they must use this when the certificate is requested during TLS handshaking. Now contrast this with a traditional attacker who must get their certificate signed by a CA for the fake domain; this is also fairly easy to do in practice. Many fake-name certs have been issued over the years and successfully used in news-reported attacks. Sometimes certificates have been forged in other ways, such as the Flame virus. Similarly the spy agencies have no difficulty getting their fake certificates signed by a CA.

      Finally, the attacker needs to make a connection with the legitimate host. This is the same in all conditions, and has been successfully been used in SSL spoof attacks for years. When there is secondary authentication required the MitM just requests the data from the client. Complex attacks can sometimes permit a second connection directly to the victim where two-factor authentication across servers is required in such a way that the authentication passes. Nothing new here.

      So really, the only thing the bug makes easier is the task of getting a fake certificate. Since this was arguably the EASIEST step in SSL Spoofing to begin with, and because SSL Spoofing is long-established as an easy attack that is difficult for lay people to detect, it means the attack really is a relatively small issue.

      --
      //TODO: Think of witty sig statement
  7. Re:Different Software - Same Problem by Desler · · Score: 2, Informative

    No the issue was with conditionals and braces. The same issue would have happened even if it were two return statements .

  8. Code audits by jones_supa · · Score: 2, Interesting

    I'm not sure if only "many eyes make bugs shallow" is enough, but that also professional, thorough code audits (like OpenBSD does) are needed to produce the most secure open source software. Any comments?

    1. Re:Code audits by Burz · · Score: 2, Interesting

      Seems pretty clear that GnuTLS has too few eyes. Most everything uses OpenSSL instead, and that's where the eyes are concentrated.

  9. So much for Linus's law. by BasilBrush · · Score: 4, Interesting

    "given enough eyeballs, all bugs are shallow"

    Apple had their goto bug in TLS for about 18 months before they spotted it.

    GnuTLS and therefore Linux has had their goto bug in TLS since 2005 (9 years) and it's only been spotted now as a result of the bow wave from Apple's disclosure.

  10. Re:Waiting for Microsoft's "Goto Fail" by cbhacking · · Score: 4, Interesting

    I think it was MS who had a bug in the past where if I got a certificate issues for "google.com\0.attacker.com", I could present that certificate for a request to "google.com" (due to DNS hijacking or a MitM attack) and it would pass validation because the CN was handled as a C-style string and treated the null byte as a terminator. Fixed long ago, but still. People have been messing up cert validation for as long as it's been around.

    The scary thing is how many mobile apps just don't *do* cert validation. Either it's completely disabled, or they crippled it in some way (I've seen both not checking the trust chain and not checking that the cert is valid for the target site). The usual reasons are "oh, we just did that for testing" (but I'm looking at your release version...) or "yeah, one of the servers it connects to uses a self-signed cert" (fine, add explicit trust *for that cert* but don't just disable chain-of-trust checks!) Another common problem is leaving completely broken or outdated options enabled (export ciphers - 40-bit symmetric crypto, easily breakable with a home PC - ot SSLv2 or other such similarly stupid things). Even if your platform/framework/library has a perfectly bug-free TLS implementation, few people ever seem to actually use it correctly.

    --
    There's no place I could be, since I've found Serenity...
  11. Re:First by lister+king+of+smeg · · Score: 3, Insightful

    First, and yet another OSS-releated security risk :(

    At least they are rare enough that it is news worthy. As compared to Windows where new exploits hardly ever get any attention because they are so frilling common as to be passé.

    --
    ---Saying gnome 3 is better than windows 8 not so much a compliment as it is damning with light praise.
  12. Re:Different Software - Same Problem by BasilBrush · · Score: 3, Informative

    No the issue was with conditionals and braces. The same issue would have happened even if it were two return statements .

    And a return statement before the end of a function is essentially a goto. A language that takes the step to rule out gotos should also not allow early returns.

  13. Testing is hard by mveloso · · Score: 4, Interesting

    Testing is hard. The tools you have make it even harder.

    How do you build a bad certificate? Fuck, using the openssl tools is hard enough. Does anyone who uses them really understand WTF is happening? I know I don't - I just follow the instructions.

    How would you go about building a bogus cert? Beats me. I'm pretty sure you can't do it with the standard tools. And who the heck is going to write their own cert building tools?

    And yet, this stuff is at the core of transport security.

  14. Re:AHAHAHAHAH by lister+king+of+smeg · · Score: 5, Interesting

    "Open Source Software is more secure because the code can be reviewed."

    That's why this bug has existed since 2005. gg, guys. Thumbs up.

    What do you mean? The many eyes found said bug that is why we are reading about it if thay had not it would still be sitting there undiscovered. Ever wonder how many bug go completely unnoticed in proprietary software because no one actually reads said code? Like for example a Windows bug affecting all 32 bit Windows OS's for 17 years: http://www.computerworld.com/s....

    --
    ---Saying gnome 3 is better than windows 8 not so much a compliment as it is damning with light praise.
  15. Re:Different Software - Same Problem by Sponge+Bath · · Score: 3, Funny

    Next, you'll be coming for my trigraphs and pointers. My precious.

  16. "Error" is Plausable Deniability by Jeremiah+Cornelius · · Score: 5, Interesting

    Hot on the heels of Apple's SSL/TLS implementation "flaw" across all stacks, and the Snowden revelations of NSA infiltration for weakening crypto?

    You don't have to be wearing Tin Foil, just to become a little suspicious...

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  17. Re:Waiting for Microsoft's "Goto Fail" by Anonymous Coward · · Score: 3, Informative

    It was a bug in multiple implementations of TLS including OpenSSL, NSS, and Microsoft's thing because they didn't expect cert authorities to give out certs with null bytes in the CN field.

  18. Re:Different Software - Same Problem by Waffle+Iron · · Score: 2, Insightful

    Yeah, force people to write a big pile of nested bracket spaghetti and manually back their way out of every case. Make them introduce a bunch of otherwise useless flag variables and extra conditional statements to keep track of it all.

    The best part of it all: When all that extra obfuscation causes bugs, it would be harder to pin the root cause on a simplistic generalization like "goto === bad".

  19. Roll your own by goombah99 · · Score: 3, Funny

    This is why you should always roll your own SSL scripts in php like the guy at Magic the Gathering Online Exchange did.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  20. Re:AHAHAHAHAH by Anonymous Coward · · Score: 2, Insightful

    How is this insightful? The only way this could be insightful is if the OP had said "This bug has existed since 2005, clearly we need greater adoption of open source software, to get more people interested in testing for bugs", because the option is closed software that has bugs no one can look at or fix.

    I already have the the security update to this bug on all my machines, but if I had closed source who know when, if ever, a patch would have come.

  21. Re:Different Software - Same Problem by BasilBrush · · Score: 3, Informative

    Yeah, force people to write a big pile of nested bracket spaghetti...

    1. "nested brackets" (blocks) are by definition not spaghetti. Spaghetti is exclusively the result of gotos and their control equivalents (like the early return).

    2. Nested blocks are refactorable into smaller functions. That's the way to cut them down to size, not to use gotos.

    I mean really! People still trying to argue with structured code in 2014! You'd think it was still the 1980s.

  22. Re:AHAHAHAHAH by bonch · · Score: 5, Informative

    The bug was found due to observed behavior, not due to a code review.

  23. Bug was NOT found due to being open source by Anonymous Coward · · Score: 2, Insightful

    The many eyes found said bug that is why we are reading about it if thay had not it would still be sitting there undiscovered.

    This bug wasn't found from being open source. Those "many eyes" missed this bug for nearly a decade. Security testing tools uncovered incorrect validation behavior in the compiled library, just like they would with a closed source library. The only difference is that the public can see the incorrect code and correct it immediately; that is what you should be citing as an advantage of open source.

  24. Function call overhead by tepples · · Score: 2

    Nested blocks are refactorable into smaller functions.

    And the program eats the function/method/message call overhead, the overhead of passing all local variables as arguments, and the overhead of constructing and destroying an object through which to return multiple values from each function call.

  25. Re:Different Software - Same Problem by lgw · · Score: 2, Insightful

    Wow, have you ever actually written production code? Just wow.

    There's nothing cleaner than
    if (input1 == null) {
            return ERROR("input1 was NULL");
        }
        if (input2 == null) {
            return ERROR("input2 was NULL");
        }
        if (input2 == null) {
            return ERROR("input3 was NULL");
        }

    Substitute "throw new ERROR(..)" or "goto :error" depending on what kind of code your writing, it's the same thing any way you do it.

    Nesting three levels deep before you even start to write real code? Garbage.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  26. Re:AHAHAHAHAH by Rob+Y. · · Score: 4, Insightful

    That may be, but once the behavior was observed, the observer didn't have to find the owner of the code to get it diagnosed. They may have, but the point is that anybody who found this behavior could've gone into the code and found out what caused the problem. Of course, if a black hat happened to be the one that found the bad behavior, they could've gone into the code to figure out how best to exploit it. So, the situation's not perfect, but still, it's probably a good thing that there were lots of eyes allowed to diagnose and fix the problem once it displayed itself.

    --
    Posted from my Android phone. Oh, I can change this? There, that's better...
  27. Freedom is better than dependency. by jbn-o · · Score: 3, Insightful

    So when Apple's proprietary encryption software suffered a problem, Apple users could do nothing but wait for Apple to deliver a fix; there's nobody else that are allowed to fix Apple's proprietary software but Apple. And when that fix ostensibly arrived, Apple users had to hope it wasn't bundled with some malware too (as is often in proprietary software).

    This bug was caught during an audit—"The vulnerability was discovered during an audit of GnuTLS for Red Hat.". Nobody but the proprietor can audit proprietary software. But with free software, users have the freedom to audit the code they run, patch that code, and run their patched code; users can choose to fix bugs themselves or get someone else to fix bugs for them. And users don't have to always trust the same people to do work on their behalf. Users can also choose to wait for a fix to be distributed, and then they can choose to check that fix to make sure it doesn't contain malware. For all we know some users have long spotted and fixed this bug in GNUTLS. Since all complex software has bugs bugs are unavoidable. We're better off depending on people we choose to trust. Software freedom is better for its own sake.

    1. Re:Freedom is better than dependency. by jbn-o · · Score: 2

      Apple may have known about the issue for a while and not talked about it until it could release whatever proprietary blob alleges to be a fix. Apple's users might have known Apple's software was buggy too, but not been able to do anything about fixing Apple's code, since that's the nature of proprietary software. Apple has sat on exploitable security issues before; in that case, governments used that iTunes security hole to invade people's computers (as RMS points out). So in that case, apparently multiple people knew iTunes was a security problem.

      Just because your six year old hasn't been taught the value of software freedom doesn't make software freedom worthless. I'm guessing there are a lot of things a six year old has not yet come to value which they will later learn they should have valued all along. Perhaps teaching your six year old to value substantive issues like ethical understanding of how people treat one another would be a good start. And while I certainly wish anyone with a fix would have shared that fix, they're under no obligation to share in the free software world and I doubt they'll be convinced to by your namecalling. But the situation is still better that anyone could have fixed this (and possibly some did) rather than having no option but hoping the proprietor takes an interest.

  28. Re:Different Software - Same Problem by hermitdev · · Score: 2

    1. "nested brackets" (blocks) are by definition not spaghetti. Spaghetti is exclusively the result of gotos and their control equivalents (like the early return).

    Bullshit. One of the projects at my last job had a single function in C++ that was over 50 printed pages. 5-deep nested loops, not even counting conditionals. On a 1280p resolution monitor, 8pt font, 4 space-tabbing and properly indented code, the start of the deepest nested blocks were 4/5s or more across the screen. A lot of the crap was due to avoiding goto's. That is spaghetti. By using a few judicial goto's, I was able to reduce the code by a third alone. Goto's are not evil. Like any language construct, they can be abused. Just because one famous guy wrote a paper Go To Considered Harmful doesn't make it scripture. You might want to read "Considered Harmful" Essays Considered Harmful. Just because *you* don't understand when to properly use a construct doesn't make the construct evil or wrong.

  29. I propose "Snowden" become a active tense op by IBitOBear · · Score: 2

    Snowden:
    (v) Adding a bit of code, hardware, or operation you know you shoudln't because an authority requires you do so.
    "Hey honey, I'll be late for dinner, I have to snowden the latest release of firefox."

    (n) the sneaky bit of intrusive technology
    "Hey what's this bit?" "Shhh, that's the snowden."

    I know he was the wistleblower, but we should enshrine his deed and the knowledge that this is happening using his name in memoriam.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  30. Re:First by Plumpaquatsch · · Score: 2

    First, and yet another OSS-releated security risk :(

    At least they are rare enough that it is news worthy. As compared to Windows where new exploits hardly ever get any attention because they are so frilling common as to be passé.

    Well, Slashdot seems to report on every vulnerability popping up on my Apple watchlist (often more than once), but not on all popping up on the RedHat watchlist. Draw your own conclusions from what you just said.

    --
    Of course news about a fake are Fake News.
  31. Re:First by Plumpaquatsch · · Score: 2

    First, and yet another OSS-releated security risk :(

    At least they are rare enough that it is news worthy. As compared to Windows where new exploits hardly ever get any attention because they are so frilling common as to be passé.

    Well, Slashdot seems to report on every vulnerability popping up on my Apple watchlist (often more than once), but not on all popping up on the RedHat watchlist. Draw your own conclusions from what you just said.

    Forgot to mention: Apple's TSL-bug was also open source.

    --
    Of course news about a fake are Fake News.
  32. Writing safety-aware code _somewhere_ by IBitOBear · · Score: 2

    Since all machine code is potentially brittle, the argument for using "safety aware languages" is itself brittle. For instance, Ada is safe because it doesn't allow deallocation unless you use ada.unchecked_deallocation(), or in the alternate, build nothing on the heap, or just hope that the Ada implementation has garbage collection, or..., or... etc.

    _Someone_ has to do the work to protect whatever the brittleness is at issue.

    For years I have used "struct Buffer { char * start, char * end};" instead of just char * string. (thing.end-thing.begin) is faster than strlen() and the constraints are always present. I've got a library full of simple bits that make this work (a wrapper around write(2) and read(2) for example).

    Bad code can be written in any language. Java is safe? Well kind of, until you start making circles of referencds and losing them. sounds harmless unles there is a task and open socket in that circular reference and you've left a link back to some structure so that the socket is now able to access some nonsense.

    The best tools in the worst hands are far worse than the worst tools in the best hands. Yelling for tools is a specious argument. Someone has to do the work, and that someone may well bone the job.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press