Slashdot Mirror


Apple SSL Bug In iOS Also Affects OS X

Trailrunner7 writes "The certificate-validation vulnerability that Apple patched in iOS yesterday also affects Mac OS X up to 10.9.1, the current version. Several security researchers analyzed the patch and looked at the code in question in OS X and found that the same error exists there as in iOS. Researcher Adam Langley did an analysis of the vulnerable code in OS X and said that the issue lies in the way that the code handles a pair of failures in a row. The bug affects the signature verification process in such a way that a server could send a valid certificate chain to the client and not have to sign the handshake at all, Langley found. Some users are reporting that Apple is rolling out a patch for his vulnerability in OS X, but it has not shown up for all users as yet. Langley has published a test site that will show OS X users whether their machines are vulnerable."

19 of 140 comments (clear)

  1. Hmm... by 93+Escort+Wagon · · Score: 3, Funny

    The researcher who found the bug is Adam Langley. CIA headquarters is in Langley, Virginia.

    Coincidence? I think not!

    --
    #DeleteChrome
  2. Lets see how far back... by Anonymous Coward · · Score: 2, Insightful

    Let see how far back Apple will patch this thing, if they leave Snow Leopard (10.6) out for the wolves or not.

    In the past under Jobs, only the last two OS X versions got security updates. He was a real prick about trying to force people to upgrade to their latest bloated your machine so you have to buy a new one prematurely crap.

    1. Re:Lets see how far back... by ugen · · Score: 4, Insightful

      Snow Leopard (10.6) is not vulnerable to this bug, since Apple did not switch from OpenSSL to their own SSL/TLS library back then yet. Just verified on my 10.6 box (to verify visit https://www.imperialviolet.org:1266/ )

      On the other hand, iOS 6.1.5 is - and now I have a choice of using insecure iPhone or upgrading to 7.x. For now I've switched from Safari to a 3rd party browser that does not have this bug - but email is still vulnerable and so can be other components. That said, I have little trust in SSL even when it works as designed, so I won't lose much sleep over this.

    2. Re:Lets see how far back... by dgatwood · · Score: 2, Interesting

      Snow Leopard (10.6) is not vulnerable to this bug, since Apple did not switch from OpenSSL to their own SSL/TLS library back then yet.

      No, that's not correct at all. First, it doesn't affect 10.8.5, either, which blows that theory. Second, Secure Transport was introduced way back in 10.2, and has been used for Foundation and Core Foundation SSL negotiation since at least 10.4, according to various security vulnerability reports (and probably earlier). In other words, this has absolutely nothing to do with Apple "switching" anything. It's just a bug, and a fairly recent bug at that.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    3. Re:Lets see how far back... by ugen · · Score: 2

      iOS 6.1.6 is not available for iPhone 5. It is only available for devices for which there is no iOS 7, unfortunately. First thing I checked.

    4. Re:Lets see how far back... by ugen · · Score: 2

      It is correct and, if you have 10.6 handy - you can verify that under that system Safari is using OpenSSL. To do so, simply move /usr/lib/libssl.*.dylib elsewhere and try to run Safari. It will fail due to missing libraries.
      On 10.9 Safari will happily run with OpenSSL libraries removed.

      You are welcome to dig through otool -L output to find how it's linked up, but the fact remains - Safari was switched over from OpenSSL to homegrown crypto sometime after 10.6.

    5. Re:Lets see how far back... by PNutts · · Score: 2

      Not on all devices. AC posted this so it got lost in the filters: If you are able to upgrade to iOS 7, you are not able to upgrade to 6.1.6.

  3. Informative discussion thread by MisterSquid · · Score: 5, Informative
    Over at MetaFilter, there's a pretty informative thread calling out these parts among others.
    • iOS 6 users with iOS 7-capable devices will be given the latest iOS 7.
    • iOS 6 users without iOS 7-capable devices will be given the latest iOS 6
    • Mac OS X users pre-Mavericks (10.9) are OK.
    • Mac OS X Mavericks users should avoid using Safari.
    • You can visit this link to see if your device/browser is affected.
    --
    blog
  4. NSA by Qwerpafw · · Score: 4, Interesting

    Some bloggers and commentators online (no mainstream media news sites... yet) have suggested that this bug was introduced by the NSA based on the fact that Snowden's leaked slides showed evidence that the NSA had developed and was working on further ways of targeting and compromising secured iOS traffic.

    We know the NSA compromised RSA through Dual EC_DRBG. It's not hard to imagine they wanted to compromise SSL/TLS on Apple platforms.

    The bug was found via internal code review according to the credits for discovery, which means nobody else has disclosed they knew about this in the wild (so this is an exposed zero day crypto exploit on both OS X and iOS platforms).

    This link is informative - the kicker is he properly indented but obviously duplicated and incorrect "goto fail;"

    https://www.imperialviolet.org...

    static OSStatus
    SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
                                                                      uint8_t *signature, UInt16 signatureLen)
    {
            OSStatus err; ...

            if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
                    goto fail;
            if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
                    goto fail;
                    goto fail;
            if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
                    goto fail; ...

    fail:
            SSLFreeBuffer(&signedHashes);
            SSLFreeBuffer(&hashCtx);
            return err;
    }

    Maybe this came out due to bad coding practices, but the kind of bug where the code visually looks ok on the surface, compiles and passes without compiler warnings, and works fine aside from allow the comprise is very suspect.

    And at the minimum the NSA has been exploiting this rather than alerting people. Our government needs to stop weakening computer security and go back to working for the people, not against them.

    1. Re:NSA by 93+Escort+Wagon · · Score: 5, Insightful

      This is a fundamental problem all the traitorous NSA behavior has created - every time something like this comes up, we're going to wonder if THEY are behind it. Problem is, that way lies madness... we can never really know.

      1) It could very well be an innocent coding error. Heck, I could see myself doing this one with the slip of the fingers in BBEdit. I probably HAVE done it at some point in time.

      2) It could be an intentional bug slipped in by someone on NSA's payroll.

      3) Or, it could be even more nefarious. Perhaps NSA has known about this, but thought the use case was too restricting. So they kept quiet until they were able to slip a more broadly exploitable hole in the development code (or, alternatively, something the compiler can slip into your output). Then, to force everyone to update, they reveal this older bug. We all update, and BAM! They've got us.

      We can't really know, anymore.

      --
      #DeleteChrome
    2. Re:NSA by Your.Master · · Score: 3, Interesting

      This bug looks like the sort of bugs that can come from merging between different code branches in very large codebases. A duplicated line, or a missing line, is a common merge-conflict resolution, *especially* where essentially the same code was added in both branches and then merged together. As an example, if this was a refactor of an existing function that was made similarly in two branches, but a little extra trailing whitespace was clipped in only one branch, then you could get a duplicate line out of an automerge operation.

  5. This is a C Standard Bug by Harry8 · · Score: 4, Informative

    C and C++ still haven't fixed this egregarious bug in the standard. There is no reason for single line, un-braced blocks. People use them to show off how "cool" they are that they don't need to brace because it's only one line. It makes for difficult to spot bugs like this. We need to actually yell at the people on the standards committees to FIX THE BUGS in the standard. There are other really obvious ones and they all should be fixed before adding more new features. YES I'M LOOKING AT YOU C++14! There are plenty of ways you can make a new standard still work alongside code from an old one (compile old, broke, brittle, stupid code with a compiler flag indicating the old standard and new, beter files (yes "translation units c++") with the new one. Introduce a #THIS_FILE_IS_STUPID pragma to disable sanity on old code compiled with the new standard and plenty of others. Pick one, bless, it, implement it and FIX THIS CRAP http://opensource.apple.com/so... The 35th and 36th incidences of the words "goto fail;" in that file are the problem, not easy to spot until you look really closely and it's a bug that a sane standard would make impossible. FIX IT!!

    1. Re:This is a C Standard Bug by angel'o'sphere · · Score: 2

      I never saw a bug related to braces, this bug neither is.
      If at all the bug is (difficult to spot) because of a wrong indentation.
      Bottom line the bug is absolutely obvious. You read the code from top to bottom and you see the bug, or you don't has nothing to do with braces or indentation.
      It is the old C versus Python argument. The argument makes no sense. Either you can read the code and comprehend it or you cant.
      No compiler, bracing or anything else can prevent it.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:This is a C Standard Bug by wiredlogic · · Score: 2

      Lint tools can catch this sort of unconditional goto which one would hope is never used intentionally by goto afficionados.

      --
      I am becoming gerund, destroyer of verbs.
    3. Re:This is a C Standard Bug by ChunderDownunder · · Score: 2

      You may claim the bug is obvious and yet it slipped through to production. So rather than bring up the blame-log on the indvidual developer - programmers make mistakes and enforcing coding standards such as indentation or braces help in identifying errors where errant coders fail.

      If indeed Apple does have a coding standard, then this one slipped through. Using an IDE to pretty-print the code according to the coding standard, prior to checkin, would have revealed the inconsistency of indentation in the duplicated line. Of course performing a visual diff on the previous revision would likewise have exposed the flaw.

    4. Re:This is a C Standard Bug by angel'o'sphere · · Score: 2

      I would say the main problem with this style of coding is the use of gotos.

      Well, most programmers laugh at me and call me unproductive when I spend roughly an hour every morning to visually check every change comming from the version control system. Meanwhile however most organizations use tools like fisheye and do a planned review on the changes.

      I don't know if demanding more braces help. I think in this particular code every condition in the ifs should be refactored into a function returning a boolean. Then you write one single if and use and's to formulate the correct condition, so you have exactly one if and one else branch.

      Chaining the conditions like this, is just braindead, the compiler can do that better for you.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  6. Re:Apple by Anonymous Coward · · Score: 4, Funny

    I bet your mom gives out root access to the world.

  7. Re:Considering Apple admitted.... by davester666 · · Score: 2

    No, it was a stupid coding standards error

    if (x)
              goto error;
              goto error;
    if (y)
              goto error;

    error:
    return

    if the coding standards required braces around the code block like this

    if (x)
    {
            goto error;
            goto error;
    }

    it would have eliminated the effects of this coding error

    --
    Sleep your way to a whiter smile...date a dentist!
  8. Re:How does this work? by Anonymous Coward · · Score: 2, Insightful

    No.
    Just access:
    http://opensource.apple.com/so...

    So I guess that it can have been exploited for some time.