Re: [hybi] Upgrade Mechanism and HasMat (was Re: Extensibility mechanisms?)

Maciej Stachowiak <mjs@apple.com> Mon, 26 July 2010 01:44 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 52B713A695B for <hybi@core3.amsl.com>; Sun, 25 Jul 2010 18:44:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.948
X-Spam-Level:
X-Spam-Status: No, score=-105.948 tagged_above=-999 required=5 tests=[AWL=0.649, 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 HZonennBwuIi for <hybi@core3.amsl.com>; Sun, 25 Jul 2010 18:44:18 -0700 (PDT)
Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by core3.amsl.com (Postfix) with ESMTP id AE1F33A693B for <hybi@ietf.org>; Sun, 25 Jul 2010 18:44:17 -0700 (PDT)
Received: from relay16.apple.com (relay16.apple.com [17.128.113.55]) by mail-out4.apple.com (Postfix) with ESMTP id 8FD01A549315 for <hybi@ietf.org>; Sun, 25 Jul 2010 18:44:38 -0700 (PDT)
X-AuditID: 11807137-b7c08ae00000377a-49-4c4ce886f67b
Received: from elliott.apple.com (elliott.apple.com [17.151.62.13]) by relay16.apple.com (Apple SCV relay) with SMTP id D9.FB.14202.688EC4C4; Sun, 25 Jul 2010 18:44:38 -0700 (PDT)
MIME-version: 1.0
Content-type: multipart/alternative; boundary="Boundary_(ID_8DkPT2AVcSVFxn+QT+C08Q)"
Received: from [10.0.1.5] (c-69-181-42-237.hsd1.ca.comcast.net [69.181.42.237]) by elliott.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0L65008JJ66D1500@elliott.apple.com> for hybi@ietf.org; Sun, 25 Jul 2010 18:44:38 -0700 (PDT)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <AANLkTimDqGJBz9RmBkLp60r98HM7XYaP-40n5v7Xme4H@mail.gmail.com>
Date: Sun, 25 Jul 2010 18:44:37 -0700
Message-id: <AA73542A-5E46-401D-9A61-A113B0F68830@apple.com>
References: <AANLkTims1er0Rbv0ysP4gRs1Kd0He8hapHeJ3nON=JQa@mail.gmail.com> <4C47C5B0.3030006@caucho.com> <AANLkTi=ND-FOH8OoD=TCbiyeSZ-h0LhxQBXN5w-2hfvj@mail.gmail.com> <20100722055452.GL7174@1wt.eu> <AANLkTik_rpxo=1OfzHkwpC5soQG_NxvGuZNXx7gdhVTh@mail.gmail.com> <20100722064945.GM7174@1wt.eu> <AANLkTim7AsQGSwLE51uktj=B1vB6roZChAtDoCrE6fFG@mail.gmail.com> <4C47FF71.3050000@ericsson.com> <18E0FF9C-6C51-4602-92E1-E44802D0D8B5@gbiv.com> <4C481C76.1060907@ericsson.com> <20100722121317.GA12582@1wt.eu> <0E002C06-7F95-47D3-AA86-17DCC13905EF@apple.com> <AANLkTimDqGJBz9RmBkLp60r98HM7XYaP-40n5v7Xme4H@mail.gmail.com>
To: Greg Wilkins <gregw@webtide.com>
X-Mailer: Apple Mail (2.1081)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: "Roy T. Fielding" <fielding@gbiv.com>, "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Upgrade Mechanism and HasMat (was Re: 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: Mon, 26 Jul 2010 01:44:22 -0000

On Jul 25, 2010, at 6:38 PM, Greg Wilkins wrote:

> 
> 
> On 23 July 2010 02:46, Maciej Stachowiak <mjs@apple.com> wrote:
> I originally suggested computing a hash of the nonce with other data (or some other nontrivial computation) rather than just echoing it back.
> 
> Maciej,
> 
> I agree that avoiding a simple echo would be very good protection against almost all forms of injection attack.
> 
> I think the handshake request contains a random token generated after the URL has been passed to the browser. The handshake response could then contain a random token generated after the connection has been accepted, plus a simple hash of the combination of the request and response tokens.

I don't see the value of a random token in the handshake response. How does that provide any additional protection? Anything echoed produced by the server might well be controlled by the cross-protocol attacker, so a random token generated by the server is no more effective than a fixed string.

> 
> This would allow a client to validate that the server had performed websocket specific calculations (in addition to sending a 101 response) and appears to address all the same security concerns that the current space counting and random bytes do.
> 
> I beleive these tokens and hash should be  carried in normal HTTP headers for the upgrade handshake, and that other mechanisms should be considered to address the fast fail detection of non-ws handling intermediaries.

I would have to see a more detailed version of this proposal to evaluate its security. I think it is effectively only as strong as sending a nonce (at an arbitrary place in the request headers), and echoing back a simple hash of that nonce that doesn't include any other data. Which I think is at the weaker end of nonce-based defenses.

Regards,
Maciej