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

Willy Tarreau <w@1wt.eu> Thu, 22 July 2010 12:13 UTC

Return-Path: <w@1wt.eu>
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 DD4F83A693B for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 05:13:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.062
X-Spam-Level:
X-Spam-Status: No, score=-3.062 tagged_above=-999 required=5 tests=[AWL=-1.019, BAYES_00=-2.599, HELO_IS_SMALL6=0.556]
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 frdWkx1ZQPqq for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 05:13:07 -0700 (PDT)
Received: from 1wt.eu (1wt.eu [62.212.114.60]) by core3.amsl.com (Postfix) with ESMTP id B94813A688B for <hybi@ietf.org>; Thu, 22 Jul 2010 05:13:06 -0700 (PDT)
Received: (from willy@localhost) by mail.home.local (8.14.4/8.14.4/Submit) id o6MCDHCW012645; Thu, 22 Jul 2010 14:13:17 +0200
Date: Thu, 22 Jul 2010 14:13:17 +0200
From: Willy Tarreau <w@1wt.eu>
To: Salvatore Loreto <salvatore.loreto@ericsson.com>
Message-ID: <20100722121317.GA12582@1wt.eu>
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>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <4C481C76.1060907@ericsson.com>
User-Agent: Mutt/1.4.2.3i
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: Thu, 22 Jul 2010 12:13:08 -0000

On Thu, Jul 22, 2010 at 01:24:54PM +0300, Salvatore Loreto wrote:
(...)
> however if HTTP experts exclude any vulnerability in the HTTP Upgrade,
> then a sort of security check right after the end of the Upgrade from 
> HTTP to Websocket and before the WebSocket starts to exchange data,
> could solve the problem.

We must at least keep in mind that we should avoid round-trips as much as
possible. For that, I think that Greg's proposal of a nonce in a header is
particularly interesting because it does not add round trips and can be
made part of the Upgrade handshake itself. The request and response headers
could then be advertised in the Connection header just like the Upgrade
header right now. Such a header could possibly be suggested as general use
for the HTTP Upgrade mechanism instead of being WS-centric.

The only fear I have right now with the nonce as defined by the WS draft
is that it makes use of MD5 which comes with a cost. I know at least one
site dealing with more than 300k concurrent connections at a rate between
12 and 18k per second (long polling right now), and I think that computing
MD5 hashes can significantly impact performance at these rates. If the
goal is to ensure the response header depends on the request header, we
may reliably make use of cheaper algorithms.

Regards,
Willy