Re: [hybi] Handshake was: The WebSocket protocol issues.

Willy Tarreau <w@1wt.eu> Fri, 24 September 2010 18:09 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 D8B8D3A69C1 for <hybi@core3.amsl.com>; Fri, 24 Sep 2010 11:09:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.183
X-Spam-Level:
X-Spam-Status: No, score=-2.183 tagged_above=-999 required=5 tests=[AWL=-1.340, BAYES_00=-2.599, HELO_IS_SMALL6=0.556, J_CHICKENPOX_21=0.6, J_CHICKENPOX_37=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 kGlSBSQXwVPJ for <hybi@core3.amsl.com>; Fri, 24 Sep 2010 11:09:01 -0700 (PDT)
Received: from 1wt.eu (1wt.eu [62.212.114.60]) by core3.amsl.com (Postfix) with ESMTP id A13D83A6A87 for <hybi@ietf.org>; Fri, 24 Sep 2010 11:08:59 -0700 (PDT)
Received: (from willy@localhost) by mail.home.local (8.14.4/8.14.4/Submit) id o8OI9MKT002022; Fri, 24 Sep 2010 20:09:22 +0200
Date: Fri, 24 Sep 2010 20:09:22 +0200
From: Willy Tarreau <w@1wt.eu>
To: Alexander Voronin <alexander.voronin@gmail.com>
Message-ID: <20100924180922.GD28314@1wt.eu>
References: <AANLkTikszM0pVE-0dpZ2kv=i=y5yzS2ekeyZxtz9N=fQ@mail.gmail.com> <AANLkTikczXMx9XSY4jGaVwh5LndRTTLg==+LPj=JmiGk@mail.gmail.com> <AANLkTi=_TYM1vZrZYBoSu+8j9WrSXfaZ42EMRmnF3rnz@mail.gmail.com> <AANLkTi=gqCD=ymNawDYnpRommm2CesrBFqC-eDCpuFvG@mail.gmail.com> <AANLkTikKgvO28yKrE3X7FrAnssFFkrogwWbYo6pJEsJC@mail.gmail.com> <20100924145816.GB28314@1wt.eu> <AANLkTimYMc+YvUd0bBmWtdSTC0S5Gm34cSE0c26e5RMg@mail.gmail.com> <20100924153122.GC28314@1wt.eu> <AANLkTimNBzhqgpDjeeMXgxyX22LupasMrubBW9qo3iG=@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <AANLkTimNBzhqgpDjeeMXgxyX22LupasMrubBW9qo3iG=@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
Cc: hybi <hybi@ietf.org>
Subject: Re: [hybi] Handshake was: The WebSocket protocol issues.
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: Fri, 24 Sep 2010 18:09:02 -0000

On Fri, Sep 24, 2010 at 08:21:23PM +0300, Alexander Voronin wrote:
> Here we'r talking not about handshake but about cross-protocol attacks. So
> websockets as two-stage process is invulnerable to this attack. If browser
> creates and openes websocket than we sure that data will be sent into HTTP
> stream. If handshake fails no data will be sent.

We all agree with that and I explained to you that this model requires two
round trips, which means a connection takes twice the time to set up. Hence
the difficulty to be able to design a one-round-trip handshake which does
not open cross-protocol attack holes.

> In reference to handshake - as noticed sending data in GET request is a bad
> idea.

That was my first reaction too, until I realized that the Upgrade mechanism
is already well defined and independant of the method. We're not sending data
in a GET request, we're sending data after a confirmed Upgrade response which
was induced by a GET+Upgrade request. And precisely the problem that appeared
in draft 76 is that when you add an intermediary, the data aren't forwarded
to the server because they're not part of the request.

> And I still believe that old style handshake will work for any kind of
> proxy chains using just HTTP result codes.

Yes, but the important part is not that the handshake works, but that the
bidirectional data exchange after the handshake works. The handshake is
there to set that up and quickly detect possible failures.

Willy