Re: [xmpp] 'to' attribute on stanzas from server->client

Peter Saint-Andre <stpeter@stpeter.im> Sun, 17 October 2010 02:10 UTC

Return-Path: <stpeter@stpeter.im>
X-Original-To: xmpp@core3.amsl.com
Delivered-To: xmpp@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id B31843A68D5 for <xmpp@core3.amsl.com>; Sat, 16 Oct 2010 19:10:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.56
X-Spam-Level:
X-Spam-Status: No, score=-102.56 tagged_above=-999 required=5 tests=[AWL=0.039, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 ceYcVvlpLVHU for <xmpp@core3.amsl.com>; Sat, 16 Oct 2010 19:10:32 -0700 (PDT)
Received: from stpeter.im (stpeter.im [207.210.219.233]) by core3.amsl.com (Postfix) with ESMTP id 62EA13A6856 for <xmpp@ietf.org>; Sat, 16 Oct 2010 19:10:31 -0700 (PDT)
Received: from squire.local (dsl-251-156.dynamic-dsl.frii.net [216.17.251.156]) (Authenticated sender: stpeter) by stpeter.im (Postfix) with ESMTPSA id 223CC400EE for <xmpp@ietf.org>; Sat, 16 Oct 2010 20:19:02 -0600 (MDT)
Message-ID: <4CBA5B6A.10809@stpeter.im>
Date: Sat, 16 Oct 2010 20:11:54 -0600
From: Peter Saint-Andre <stpeter@stpeter.im>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
MIME-Version: 1.0
To: xmpp@ietf.org
References: <AANLkTikFGbJfET+Cx_cwnoZf1FzYjZENmB18zu8baYeP@mail.gmail.com> <4CB8B04D.7030900@stpeter.im> <4CB8BC7A.6010904@babelmonkeys.de> <4CB8BF0D.7000405@stpeter.im> <4CB8C3FF.1050800@babelmonkeys.de> <4CB9236A.3080506@stpeter.im> <4CB9980D.8020602@babelmonkeys.de>
In-Reply-To: <4CB9980D.8020602@babelmonkeys.de>
X-Enigmail-Version: 1.1.1
OpenPGP: url=http://www.saint-andre.com/me/stpeter.asc
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="------------ms050609000200060405070902"
Subject: Re: [xmpp] 'to' attribute on stanzas from server->client
X-BeenThere: xmpp@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: XMPP Working Group <xmpp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/xmpp>, <mailto:xmpp-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/xmpp>
List-Post: <mailto:xmpp@ietf.org>
List-Help: <mailto:xmpp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xmpp>, <mailto:xmpp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Oct 2010 02:10:57 -0000

On 10/16/10 6:18 AM, Florian Zeitz wrote:
> Am 16.10.2010 06:00, schrieb Peter Saint-Andre:
>> On 10/15/10 3:13 PM, Florian Zeitz wrote:
>>
>>>>> E.g. I have previously mentioned the social network that tells a client
>>>>> one JID during resource binding, but uses a completely different one for
>>>>> everything else. If clients were to ignore the 'to' attribute this would
>>>>> be valid (well doable) behavior and I personally think that's quite bad.
>>>>> Also almost all clients utterly fail against that service (at least for
>>>>> the roster get, not sure if we have text that causes this), so that
>>>>> change wouldn't be documenting the "status quo".
>>>>> It's probably sensible to define that stanzas that have a 'to' attribute
>>>>> where the bare portion of the JID matches MUST be handled.
>>>>
>>>> That seems reasonable, although I'm trying to come up with exceptions
>>>> and counter-examples so I think SHOULD might be enough.
>>>>
>>> That would be fine with me.
>>
>> We don't have any text right now in 3920bis about client handling of
>> incoming stanzas. Currently we assume that the client trusts the server
>> to not deliver stanzas that are intended for another account. This
>> client checking of the 'to' address seems like a faux security measure
>> to me ("protecting" the client against stanzas that were originally
>> addressed a different authorized resource of the same account). Do we
>> really need to add some text saying "there's no need for the client to
>> check the 'to' address of stanzas it receives from the server"? I mean,
>> if your server is sending you malicious stanzas of some kind (which it
>> could easily do by rewriting every 'to' address anyway!), then you have
>> much bigger problems.
>>
> My concern was actually different. A client developer could guess that
> it's "okay" to check the 'to' address (for whatever reason). After
> having slept over it I'm actually convinced that it is in fact safe to
> ignore this. However that you *have to* ignore it (or at least not check
> against the full JID) is not entirely clear IMHO.
> The text proposed in the other branch of this thread addresses this to
> some extent (albeit implicitly).
> However if people are writing bug reports against servers about this it
> might be worth a Implemenation Note.

Look, it's fine for someone to write a paranoid client. I happen to
think it's stupid to do so, because if you don't trust your server at
such a fundamental level then you have bigger problems, but I don't
think we can say that a client MUST NOT try to check the 'to' address of
incoming stanzas. However, I think we could say something like this:

   Implementation Note: Because it is the server's responsibility to
   deliver only stanzas that were addressed to the client's full JID or
   the user's bare JID, there is no need for the client to check the
   'to' address of incoming stanzas.

/psa