Re: [hybi] I-D Action: draft-ietf-hybi-thewebsocketprotocol-13.txt

Takeshi Yoshino <tyoshino@google.com> Fri, 09 September 2011 06:09 UTC

Return-Path: <tyoshino@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1700921F8781 for <hybi@ietfa.amsl.com>; Thu, 8 Sep 2011 23:09:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.981
X-Spam-Level:
X-Spam-Status: No, score=-104.981 tagged_above=-999 required=5 tests=[AWL=-0.758, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, MIME_BASE64_TEXT=1.753, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id um8k5ZhQgPzW for <hybi@ietfa.amsl.com>; Thu, 8 Sep 2011 23:09:03 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by ietfa.amsl.com (Postfix) with ESMTP id B966321F86FF for <hybi@ietf.org>; Thu, 8 Sep 2011 23:09:03 -0700 (PDT)
Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id p896AqIO028998 for <hybi@ietf.org>; Thu, 8 Sep 2011 23:10:53 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1315548653; bh=Ic+k88LrQKkCbDBYq+2L7ZFKApE=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Content-Type; b=EGTyXbCBpFhvlEMUtYKl6b90EFbFXtO28vwo/qzLsVeb3TnETA/wSNTFscANYER1U sx32tv23HtBpvA56iJUkQ==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:mime-version:in-reply-to:references:from:date: message-id:subject:to:content-type:x-system-of-record; b=drCcDlS0AY3cBHQ9Xmg3jwa9IXwDV8/8ziI1Jt1NqDpIVO8dPWTuuqN8VnZelarwc aoC8QTVJ1O//zuLaxpUig==
Received: from gyd5 (gyd5.prod.google.com [10.243.49.197]) by hpaq6.eem.corp.google.com with ESMTP id p896Aiqg019806 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Thu, 8 Sep 2011 23:10:51 -0700
Received: by gyd5 with SMTP id 5so1347568gyd.15 for <hybi@ietf.org>; Thu, 08 Sep 2011 23:10:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=r3nBXnKrkB5Ww0cYzPEh+JafAdi9xhfqWnqr4sTVOW8=; b=Z8pPErf7n6iuhNPhNcTg0LsIT3wckHmBW62L6Mh6mV4FeeOd9+8u4/H8S1simP2KNM tgpYEdAH5JcMx3UlG03g==
Received: by 10.150.225.21 with SMTP id x21mr1688178ybg.114.1315548647348; Thu, 08 Sep 2011 23:10:47 -0700 (PDT)
Received: by 10.150.225.21 with SMTP id x21mr1688170ybg.114.1315548647138; Thu, 08 Sep 2011 23:10:47 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.158.6 with HTTP; Thu, 8 Sep 2011 23:10:27 -0700 (PDT)
In-Reply-To: <4E695F4E.1080606@it.aoyama.ac.jp>
References: <20110831184207.1514.64093.idtracker@ietfa.amsl.com> <0fc901cc6878$1681eec0$0a00a8c0@Venus> <CAH9hSJb2rH+fX0AnekYxsEkHKzb15aHrg_hDQw1baWLiWBF-3w@mail.gmail.com> <17b501cc6d31$3016d6d0$0a00a8c0@Venus> <CAH9hSJYhLpcXrOtS-nzLt2YW9QbngEsfdcNF+0TadyVA6rrK1A@mail.gmail.com> <17ef01cc6d39$3575ae50$0a00a8c0@Venus> <20110907085128.GA19144@1wt.eu> <CAH9hSJYXZ285L_+eJh6VUVCAg4D+u=vQbcjVOA4RMsJSbcHqiw@mail.gmail.com> <CABLsOLBKgnTFga821t2AZ1dXobTsfMb5v8CTJhm_Nr8WMkonaA@mail.gmail.com> <53451FDB-77F7-42A1-8D16-05094C35AB5D@bbn.com> <4E68E9F6.6030901@stpeter.im> <CA566BAEAD6B3F4E8B5C5C4F61710C11448BDC88@TK5EX14MBXW604.wingroup.windeploy.ntdev.microsoft.com> <1B54A085-1AF4-4324-B252-0C8BE778A69D@bbn.com> <CA566BAEAD6B3F4E8B5C5C4F61710C11448BDD3F@TK5EX14MBXW604.wingroup.windeploy.ntdev.microsoft.com> <4E695F4E.1080606@it.aoyama.ac.jp>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Fri, 09 Sep 2011 15:10:27 +0900
Message-ID: <CAH9hSJaerLi8iDJk0D9Mo5Uav=k9Rq7B=KF-aE51ntyk28as+A@mail.gmail.com>
To: "hybi@ietf.org" <hybi@ietf.org>
Content-Type: multipart/alternative; boundary="000e0cd404dacc266904ac7c0994"
X-System-Of-Record: true
Subject: Re: [hybi] I-D Action: draft-ietf-hybi-thewebsocketprotocol-13.txt
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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, 09 Sep 2011 06:09:05 -0000

[masking bit]

On Fri, Sep 9, 2011 at 00:14, John Tamplin <jat@google.com> wrote:

> On Thu, Sep 8, 2011 at 11:06 AM, Richard L. Barnes <rbarnes@bbn.com>
>  wrote:
>
>> It should also be noted that if the MASK bit is eliminated, then the
>> recipient of a frame can't even parse it in the current format, since it
>> doesn't know whether the first four octets are a masking key or not.
>
>
I'm fine with MASK bit. I just told the history.


> No, you know which side initiated the connection, so you know whether it is
> a client frame or a server frame, and therefore whether it is masked.
>

Yes.


>  I expect it will get used as a WS-variant when dealing with non-browser
>>> clients -- ie, between a frontend which handles
>>> masking/aggregation/deaggregation/SSL and the ultimate backend, I would not
>>> be surprised if there were unmasked client->server frames.  As long as all
>>> the browser clients all enforce masking on their connections, the problem
>>> masking was added for is averted.
>>
>>
Good point. I missed it. Yes, for c2s traffic, the flag is useful. Let's
keep it.

On Fri, Sep 9, 2011 at 01:38, Joel Martin <hybi@martintribe.org> wrote:

> On Thu, Sep 8, 2011 at 11:36 AM, Joel Martin <hybi@martintribe.org> wrote:
>
>> I would also be okay with adding a note indicating that in a future
>> revision of the spec, when WebSockets is used with clients that are running
>> trusted code (i.e. not browsers), the client may choose to not mask and the
>> server can accept unmasked frames. But I think this should only be a note to
>> indicate possible future direction.
>>
>
> This note could be an explanation of why there is a masking bit and it
> isn't just assumed/implicit.
>

+1

----

[c2s client requirement]

On Fri, Sep 9, 2011 at 05:39, Ian Fette (イアンフェッティ) <ifette@google.com>
 wrote:

> I don't think we can go back on c->s masking. If someone really cares
> within a datacenter, they are free to do nonstandard things within their own
> infrastructure at their own risk, but I don't see why we would need to
> mention that within a standard.
>
> I don't see how a client would necessarily know that it's safe to disable
> masking or not, and so I really don't think we should reopen that can of
> worms.
>

On Fri, Sep 9, 2011 at 02:45, John Tamplin <jat@google.com> wrote:

> On Thu, Sep 8, 2011 at 12:37 PM, Richard L. Barnes <rbarnes@bbn.com>
>  wrote:
>
>>
>> On Sep 8, 2011, at 12:28 PM, John Tamplin wrote:
>>
>>>  If we do go with this, I would prefer an additional statement for
>>> client->server, stating that if the client sends content controlled by
>>> potentially hostile code over a WebSocket connection, it MUST mask the
>>> contents.
>>
>>
>> I don't think that statement is quite correct.  Masking may not be needed
>> in some cases where hostile code is present; e.g., if there are no
>> vulnerable intermediaries present.  And the requirement as you've stated it
>> would require masking within the data center, since the SSL termination box
>> would technically be sending content controlled by potentially hostile code.
>>
>
> Good point.  Seeing as how it is difficult to write an explanation of when
> it would be safe to disable C->S masking, I think it is better to keep the
> hard-won consensus of the existing document and leave it for a future
> revision of the spec, with a note as suggested by Joel.
>

+1 for these. We shouldn't change c2s masking from MUST to SHOULD.

On Fri, Sep 9, 2011 at 03:18, Tobias Oberstein <tobias.oberstein@tavendo.de>
 wrote:

> What I meant was non-browser clients using a WS implementation that have an
> option
>
> to "fake masking": turn on mask bit, insert mask, but don't actually mask.
>

I understand that "MUST be masked" is not perfect. The same applies to
Sec-WebSocket-Accept. Some bad client may just ignore Sec-WebSocket-Accept.
Taking care of implementations intentionally violating MUSTs brings us back
to the handshake proposal by Adam
http://tools.ietf.org/html/draft-abarth-websocket-handshake-00.

I think use of MUSTs and MUST NOTs in the spec is necessary-sufficient.

----

[c2s server requirement]

On Fri, Sep 9, 2011 at 00:06, Richard L. Barnes <rbarnes@bbn.com> wrote:

> NEW: "Servers MUST NOT reject un-masked frames, unless masking is required
> by local policy."
>

I prefer the spec asks server implementors to guide clients to implement
masking by rejecting unmasked frames as currently specified at
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-14#section-5.3
.

----

[relaxing]

For non-browser clients' performance concern, I'd rather like to see some
extension to relax the restriction explicitly. For example,
"Sec-WebSocket-Extensions: no_c2s_masking_intentionally"