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

Scott Ferguson <ferg@caucho.com> Sat, 02 October 2010 17:31 UTC

Return-Path: <ferg@caucho.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 D999F3A6E63 for <hybi@core3.amsl.com>; Sat, 2 Oct 2010 10:31:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.196
X-Spam-Level:
X-Spam-Status: No, score=-2.196 tagged_above=-999 required=5 tests=[AWL=0.069, BAYES_00=-2.599, IP_NOT_FRIENDLY=0.334]
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 erlaVrOPbM3X for <hybi@core3.amsl.com>; Sat, 2 Oct 2010 10:31:34 -0700 (PDT)
Received: from smtp111.biz.mail.sp1.yahoo.com (smtp111.biz.mail.sp1.yahoo.com [69.147.92.224]) by core3.amsl.com (Postfix) with SMTP id A36583A6D8C for <hybi@ietf.org>; Sat, 2 Oct 2010 10:31:34 -0700 (PDT)
Received: (qmail 36043 invoked from network); 2 Oct 2010 17:32:22 -0000
Received: from [192.168.1.11] (ferg@66.92.8.203 with plain) by smtp111.biz.mail.sp1.yahoo.com with SMTP; 02 Oct 2010 10:32:22 -0700 PDT
X-Yahoo-SMTP: L1_TBRiswBB5.MuzAo8Yf89wczFo0A2C
X-YMail-OSG: 6tHCb5MVM1mDOeTk6MjbqhSgIpBMV6jyQc3QmEK7sJ5HKCW iIiO2CCQHiTm62i2vwW_MdlRiP8M1EijRlVnBYk1xSXGvJbAd.CTzfCoHesY KDldGh0V_M4tAALAbZIPMG1_A78Ja9dFsOAsBzkTXXuumP52322kR21XKwcS aW53Tp0OvKU7JW7KJAf6UiYXbh_FvnmzbAJt7ig_AfBCPwklVUBVft0I12n0 kxYh9YG30m59sjBgdNF6iCl5Oy6Jkrf7cE6tmSdCW9I27NorRqB3Xi.Awi_9 JEU8q6HUQ7cGWqK_4hoqdNwQ_vIXQP438LCdvbak7vwnyzMgM3ashvg--
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4CA76C9C.40408@caucho.com>
Date: Sat, 02 Oct 2010 10:32:12 -0700
From: Scott Ferguson <ferg@caucho.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100411)
MIME-Version: 1.0
To: Adam Barth <ietf@adambarth.com>
References: <AANLkTikszM0pVE-0dpZ2kv=i=y5yzS2ekeyZxtz9N=fQ@mail.gmail.com> <4CA0D0D2.4040006@caucho.com> <AANLkTinACqm-GxUPhvFMf6_sGfeJofwy1r=28o=vgM43@mail.gmail.com> <4CA12810.8020006@caucho.com> <AANLkTimrMfXrnVMjU3f57L_sO7usyYQ56rBM4aMb2Pfr@mail.gmail.com> <20100928052501.GD12373@1wt.eu> <CA8029B0-71A3-44ED-88C6-934FE833BBA2@apple.com> <AANLkTim+fXj-h6OS3OdcfVfh3Q1UwxD8NLVawb=AWHX+@mail.gmail.com> <4FAC5C93-9BDF-4752-AFBC-162D718397AB@apple.com> <AANLkTikcH1W3bQwumqHbe-Yqa3XdoJqCa2b-mZuvoQ7g@mail.gmail.com> <9746E847-DC8B-45A7-ADF3-2ADB9DA7F82E@apple.com> <AANLkTik9igUwoxVrktoBoZrPoUW=Tjh7HyVbGJgQYes-@mail.gmail.com> <9F595226-FA0A-4C38-A6D0-0F4214BD7D21@apple.com> <4CA4BE10.1010709@caucho.com> <AANLkTi=wKFnNOuM+U3fktAFRn3R5OZ7c6PR2W3EAy7tm@mail.gmail.com> <4CA53E6B.1040808@caucho.com> <AANLkTikOyvF5AHTf4sDD=rWmK2FTD6R6LaHa4KTqkbcm@mail.gmail.com> <4CA68098.8010404@caucho.com> <AANLkTinYhW9MnnM3tkbCWziePyM7mFUEteKhw5OGp-eS@mail.gmail.com>
In-Reply-To: <AANLkTinYhW9MnnM3tkbCWziePyM7mFUEteKhw5OGp-eS@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
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: Sat, 02 Oct 2010 17:31:36 -0000

Adam Barth wrote:
> Please read my later message.  That should give you a more concrete
> understanding of the issue.
>
> (minor points inline)
>
> On Fri, Oct 1, 2010 at 5:45 PM, Scott Ferguson <ferg@caucho.com> wrote:
>   
>> Adam Barth wrote:
>>     
>>> On Thu, Sep 30, 2010 at 6:50 PM, Scott Ferguson <ferg@caucho.com> wrote:
>>> As a side note, using an exotic HTTP method is not a good idea.  The
>>> first few bytes of the clients initial message are absolutely
>>> critical.  Picking an exotic HTTP method is just rolling the dice
>>> w.r.t. what protocols an attacker can exploit.  For example, some
>>> attacks from HTTP to DNS rely critically on the fact that the first
>>> byte of an HTTP POST message is an uppercase P.  The kinds of things
>>> you can do with an uppercase W as the first byte are largely
>>> unstudied.
>>>
>>>       
>> You misunderstand entirely.
>>
>> It's not an exotic HTTP method; it's identifying the protocol by the initial
>> sequence of bytes.
>>     
>
> Exotic => can't be sent by web sites to arbitrary hosts today in browsers.
>   

Understood, but that describes any new protocol added to the browser.

Without initial identifying bytes, no server (new protocol or old) can 
detect and reject a websocket request without scanning past a large 
number of hijackable bytes. I'd like to give servers the ability to 
identify and reject a websocket request before scanning hijackable 
bytes, even if not all servers can take advantage of that information.
>   
>> If every client for every protocol sent a non-hijackable unique protocol
>> identifier as its initial sequence, and every server for every protocol
>> verified the protocol identifier before accepting any further bytes, then
>> cross protocol attacks would be impossible.
>>     
>
> Sure, but there are plenty of protocols that don't do that.
>
>   

Which is why we still need server validation before sending the client 
payload. I'm not suggesting removing the nonce/hash check at all.

If this increases security for existing validating protocols and all new 
protocols, it increases security.  As you point out, it cannot be the 
only defense.

>> We can't fix the older protocols that don't identify themselves immediately
>> and don't validate, but we can ensure that new protocols do.
>>     
>
> Unfortunately, we don't have the luxury of ignoring attacks against
> these "older" protocols.
>   

It is true that you will need to re-analyze url/header attacks against 
non-validating legacy servers, but the added security of the identifying 
bytes for the benefit of validating servers and future protocols is 
worth the trouble.

-- Scott

> Adam
>
>
>
>