[xmpp] namespace prefix violations (was: Re: Agenda for the Interim Meeting)

Peter Saint-Andre <stpeter@stpeter.im> Tue, 01 February 2011 20:50 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 7A8463A6C7B for <xmpp@core3.amsl.com>; Tue, 1 Feb 2011 12:50:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.599
X-Spam-Level:
X-Spam-Status: No, score=-102.599 tagged_above=-999 required=5 tests=[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 et6lGIDyZA+m for <xmpp@core3.amsl.com>; Tue, 1 Feb 2011 12:50:10 -0800 (PST)
Received: from stpeter.im (stpeter.im [207.210.219.233]) by core3.amsl.com (Postfix) with ESMTP id D12B43A6C6F for <xmpp@ietf.org>; Tue, 1 Feb 2011 12:50:09 -0800 (PST)
Received: from leavealone.cisco.com (72-163-0-129.cisco.com [72.163.0.129]) (Authenticated sender: stpeter) by stpeter.im (Postfix) with ESMTPSA id 18F3E400F6 for <xmpp@ietf.org>; Tue, 1 Feb 2011 14:10:15 -0700 (MST)
Message-ID: <4D4872C5.70802@stpeter.im>
Date: Tue, 01 Feb 2011 13:53:25 -0700
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.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
To: xmpp@ietf.org
References: <9AA2840B-F322-4303-9177-B9C49A9A0EF2@nostrum.com> <4D482525.6020105@stpeter.im>
In-Reply-To: <4D482525.6020105@stpeter.im>
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="------------ms050803020109040306060908"
Subject: [xmpp] namespace prefix violations (was: Re: Agenda for the Interim Meeting)
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: Tue, 01 Feb 2011 20:50:11 -0000

On 2/1/11 8:22 AM, Peter Saint-Andre wrote:
> 
> On 2/1/11 8:11 AM, Ben Campbell wrote:
> 
>> -- Handling namespace prefix rule violations: 15 Minutes -- Matthew
>> and/or Peter
> 
> This is something that Matthew Wild and I discussed privately a few
> weeks ago. I'll send a message to the list summarizing our discussion
> and conclusions.

Matthew and I had a long off-list discussion about this several weeks
ago. At issue is this paragraph in Section 4.8.5 of 3920bis:

   An XMPP entity MUST NOT accept data that violates this rule (in
   particular, an XMPP server MUST NOT route or deliver such data to
   another entity); instead it MUST either ignore the data or close the
   stream with a stream error, which SHOULD be <bad-namespace-prefix/>
   (Section 4.9.3.2).

Matthew pointed out to me that some XMPP servers are able to accept such
data because they (or the XML parser they use) transform the prefixed
data into an unprefixed stanza based on the qualifying namespace. That
is, the server essentially corrects the violation, which means that the
paragraph as it stands probably violates Postel's Law ("be liberal in
what you accept and conservative in what you send").

After some back-and-forth with Matthew, I suggested the following paragraph:

   If an XMPP entity receives data that violates this rule, it MAY
   refuse to accept the data because the data is inconsistent with the
   prefixing context that the sending entity established when it sent
   the stream header for its outbound stream; i.e., the entity MAY
   either ignore the data or close the stream with a stream error,
   which SHOULD be <bad-namespace-prefix/>.  If an XMPP server accepts
   such data and routes or delivers the data over an output stream to
   another entity, then it MUST transform the data into a legitimate
   stanza whose prefixing context is the same as that of the output
   stream (e.g., an unprefixed stanza if a content namespace was
   declared as the default namespace for the output stream).

I know that Matthew still has concerns with that paragraph, so I will
let him post to the list in reply.

My major concern here is that the text about namespace prefixing is a
bit fragile and that I think we need more implementation and deployment
experience with prefix-free canonicalization at the stream level before
we can provide solid text here. That's why I suggested to Matthew that
we postpone dealing with this issue until we work on "3920ter" (i.e.,
the hopefully-small revisions to 3920bis). IMHO there are just too many
unknowns here, and we could have some very long mailing list threads (as
we have in the past) without coming to consensus at this time.

Furthermore, I remind you all of the obvious: 3920bis has been approved
for publication, so we need to make sure that any changes are,
preferably, editorial in nature or quite small in scope.

With that in mind, one small change we could make would be to change
MUST to SHOULD and MUST NOT to SHOULD NOT, plus add some clarifying
words to the parenthetical clause:

   An XMPP entity SHOULD NOT accept data that violates this rule (in
   particular, an XMPP server MUST NOT route or deliver such data to
   another entity without correcting the violation); instead it SHOULD
   either ignore the data or close the stream with a stream error,
   which SHOULD be <bad-namespace-prefix/> (Section 4.9.3.2).

This allows a server to be liberal in what it accepts, while mandating
that it needs to be conservative in what it sends to other entities even
if it accepts such data.

Personally, I think that's the best we're going to do right now, and
that we should revisit this topic when we revise 3920bis. But let's not
get into major surgery on 3920bis at this point, because the time for
that is past.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/