News for hackers. Stuff that matters.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @04:35PM (#7569522)
There are smart people working in the TLS WG, but there are also people there that shouldn't be governing the development of the Internet's most important encrypted transport.

More importantly, the working group appears to be geared towards saying "yes" to new features, when exactly the opposite posture is needed. The Heartbeat feature is just the most obvious example, because its reference implementation was so slapdash.

The weirder thing here is that it would even be controversial or newsworthy to disable TCP TLS heartbeats, a feature nobody needs or really ever asked for. Why was it enabled by default in the first place? What sense did that decision ever make?

Re:OpenBSD disables Heartbeat in libssl, questions IETF by drewcrawford on Friday April 11, 2014 @12:47AM (#7571263)
I have read all the TLS WG discussions I can find on this RFC. The picture that emerges for me is that of an inherent, institutional failure in the nature of working groups.

As far as I can tell, there was only one person that raised the "we don't need this" objection (Nikos Mavrogiannopoulos, GnuTLS principal author). He asked for a defense of the feature on three occasions [0] [1], and received a response twice, both responses from the same person. There was no further discussion, so either his objection was addressed or he felt further discussion would be unproductive. I would be interested to know which. GnuTLS does ship with heartbeat disabled, so it's possible Nikos continued to express skepticism about the feature.

However this document was eyeballed by many security experts, who I will not name and shame here, who proofread or made comments or edits to the document, without objecting to the general premise.

It seems to me that, inherent in the nature of a working group, the specific parties who are in favor of the feature will always be better represented than the interests of a wider audience that faces the nonspecific harm that the feature might be implemented poorly and introduce a security vulnerability. Sort of a reverse-NIMBY situation if you like. The software community cannot mobilize to combat every new TLS proposal on the grounds of nonspecific harm, but everybody with a pet feature can mobilize to make sure it is standardized.

[0] http://ietf.10.n7.nabble.com/tsv-dir-review-of-draft-ietf-tl...

[1] http://ietf.10.n7.nabble.com/Working-group-last-call-for-dra...

Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Friday April 11, 2014 @10:36AM (#7573068)
Bear in mind, the feature itself isn't insecure. The experts who OK'd the feature failed to police an unstated and controversial norm for the group (that it should default to "no" answers). It's hard to fault people for that. I agree: the problem is the IETF process.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by rubiquity on Thursday April 10, 2014 @05:16PM (#7569777)
> The weirder thing here is that it would even be controversial or newsworthy to disable TCP TLS heartbeats, a feature nobody needs or really ever asked for. Why was it enabled by default in the first place? What sense did that decision ever make?

You're essentially asking the same exact question Theo de Raadt is asking, hence his extreme suspicion of IETF.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @06:19PM (#7570064)
I know, I'm agreeing with him.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by nly on Thursday April 10, 2014 @06:16PM (#7570052)
Presumably people want TLS heartbeats for TCP because, by default, on Linux, TCP keep alive doesn't kick in until the connection has been idle for 2 hours.

Why write a call to setsocketopt() when we can just reinvent new features?

Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @06:25PM (#7570087)
It's worse than that. Keepalives are only really useful for (a) long-lived connections that (b) are expensive (usually: requiring manual intervention or renumbering) to reestablish.

Those parameters describe no connection made by browsers.

In other words: application-layer keepalives are only valuable to applications that already have the freedom to define their own truly application-layer keepalive anyways.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by eternalban on Thursday April 10, 2014 @08:07PM (#7570480)
And that still leaves the question of why spec a payload (much less 64k "for flexibility") in a TCP heartbeat exchange.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @08:19PM (#7570531)
Because it's the same heartbeat message used for DTLS, where the heartbeat and padding allows for variable-length probes with request and response having varying size.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by eternalban on Thursday April 10, 2014 @08:46PM (#7570615)
That is understood, Tom. The question remains why spec the same for two distinct transport layer protocols.

[edit: actually I was under the impression that the payload addressed response order concerns in UDP.]

Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @10:00PM (#7570864)
(It's Thomas). Because it would have made even less sense to define a TLS-specific heartbeat and a DTLS-specific heartbeat.

In the hierarchy of sensible TLS decisions, you have, from most to least reasonable:

1. Not adding new heartbeat extensions to DTLS or TLS.

2. Adding new heartbeat extensions to DTLS only.

3. Adding the same new heartbeat extensions to DTLS and TLS.

4. Adding two different new heartbeat extensions, one for DTLS and the other TLS.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by tinco on Friday April 11, 2014 @07:19AM (#7572229)
Not that I'm disagreeing with you, but aren't SSL connections rather expensive to establish because of the public key encrypted key exchange? Ofcourse anno 2014 that doesn't matter, but the whole library seems a bit engineered for 1998 when establishing SSL was probably a pretty significant thing.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by chalst on Friday April 11, 2014 @08:39AM (#7572494)
They should be regarded as expensive today, because key exchange is one of distinct parts of the attack surface of an SSL implementation. The less often this exchange is visible to eavesdroppers, the better.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Friday April 11, 2014 @01:20PM (#7574198)
Repeated TLS reconnections do not necessarily invoke the entire key exchange.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tinco on Friday April 11, 2014 @10:23AM (#7572986)
.. I don't think that's a very realistic concern, is it?
Re:OpenBSD disables Heartbeat in libssl, questions IETF by general_failure on Thursday April 10, 2014 @08:04PM (#7570474)
Aren't websockets ping/pong messages similar?
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @08:20PM (#7570533)
Websockets messages are happening two layers up from TLS.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by midas007 on Friday April 11, 2014 @12:47AM (#7571261)
IOW: totally worthless.

The penalty for security fails of useless features should be a slow, painful, humiliating death.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by mschuster91 on Thursday April 10, 2014 @06:37PM (#7570147)
You still need them for UDP.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by ecma on Thursday April 10, 2014 @05:44PM (#7569921)
Would you please link to this supposedly slapdash reference implementation? Taking RFC6520 at face value, it seems fairly reasonable and not out of line with other existing heartbeat protocols.

I've not read as much as I would like on the IETF's involvement in this but as I read the situation, Theo has just hurled vitriol at them for specifying a completely reasonable feature that the openSSL team implemented incredibly poorly.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @06:18PM (#7570063)
It's not a completely reasonable feature.

It's a feature that had a sensible use case in DTLS (datagram TLS, TLS not run over TCP). It's unclear as to whether the use case was best addressed at the TLS layer, whether it could have been specified as something run alongside TLS, or whether it was something that applications that cared about path MTU could have handled for themselves.

The TLS WG actively discussed whether Heartbeat had reasonable use cases in TCP TLS. Some people agreed, some disagreed. Nobody threatened a temper tantrum if the feature was added to TCP TLS. Therefore: the extension was specified for both TCP TLS --- which does not need extra path MTU discovery, and which already has a (somewhat crappy) keepalive feature --- and DTLS.

The larger problem is in treating TLS like a grab-bag of features for corner-case applications.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by ecma on Friday April 11, 2014 @04:22AM (#7571759)
Okay, I definitely agree regarding crufty specs. The decision to include heartbeats could easily have left left it as a variant feature rather than core spec.

I still don't agree with the OpenSSL implementation being reference spec if you were refering to that as pygy_ pointed out. Unless the IETF released that code as an institution, I would consider it the same as any other 3rd party implementation - ie. not necessarily correct. How am I to know that the RFCs author wrote it unless I go digging? Why should I trust anything they wrote which may or may not have gone through any rigorous checking?

This isn't so much directed at you, tptacek (since your pedigree is well known), as it is the others bashing the IETF for implementation flaws - bash them for what they actually did and perhaps instead of getting angsty at the powers that be, try getting involved in projects like this if you believe they are so important.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by midas007 on Friday April 11, 2014 @03:58PM (#7575208)
Last line, can we make that 72 pt font and top of the page?

(HN feature request: soundbits.)

This whole approach to diluting ostensibly one of the most important standards is beyond unprofessional, it's an example of failures on many layers of meta.

I would really like to see a compelling alternative to keep TLS honest, perhaps with Convergence-like ideas and bare-bones level of features.

The problem is always adoption, corporate fear of change ($upportabi£it¥) and endpoint adoption, but the threat of an alternative might be enough to scare the bejebus of the WG back to task.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by pygy_ on Thursday April 10, 2014 @06:00PM (#7569994)
The reference implementation is the code that ended up in OpenSSL.

It was actully included in OpenSSL before the RFC was published.

Both the RFC and the code were written by the same person (who denies planting the bug intentionally).

Re:OpenBSD disables Heartbeat in libssl, questions IETF by ecma on Friday April 11, 2014 @04:11AM (#7571725)
Was that code ever actually sanctioned by the IETF and included in their resources though? SSL had SSLREF but I've never seen (and didn't find anything just now) a similar thing for TLS.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by gpvos on Thursday April 10, 2014 @06:24PM (#7570082)
I won't judge whether the heartbeat feature itself is reasonable or not. But the inclusion of a payload was unnecessary, and specifying that it has to be copied to the reply message is so useless as to defy description. "Flexibility" my ass. It's downright suspicious.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by Jare on Thursday April 10, 2014 @06:34PM (#7570131)
The payload is meant to let you distinguish responses to different Heartbeats, right? I'm no expert, but sounds reasonable enough. I could see a lower limit on max payload size, but could you please elaborate a more detailed explanation why it's unnecessary and useless?
Re:OpenBSD disables Heartbeat in libssl, questions IETF by gpvos on Friday April 11, 2014 @05:02AM (#7571877)
Okay, that explains things a bit. Could be done with a fixed-size payload though. Also I understand that the flexible size is intended to help with MTU discovery, but I think that would be a separate thing from a heartbeat.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by kevingadd on Thursday April 10, 2014 @07:24PM (#7570333)
Why would you need to send multiple different heartbeats over one connection? It's for keeping the connection alive.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by pwg on Thursday April 10, 2014 @09:16PM (#7570713)
If you are using data-grams (i.e., UDP) you have no guarantees of ordering or delivery, so you have no way to determine which transmission the echo reply you just received corresponds to without a payload that is returned to you.

Now, a 64kbyte payload, that's unnecessary for simply making each packet unique. That size was likely chosen to allow for the path MTU discovery aspects.

One could argue, however, that "keepalive" and "path MTU discovery" should not have been commingled, but they were.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by click170 on Thursday April 10, 2014 @08:42PM (#7570602)
Ping manages the same thing by incrementing an integer. For example.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @11:48PM (#7571130)
No, ICMP echo request packets have variable-length payloads, which the receiver copies into the echo response.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by 0x0 on Thursday April 10, 2014 @06:27PM (#7570097)
Not much more suspicious than ping(8)
Re:OpenBSD disables Heartbeat in libssl, questions IETF by kevingadd on Thursday April 10, 2014 @07:25PM (#7570338)
I always assumed ping's payload was for detecting packet fragmentation/size limit issues and as a trivial mechanism for spotting things like packet corruption.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by minopret on Friday April 11, 2014 @06:33AM (#7572108)
Is it that debate (even as devil's advocate) is structurally limited when participants self-select for willingness to act?

That dynamic reminds me of the bias labeled "sympathetic point of view" as described in the essay "Why Wikipedia is not so great": "Articles tend to be whatever-centric. People point out whatever is exceptional about their home province, tiny town or bizarre hobby, without noting frankly that their home province is completely unremarkable, their tiny town is not really all that special or that their bizarre hobby is, in fact, bizarre. In other words, articles tend to a sympathetic point of view on all obscure topics or places."

That is surely not how we want decisions made about TLS.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by midas007 on Friday April 11, 2014 @12:39AM (#7571240)
TLS is the zombie emperor of design-by-committee feature creep.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by x0x0 on Thursday April 10, 2014 @05:25PM (#7569839)
so -- would it be reasonable to create a minimal implementation of ssl focused on web browsers and web servers? How much work is it to create such a minimal implementation that is reasonably performant, written by competent devs, well tested, fuzzed, etc? Just because random shit gets thrown into the protocol that doesn't mean it needs to be implemented in my copy of chrome or nginx...
Re:OpenBSD disables Heartbeat in libssl, questions IETF by antocv on Thursday April 10, 2014 @06:47PM (#7570198)
Just go read polarssl docs and fuzz that.

Its small modular documented and tested.

We would all reach further by improving polarssl than starting another library.

Re:OpenBSD disables Heartbeat in libssl, questions IETF by x0x0 on Thursday April 10, 2014 @06:58PM (#7570242)
unfortunately it's licensed gpl2, so no love. which is too bad because I agree.

https://github.com/polarssl/polarssl/blob/master/library/ssl...

Re:OpenBSD disables Heartbeat in libssl, questions IETF by throwaway7767 on Friday April 11, 2014 @10:50AM (#7573157)
It's actually GPL-2+, but yes, this unfortunately limits the scope of outside contributors.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by dangayle on Thursday April 10, 2014 @07:54PM (#7570439)
Hmm. Why does it say Dual-Licensed in the description?
Re:OpenBSD disables Heartbeat in libssl, questions IETF by tptacek on Thursday April 10, 2014 @08:00PM (#7570457)
Because you can also pay them for a commercial license.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by antocv on Friday April 11, 2014 @06:03AM (#7572043)
What is wrong with gpl v2?
Re:OpenBSD disables Heartbeat in libssl, questions IETF by mwcampbell on Thursday April 10, 2014 @05:47PM (#7569931)
OpenSSL itself is highly configurable, so I think it would be better to pare it down to a minimal build that is both secure and compatible with all widely deployed TLS implementations.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by midas007 on Friday April 11, 2014 @12:51AM (#7571271)
I do this already on OSX, and even submitted a patch to allow Ruby to run without OpenSSL engine support. [0]

How I compile OpenSSL. [1]

[0] https://bugs.ruby-lang.org/issues/9714

[1]

    ( export CONFIGURE_OPTS='no-hw no-rdrand no-sctp no-md4 no-mdc2 no-rc4 no-fips no-engine' \
      brew install https://gist.github.com/steakknife/8228264/raw/openssl.rb )
Re:OpenBSD disables Heartbeat in libssl, questions IETF by mwcampbell on Friday April 11, 2014 @11:14AM (#7573327)
That looks like a good start, but can we drop even more? DES? Camellia? IDEA? MD5?
Re:OpenBSD disables Heartbeat in libssl, questions IETF by midas007 on Friday April 11, 2014 @02:22PM (#7574541)
Good start my ass, you haven't actually tried any of your "suggestions," have you?

no-md5 doesn't currently work:

    "_EVP_md5", referenced from ...

no-des doesn't currently work either, the following test fails the build:

    enveloped content test streaming S/MIME format, 3 recipients: generation error
Re:OpenBSD disables Heartbeat in libssl, questions IETF by x0x0 on Thursday April 10, 2014 @05:52PM (#7569959)
ime, it's much harder to write, understand, test, and debug #include soup
Re:OpenBSD disables Heartbeat in libssl, questions IETF by midas007 on Friday April 11, 2014 @12:55AM (#7571287)
Not really. There are only a handful of features that are necessary. Furthermore, JEOS-like minimal systems should only enable features that are absolutely necessary. Minimalism means a smaller attack surface.
Re:OpenBSD disables Heartbeat in libssl, questions IETF by jlgaddis on Thursday April 10, 2014 @09:38PM (#7570786)
It's certainly not without its problems (see, e.g. news in the last few weeks) but GnuTLS is (in my opinion, of course) technically superior to OpenSSL. Unfortunately, its license will prevent more widespread adoption.