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

Adam Barth <ietf@adambarth.com> Thu, 22 July 2010 17:28 UTC

Return-Path: <ietf@adambarth.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 A5B0F3A67C3 for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 10:28:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 RbujstC5qbY7 for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 10:27:59 -0700 (PDT)
Received: from mail-gw0-f44.google.com (mail-gw0-f44.google.com [74.125.83.44]) by core3.amsl.com (Postfix) with ESMTP id 3DEFF3A676A for <hybi@ietf.org>; Thu, 22 Jul 2010 10:27:59 -0700 (PDT)
Received: by gwaa18 with SMTP id a18so232879gwa.31 for <hybi@ietf.org>; Thu, 22 Jul 2010 10:28:16 -0700 (PDT)
Received: by 10.150.240.17 with SMTP id n17mr4287016ybh.311.1279819696182; Thu, 22 Jul 2010 10:28:16 -0700 (PDT)
Received: from mail-gw0-f44.google.com (mail-gw0-f44.google.com [74.125.83.44]) by mx.google.com with ESMTPS id u10sm1319262yba.1.2010.07.22.10.28.15 (version=SSLv3 cipher=RC4-MD5); Thu, 22 Jul 2010 10:28:15 -0700 (PDT)
Received: by gwaa18 with SMTP id a18so232852gwa.31 for <hybi@ietf.org>; Thu, 22 Jul 2010 10:28:14 -0700 (PDT)
Received: by 10.150.220.18 with SMTP id s18mr4289460ybg.60.1279819694506; Thu, 22 Jul 2010 10:28:14 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.143.145 with HTTP; Thu, 22 Jul 2010 10:27:53 -0700 (PDT)
In-Reply-To: <18E0FF9C-6C51-4602-92E1-E44802D0D8B5@gbiv.com>
References: <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> <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>
From: Adam Barth <ietf@adambarth.com>
Date: Thu, 22 Jul 2010 10:27:53 -0700
Message-ID: <AANLkTi=9npOTe+pC0YufDQcmMfuts9o7OW3k2crvUUqX@mail.gmail.com>
To: "Roy T. Fielding" <fielding@gbiv.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: 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 17:28:00 -0000

On Thu, Jul 22, 2010 at 2:33 AM, Roy T. Fielding <fielding@gbiv.com> wrote:
> On Jul 22, 2010, at 1:21 AM, Salvatore Loreto wrote:
>> I see more value to work on a general solution to secure the HTTP Upgrade mechanism
>> against cross-protocol vulnerability, instead of trying to draft something ad-hoc for WebSocket
>
> The HTTP Upgrade mechanism is not vulnerable to cross-protocol attacks.
> Other (non-HTTP) services are vulnerable to browser misdirection if
> the browser can be directed to send arbitrary bytes to an arbitrary
> TCP port.  That is a problem which HTTP is actually good at avoiding
> because the first line is unique to HTTP.

HTTP is the source of a large number of cross-protocol attacks.  The
uniqueness of the first line often does not help because other
protocols (such as SMTP, DNS, FTP, etc) happily ignore leading junk on
the socket that they don't understand.  Claiming HTTP is not
vulnerably to cross-protocol attacks is just silly.

If you'd like some background reading about cross-protocol attacks
involving HTTP, I'd invite you to read the classic paper on the
subject:

http://www.remote.org/jochen/sec/hfpa/hfpa.pdf

There's a later paper with more interesting examples called "Extended
HTML Form Attack Revisited", but I couldn't turn up the PDF with a
quick search.  Collin Jackson and I also have a number of unpublished
results in this area, all of which use HTTP to attack other protocols.

Adam