Re: [hybi] WebSocket, TLS and intermediaries

Maciej Stachowiak <mjs@apple.com> Wed, 21 July 2010 00:00 UTC

Return-Path: <mjs@apple.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 9D19D3A67FA for <hybi@core3.amsl.com>; Tue, 20 Jul 2010 17:00:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.598
X-Spam-Level:
X-Spam-Status: No, score=-106.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8erfBNC1BtTv for <hybi@core3.amsl.com>; Tue, 20 Jul 2010 17:00:48 -0700 (PDT)
Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by core3.amsl.com (Postfix) with ESMTP id 7F5583A65A5 for <hybi@ietf.org>; Tue, 20 Jul 2010 17:00:48 -0700 (PDT)
Received: from relay14.apple.com (relay14.apple.com [17.128.113.52]) by mail-out3.apple.com (Postfix) with ESMTP id 78B189EA877B for <hybi@ietf.org>; Tue, 20 Jul 2010 17:01:04 -0700 (PDT)
X-AuditID: 11807134-b7b53ae000005755-a5-4c4638bea128
Received: from et.apple.com (et.apple.com [17.151.62.12]) by relay14.apple.com (Apple SCV relay) with SMTP id B6.8E.22357.EB8364C4; Tue, 20 Jul 2010 17:01:02 -0700 (PDT)
MIME-version: 1.0
Content-type: multipart/alternative; boundary="Boundary_(ID_gl2HeSIjJYnWzCELGXHPVQ)"
Received: from [17.151.78.226] by et.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0L5V00JCSS1QYA20@et.apple.com> for hybi@ietf.org; Tue, 20 Jul 2010 17:01:02 -0700 (PDT)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <AANLkTinihlL2sn3Kiwtcl7QYKhFlvmj9lvmH4_z02xF7@mail.gmail.com>
Date: Tue, 20 Jul 2010 17:01:02 -0700
Message-id: <FC1F510E-6D48-4D75-A356-F455C9FD5BD8@apple.com>
References: <h2w5c902b9e1004152345j992b815bz5f8d38f06a19181a@mail.gmail.com> <Pine.LNX.4.64.1004160701250.751@ps20323.dreamhostps.com> <4BC860FD.8080007@webtide.com> <Pine.LNX.4.64.1004161952530.751@ps20323.dreamhostps.com> <35EFEA5E-9017-48A1-BB66-A0AF947E159F@d2dx.com> <AANLkTinihlL2sn3Kiwtcl7QYKhFlvmj9lvmH4_z02xF7@mail.gmail.com>
To: Mike Belshe <mike@belshe.com>
X-Mailer: Apple Mail (2.1081)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] WebSocket, TLS and intermediaries
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Jul 2010 00:00:49 -0000

On Jul 20, 2010, at 4:29 PM, Mike Belshe wrote:

> 
> 3. Error checking
> A properly written intermediary is also expertly written. So it would be able to prevent protocol exploits that may appear. In addition, these types of intermediaries would be maintained for the purpose of security and thus updated faster than you could hypothetically update client(s) and server(s). While it doesn't eliminate the spread of exploits and malware, it can reduce it. If we are supposed to be as concerned as we are about security, we should also cover the possibility that there may be a security hole in the future (one that we couldn't consider now) and make sure it can be protected. An intermediary can be a part of such a solution, but that also implies we must have intermediaries that can talk WebSockets.
> 
> Let me try to be objective about the tradeoff here:  When everything is encrypted and authenticated at the endpoints, it prevents an intermediary (who's motivations may be different than yours) from taking action.  When data is not encrypted & authenticated, intermediaries, which have different motivations (good or bad) are possible.
> 
> So the sad news is that for every good motivation, there is an equal and opposite bad motivation as a counter argument...

Also, in practice it does not seem to be the case that intermediaries are updated faster than clients or servers. One of the challenges to deploying new protocols or protocol features is old intermediaries that are not updated.

> 
> Actually, if you do that, the browser throws up a huge red box saying "danger".  The MITM will not have a signing cert for a CA trusted by the browser.  So, the cert will be signed by the ISP or other transparent intermediary, which won't match the trusted CA list, and the browser will complain.  Corporations can get around this by forcing a CA cert onto the browser; but that is no longer a transparent intermediary - it was specifically granted permission at the endpoint.  Of course, the user, not knowing what the hell is going on, will click through anyway, think "that's weird", and everything else will still work.

Browsers don't have to accept broken certs for WebSocket with a clickthrough the way many still do for Web sites. I would argue that they should not, because the security consequences of the decision cannot possibly be understood by the typical user.

> 
> BTW - there is another data point here; deployment of WebSockets over port 80 was measured in Chrome to have ~67% success rate today.  Deployment over port 443 (with TLS) has a >95% success rate.  So, if you don't use TLS, then browsers and websites will need to be made more complex to deal with the edge case of WebSockets failing in weird ways due to existing intermediaries which fail, even after the WebSocket handshake.

This point is very important. Building on top of TLS has huge practical benefits. I think this outweighs the desire to more easily build transparent intermediaries. Any mechanism that allows intermediaries without being authorized by either endpoint is by definition a security vulnerability in the protocol.

I think the benefits of TLS also outweigh the "amateur server implementor" argument. I don't think we want to make it easy to implement a security hole.

Regards,
Maciej