News for hackers. Stuff that matters.
Re:OpenSSL vulnerable to timing attack? by chomp on Thursday April 10, 2014 @06:41PM (#7570165)
I don't see this function called anywhere in the OpenSSL source, or, for instance, the Apache source code. Could you clarify on this post?

EDIT: I see it exposed in 0.9.8y. Anyone know of anything that builds against this specifically and uses it?

Re:OpenSSL vulnerable to timing attack? by pipeep on Thursday April 10, 2014 @06:48PM (#7570203)
Seeing as it's static, it's not part of the public API. Apparently it was used in Ruby at one point: https://groups.google.com/forum/#!topic/mailing.openssl.dev/...

I think it's probably a piece of dead code at this point, but there might be some legacy stuff using it (with an old version of OpenSSL), which could lead to a vulnerability. Regardless, the function should probably be rewritten or removed.

EDIT: It looks like the latest version of Ruby (MRI) actually copied this function from OpenSSL so they could keep using it: https://github.com/ruby/ruby/blob/1aa54bebaf274bc08e72f9ad38...

Re:OpenSSL vulnerable to timing attack? by pipeep on Thursday April 10, 2014 @07:26PM (#7570342)
I made a patch to ruby swapping the memcmp for CRYPTO_memcmp, which should be constant-time. I'm checking to see that I didn't break the build, after which I'll make a pull request to https://github.com/ruby/ruby. Then it'll be up to the ruby developers, who probably have better insight into this than me, to accept or decline it.

EDIT: For anyone interested: https://github.com/ruby/ruby/pull/591

Re:OpenSSL vulnerable to timing attack? by chomp on Thursday April 10, 2014 @06:53PM (#7570224)
Yeah, I'm thinking it's dead code. It's not exposed in modern OpenSSLs, and I can't find any services we use (Pure-FTP, httpd, etc) that use this function.

OpenSSL devs should probably remove this code.

Re:OpenSSL vulnerable to timing attack? by pipeep on Thursday April 10, 2014 @07:02PM (#7570255)
It looks like there's some github projects using it: https://github.com/search?q=SSL_SESSION_cmp&ref=cmdform&type...
Re:OpenSSL vulnerable to timing attack? by petermalone on Thursday April 10, 2014 @08:13PM (#7570506)
The current version of Android also uses it.
Re:OpenSSL vulnerable to timing attack? by pipeep on Thursday April 10, 2014 @10:27PM (#7570931)
Link?
Re:OpenSSL vulnerable to timing attack? by petermalone on Friday April 11, 2014 @06:29AM (#7572091)
Re:OpenSSL vulnerable to timing attack? by pipeep on Friday April 11, 2014 @09:39AM (#7572739)
It's marked as static and isn't used anywhere there, so it's not an issue: they have an up-to-date version of upstream OpenSSL.
Re:OpenSSL vulnerable to timing attack? by petermalone on Friday April 11, 2014 @06:31PM (#7575981)
Ah - good to know. Cheers!
Re:OpenSSL vulnerable to timing attack? by duskwuff on Thursday April 10, 2014 @06:51PM (#7570215)
Even if it were used, how large is a SSL_SESSION, and does a client have any control over its contents? Not every memcmp() is necessarily vulnerable.
Re:OpenSSL vulnerable to timing attack? by jas203 on Thursday April 10, 2014 @07:31PM (#7570357)
Session IDs themselves are public; namely they may be exchanged in the plain text as part of an initial TLS handshake. They are used for session resumption to look-up confidential (e.g. keying) information that should be stored in a protected manner by the TLS peers.
Re:OpenSSL vulnerable to timing attack? by duskwuff on Thursday April 10, 2014 @08:21PM (#7570536)
Given that the session ID is exchanged in plaintext, I'm definitely not seeing the security risk here. At best, you could potentially use a timing attack to recover the contents of a session ID, but you can already get that by sniffing the network. And in any case, even if you did get that, I don't think there's anything interesting you could do with it.
Re:OpenSSL vulnerable to timing attack? by jas203 on Friday April 11, 2014 @03:31AM (#7571627)
That is my point.
Re:OpenSSL vulnerable to timing attack? by mbell on Thursday April 10, 2014 @07:13PM (#7570286)
> EDIT: I see it exposed in 0.9.8y. Anyone know of anything that builds against this specifically and uses it?

I don't know of anything that builds against that version specifically but it is the version that is included in OS X as of 10.9 (and possibly 10.8).