Re: [hybi] Extensibility mechanisms?

Adam Barth <ietf@adambarth.com> Thu, 22 July 2010 06:21 UTC

Return-Path: <ietf@adambarth.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 DE3033A6834 for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 23:21:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.384
X-Spam-Level:
X-Spam-Status: No, score=-1.384 tagged_above=-999 required=5 tests=[AWL=-0.007, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, J_CHICKENPOX_33=0.6]
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 dO4ELM4qg7sn for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 23:21:52 -0700 (PDT)
Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by core3.amsl.com (Postfix) with ESMTP id 837363A67E5 for <hybi@ietf.org>; Wed, 21 Jul 2010 23:21:52 -0700 (PDT)
Received: by iwn38 with SMTP id 38so8320997iwn.31 for <hybi@ietf.org>; Wed, 21 Jul 2010 23:22:09 -0700 (PDT)
Received: by 10.231.39.134 with SMTP id g6mr1335908ibe.151.1279779728818; Wed, 21 Jul 2010 23:22:08 -0700 (PDT)
Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by mx.google.com with ESMTPS id h8sm29578741ibk.9.2010.07.21.23.22.07 (version=SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 23:22:07 -0700 (PDT)
Received: by iwn38 with SMTP id 38so8320974iwn.31 for <hybi@ietf.org>; Wed, 21 Jul 2010 23:22:07 -0700 (PDT)
Received: by 10.231.37.75 with SMTP id w11mr1108662ibd.45.1279779726978; Wed, 21 Jul 2010 23:22:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.143.145 with HTTP; Wed, 21 Jul 2010 23:21:46 -0700 (PDT)
In-Reply-To: <AANLkTiku9LqTLrnXQEiPIZtqOZzTViYAmyR-QGqGIpRd@mail.gmail.com>
References: <h2w5c902b9e1004152345j992b815bz5f8d38f06a19181a@mail.gmail.com> <4BCAB2C1.2000404@webtide.com> <B9DC25B0-CD21-44E7-BD9B-06D0C9440933@apple.com> <4BCB7829.9010204@caucho.com> <Pine.LNX.4.64.1004182349240.751@ps20323.dreamhostps.com> <4BCC0A07.9030003@gmx.de> <Pine.LNX.4.64.1004190753510.23507@ps20323.dreamhostps.com> <4BCC111C.90707@gmx.de> <Pine.LNX.4.64.1004190837570.23507@ps20323.dreamhostps.com> <4BCC204D.30004@gmx.de> <z2gad99d8ce1004190822ne4dd36b6v54d63efcc448e840@mail.gmail.com> <Pine.LNX.4.64.1007202204270.7242@ps20323.dreamhostps.com> <AANLkTikkfdlUxQ0MGNvVQKa5gfovkGHWdCgyN9juKSQJ@mail.gmail.com> <4C462F9E.9030207@caucho.com> <Pine.LNX.4.64.1007212153110.7242@ps20323.dreamhostps.com> <AANLkTiku76oSucTNDFdwgsFBNFa_cCpC-YktTnMfX47-@mail.gmail.com> <4C479130.4020500@caucho.com> <AANLkTikLDjBP-Xs5t6TxmJuq4nG8jwThQ=n34B4cEmup@mail.gmail.com> <4C479CE4.6070805@caucho.com> <AANLkTims1er0Rbv0ysP4gRs1Kd0He8hapHeJ3nON=JQa@mail.gmail.com> <4C47C5B0.3030006@caucho.com> <AANLkTi=ND-FOH8OoD=TCbiyeSZ-h0LhxQBXN5w-2hfvj@mail.gmail.com> <AANLkTiku9LqTLrnXQEiPIZtqOZzTViYAmyR-QGqGIpRd@mail.gmail.com>
From: Adam Barth <ietf@adambarth.com>
Date: Wed, 21 Jul 2010 23:21:46 -0700
Message-ID: <AANLkTimD0d9StM++_saPENWWgtTVmzVnVYeUdHizHzVw@mail.gmail.com>
To: Greg Wilkins <gregw@webtide.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Extensibility mechanisms?
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: Thu, 22 Jul 2010 06:21:54 -0000

On Wed, Jul 21, 2010 at 11:04 PM, Greg Wilkins <gregw@webtide.com> wrote:
> On 22 July 2010 14:40, Adam Barth <ietf@adambarth.com> wrote:
>> The more I read on this list, the more I think that folks here don't
>> understand the requirements on the protocol, especially the security
>> requirements.  That's understandable if you haven't worked extensively
>> with the browser security model.  Fortunately, Ian is an expert on
>> these topics and has more time to reply to this list than I do.  I'll
>> try to address some of the confusion in this email, but I might not be
>> able to answer all the followup questions.
>
> I don't think there is any specific lack of understanding of protocol
> requirements in this WG. However there may be some disagreement with what
> those requirements are.
>
> It is great that you respect Ian's opinion, but I'm afraid he has failed to
> convince many in this WG of the need for some of the more esoterica
> "features" in the -76 draft.
>
> Take the security issue for example.  There was a concern that websocket
> could be used in combination with an injectable server to spoof it to
> generate a legal websocket handshake response (what good that would do
> anybody I don't really know, but let's assume that it is evil and dangerous
> and that the injectable server cannot be exploited in other ways).    In
> response to that concern, this list pretty much agreed that we should
> include a random token in the handshake that was generated after the URL had
> been passed to the javascript websocket API.  Since this token would be
> unpredictable, then it would be impossible for anybody to craft a URL that
> would cause that token to be injected in a response. Problem solved.

I don't think these issues are as simple as you seem to believe.
Security is rarely as simple as blithely tossing in a nonce and hoping
for the best.  Also, I'm skeptical about using the work "impossible"
in the context of what an attacker can and cannot do.  It smacks of
the kind of hubris that leads folks to a false sense of security.

> But when Ian codified this general agreement in the specification, he
> adorned it with several extra "features".  He split the random number up and
> added a pseudo secure algorithm involving count spaces, taking away the
> number you first thought of and divide by your grandmothers birthday.  This
> is totally unnecessary complexity and confusion because the random token
> would be generated after any client had the chance to inject the URL, so no
> further protection is needed from injection.  It is another silly example of
> being fixated on the exact bytes of a message rather than the semantics that
> the message is carrying.
>
> Ian further "enhanced" the solution by sending the random token, not in
> headers as had been discussed, but in extra bytes that comply neither with
> HTTP nor with websocket framing.  The motivation for these bytes is
> apparently to fast fail if there in an intermediary that does not support
> websocket.   However, among many other problems with this mechanism, it has
> now been shown that this mechanism slow fails with an intermediary that
> would support websocket if not for the extra bytes.
>
> Fast fail is indeed a very desirable requirement (although not always
> achievable).   Protection from injection is also a desirable requirement.
> But there was no need to mix the solution to these two requirements into a
> single solution (with extra pseudo security).  If Ian had simply added the
> random token as a header as had been discussed and widely accepted, then we
> would no longer be talking about it.
>
> He could also have raised the fast fail requirement (ideally by proposing it
> as an addition to the requirements document), and then we could be using the
> considerable experience available in this WG (and elsewhere) to come up with
> the best solution to that problem.
>
> We will only make progress is we methodically break down requirements and
> consider multiple solutions.   Intransigent insistence of the first
> one-size-fits-all "solution" does not help at all.

You seem to essentially be saying that you don't understand the
rationale for all the cross-protocol mitigations in the current
handshake.  I'm not sure I understand them all either.

The essential problem is that we don't have a science of
cross-protocol attacks in the same way we have a science of
cryptographic primitives in network protocols.  It seems likely that
Ian has layered these mitigations into the handshake as defense in
depth.  Without a way to evaluate cross-protocol attacks, it seems
prudent to use a bunch of mitigations and hope that at least one of
them saves us in any given situation.

As an aside, that's why I prefer the TLS+NPN approach.  It's a simple
mechanism that I can convince myself resists cross-protocol attacks.
Moreover, I understand exactly what role each piece of the protocol is
playing, which means we don't need to layer together a string of
half-defenses and hope the holes in the cheese don't align.

Adam