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

"Roy T. Fielding" <fielding@gbiv.com> Thu, 22 July 2010 21:03 UTC

Return-Path: <fielding@gbiv.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 11BE33A6958 for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 14:03:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.799
X-Spam-Level:
X-Spam-Status: No, score=-5.799 tagged_above=-999 required=5 tests=[AWL=-3.200, BAYES_00=-2.599]
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 ZU4hZXy1DD0y for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 14:03:40 -0700 (PDT)
Received: from spaceymail-a6.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id BFAAA3A685F for <hybi@ietf.org>; Thu, 22 Jul 2010 14:03:40 -0700 (PDT)
Received: from di-524.corp.day.com (wsip-98-189-13-228.oc.oc.cox.net [98.189.13.228]) by spaceymail-a6.g.dreamhost.com (Postfix) with ESMTP id C8AA5CA7F4; Thu, 22 Jul 2010 14:03:57 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset="windows-1252"
From: "Roy T. Fielding" <fielding@gbiv.com>
In-Reply-To: <AANLkTi=9npOTe+pC0YufDQcmMfuts9o7OW3k2crvUUqX@mail.gmail.com>
Date: Thu, 22 Jul 2010 14:03:57 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <168631FD-48D0-42C6-9E72-AF2FB3F9243E@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> <AANLkTi=9npOTe+pC0YufDQcmMfuts9o7OW3k2crvUUqX@mail.gmail.com>
To: Adam Barth <ietf@adambarth.com>
X-Mailer: Apple Mail (2.1081)
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 21:03:42 -0000

On Jul 22, 2010, at 10:27 AM, Adam Barth wrote:

> 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.

HTTP is not vulnerable.  Please understand what that means before
misdirecting accusations.  The only things vulnerable there are the
invalid and insecure implementations of SMTP, DNS, FTP, etc.
They will continue to be vulnerable no matter what we do in hybi.

> 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

I have before.  Did you read it?

  3.3	Vulnerable protocols

  Generally, all ASCII command based protocols might be vulnerable
  to this attack. This includes, but is probably not limited to:
  FTP, SMTP, NNTP, POP3, IMAP, and IRC.  Servers using binary
  protocols like SSH or DNS will generally close the connection
  if they receive anything they don’t understand. Because using
  this attack implies that there is always the HTTP protocol
  overhead at the beginning, there is no way to use this attack on
  ”binary” protocols.  Some protocols like the one used for rsh
  require that the connection originates from a TCP port smaller
  than 1024, which is generally not the case for a request
  originating from a web browser.

Just to reiterate, *other* protocol services are vulnerable to attack
from a browser *using* HTTP if those *other* protocol services do not
validate an incoming request.  This is a well-known implementation
issue with older Internet services due to excessive adherence to the
robustness principle.  It is not a vulnerability in HTTP and is not
caused by HTTP.  You can even avoid the issue entirely, using HTTP,
by implementing transfer-encoding and sending all message bodies compressed.

> 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.

Which means the other implementations are vulnerable, not that HTTP
is vulnerable or even that other protocols are vulnerable.  This is
a trivial thing to fix on any one of those implementations, which is
why we tell those implementations that *they* have a security
vulnerability (so that the people who can fix it, will fix it).

....Roy