Re: [hybi] Extensibility mechanisms?

Greg Wilkins <gregw@webtide.com> Thu, 22 July 2010 06:48 UTC

Return-Path: <gregw@webtide.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 AC4763A67B4 for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 23:48:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.529
X-Spam-Level:
X-Spam-Status: No, score=-1.529 tagged_above=-999 required=5 tests=[AWL=-0.153, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, 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 MVjoT2a2m3KN for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 23:48:21 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by core3.amsl.com (Postfix) with ESMTP id 72F653A6783 for <hybi@ietf.org>; Wed, 21 Jul 2010 23:48:20 -0700 (PDT)
Received: by fxm1 with SMTP id 1so4467031fxm.31 for <hybi@ietf.org>; Wed, 21 Jul 2010 23:48:37 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.86.33.12 with SMTP id g12mr1206287fgg.21.1279781316976; Wed, 21 Jul 2010 23:48:36 -0700 (PDT)
Received: by 10.223.112.129 with HTTP; Wed, 21 Jul 2010 23:48:36 -0700 (PDT)
In-Reply-To: <AANLkTimD0d9StM++_saPENWWgtTVmzVnVYeUdHizHzVw@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> <AANLkTimD0d9StM++_saPENWWgtTVmzVnVYeUdHizHzVw@mail.gmail.com>
Date: Thu, 22 Jul 2010 16:48:36 +1000
Message-ID: <AANLkTilNYc4rj-qGQIWYVNSKIhg9w9WKwydpY2LMtlXp@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: Adam Barth <ietf@adambarth.com>
Content-Type: multipart/alternative; boundary="000e0cd297aec9e2b9048bf44e9b"
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:48:24 -0000

On 22 July 2010 16:21, Adam Barth <ietf@adambarth.com> wrote:

> 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.
>

Adam,

I am not claiming that a random nonce is a solution to all the security
problems.
But I believe it is a very good solution to the specific concern expressed
that an injectable HTTP server might be able to be tricked into sending and
acceptable websocket hand shake response.

If the token is unpredictable and generated after the URL is passed, then I
do believe that we can say that it is impossible for a URL to be crafted
that will inject that token into a response. Of course "unpredictable" is a
relative measure, but I think good server developers are already on top of
that one when it comes to the generation of session IDs and similar
(although it is surprising how difficult that is).

Conversely, I think the count spaces and divide results is exactly the type
of algorithm that can have unexpected numeric effects that might result in
the number of truly random bits being significantly reduced and this more
predictable, specially if the same random generator(algorithm) is used to
produce the numbers and to place the spaces.  It would not surprise me if
such an algorithm significantly reduced the search space.

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.
>

Using a pseudo secure algorithm that has not been subjected to any rigorous
analysis is not going to help 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.
>

I'm all for defence in depth.
Note that the random token is already the second line of defence as you
firstly need a scriptable browser, that can talk to an injectable server.

Can you tell me that the count spaces algorithm really adds another layer of
defence? or does it just make the random nonce more guessable?


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.
>

Similarly a random nonce is a simple mechanism, which good developers will
understand and know that they need to provide sufficient random bits that
are unpredictable and protected from discovery by the javascript client.

regards