Live data from Hacker News

Apple's SSL/TLS bug

imperialviolet.org

111–120 of 295 posts

Re: Apple's SSL/TLS bug

#111

Earlier quoted context omitted.

A quick test shows neither -Wall nor -Wextra report anything on either gcc or clang. However, clang's -Weverything does complain (it implies -Wunreachable-code). Confusingly, gcc accepts -Wunreachable-code as a valid option, but then proceeds not to warn anything. (edit): Which is a known bug apparently, http://gcc.gnu.org/ml/gcc-help/2011-05/msg00360.html

The real WTF is those Warn flags, then. In what sane world does "extra" mean more than "all", and "all" and "everything" mean different things?

"-Wall" actually means, "all warnings, as of the date we froze the definition of -Wall, which for all you know was 20 years ago, good luck."

Re: Apple's SSL/TLS bug

#112

I just made this - it'll tell you if you're vulnerable. https://gotofail.com/ Not very well tested, please let me know if it works for you. If you're on OS X Mavericks or on iOS 7 and haven't patched you should get big scary red text. Edit: posted here https://news.ycombinator.com/item?id=7282164

Safari on 10.8.5 is not vulnerable. Way to go, slow corporate adoption schedule!

Re: Apple's SSL/TLS bug

#113
post #95

Earlier quoted context omitted.

I would probably flag the code above in a security review because it hides the key part at the end of a complex line. Unless you're coding on VT100 terminal it's worth the extra line to make the test logic incredibly obvious: err = SSLHashSHA1.update(&hashCtx, &serverRandom); if (err != nil) { return err; }

In actual code things would not be named as they were above and it would be shorter, I was just trying to make it look reasonably like the C for HN.

True, but I've definitely noticed that particular style of writing if tests using a one-line assignment and obscured test condition seems to be pretty common in the Go community and it's a bad habit for understanding code.

Re: Apple's SSL/TLS bug

#114

Earlier quoted context omitted.

Apple introduced -Weverything because suddenly changing the scope of gcc's -Wall (which indeed does not include everything) would break a lot of builds.

Is "-Weverything" inclusive of new warnings? Because they're just kicking the can if not. What's next, "-Wreallyeverything"?

Yep. Even ones that may not be fully baked, so some people caution against it.

We have it turned on, and about 10 warnings specifically disabled because they were too noisy or not useful for us. It's always interesting upgrading Xcode and seeing what new warnings we get to fix.

Re: Apple's SSL/TLS bug

#115
post #82

This could not have happened with C++ exceptions and RAII instead of manual error checking and goto for cleanup ;)

Any language that lets you omit braces for single statements is prone to this bug, which includes C++.

Well it was mostly a tongue-in-cheek comment (was thinking of yesterday's C++ exception topic), but essentially true as you would not have used the "if + goto" with C++ error handling. Of course you can write the same bug (and more) in C++ too.

Re: Apple's SSL/TLS bug

#116
post #104

Earlier quoted context omitted.

Linux is only secure if you secure it.

Sure, but at least you have a say there.

If you need to say something to make it secure then wouldn't it also be compromised by default?

Security is not a Boolean. A better question is, which OS is more secure OOTB for a given user.

Re: Apple's SSL/TLS bug

#117
post #96

Earlier quoted context omitted.

MITM of any SSL connection in Safari and other system apps, and they couldn't even bother to have an OS X patch ready at the same time as the disclosure for iOS? I think anyone relying on the security of OS X is going to have to seriously rethink their OS choice after this.

Indeed the only secure OS nowadays is Linux. Everything else should be considered compromised by default a priori.

> Indeed the only secure OS nowadays is Linux

Tell that to the people who generated keys on Debian.

Programmers are simply not good enough at writing secure code. Full stop. If you say anything else, you're just flaunting your own unreliability as a source of security advice.

Re: Apple's SSL/TLS bug

#118
post #96

Earlier quoted context omitted.

MITM of any SSL connection in Safari and other system apps, and they couldn't even bother to have an OS X patch ready at the same time as the disclosure for iOS? I think anyone relying on the security of OS X is going to have to seriously rethink their OS choice after this.

Indeed the only secure OS nowadays is Linux. Everything else should be considered compromised by default a priori.

Don't get too comfortable with linux --- Debian had its own openssl patch fiasco with consequences that were similarly nasty.

http://research.swtch.com/openssl

Re: Apple's SSL/TLS bug

#119

Earlier quoted context omitted.

I don't see the possibility for catching the wrong type (or not catching it) if you get one character wrong. Unless of course you have two valid type names that just differ in one character, but that is a general pitfall and not exception specific. If you always throw by value (and not by pointer) then it does not matter if you catch by value or by reference, the catch block will be activated either way. The only iss…

Ok for example: int e; int update() { throw &e; } the & is the one character - it's a typo - only catch(...) will catch it.

Well, since you're throwing an int-pointer then catch(int*) should also catch it quite happily.

I guess you mean there will only be a catch(int) in addition to catch(...) so in that aspect you're right of course.

Still, I would think taking the address of something you throw should ring quite a few warning bells as opposed to merely a missing ref (&) in the catch handler. Similarly to "return &e" which would also be suspicious and require an extra look or two.

Re: Apple's SSL/TLS bug

#120
post #92

Does anybody know the .dylib or binary file where this function resides on OSX? I can't find libsecurity_ssl on my system. It should relatively simple to NOP out the 2nd goto, if the rest of the function hasn't been optimised away.

The static function that has the bug will most likely be inlined into the other static function which will then be inlined into the outer public symbol that calls it.

I believe you can dump the assembly of the entire function like this:

    otool -t -p _SSLProcessServerKeyExchange \
        -V /System/Library/Frameworks/Security.framework/Versions/A/Security | less
edit: I believe this could be the offending instruction:

    0000000000086df6        jmp     0x86e0d
edit2: That is actually in SSLVerifySignedServerKeyExchangeTls12(). Trying to track down the real one..

edit3: Looks like the compiler did optimize it out if I'm reading it correctly now. The code is around 0x86c97. It does the last if() call and then immediately calls SSLFreeBuffer() and jumps to the end. :(

Post reply on HN