XEP-0170: Recommended Order of Stream Feature Negotiation

Abstract
This document specifies a recommended order for negotiation of XMPP stream features.
Author
Peter Saint-Andre
Copyright
© 1999 – 2020 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Active

NOTICE: This Informational specification defines a best practice or protocol profile that has been approved by the XMPP Council and/or the XSF Board of Directors. Implementations are encouraged and the best practice or protocol profile is appropriate for deployment in production systems.
Type
Informational
Version
1.0 (2007-01-04)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Active

1. Introduction

During its formalization of the core Jabber protocols, the IETF's XMPP WG introduced the concept of XML stream features. While the order in which features shall be negotiated is clearly defined for the features specified in RFC 3920 [1] and RFC 3921 [2], the number of possible features is open-ended (which is why the XMPP Registrar [3] maintains a registry of stream features). This document specifies the recommended order for negotiation of various stream features.

2. Client-to-Server Recommendations

2.1 Standard XMPP Features

The XMPP RFCs define an ordering for the features defined therein, namely:

  1. TLS
  2. SASL
  3. Resource binding

That order MUST be followed if no other stream features are negotiated.

2.2 Stream Compression

Stream Compression (XEP-0138) [4] is negotiated when it is not possible to set up TLS compression for whatever reason. It seems safest to negotiate stream compression after negotiation of both TLS (to safely complete the negotiation) and SASL (to prevent certain denial-of-service attacks caused by consumption of server resources for compression before the connecting entity is authenticated). Therefore the following order is RECOMMENDED:

  1. TLS
  2. SASL
  3. Stream compression
  4. Resource binding

2.3 In-Band Registration

The In-Band Registration (XEP-0077) [5] protocol can be used to establish an account before logging in. That step would be completed before SASL because an entity cannot authenticate if it does not first create an account. Therefore the following order is RECOMMENDED:

  1. TLS
  2. In-band registration
  3. SASL
  4. Resource binding

If both stream compression and in-band registration are negotiated, the following order is RECOMMENDED:

  1. TLS
  2. In-band registration
  3. SASL
  4. Stream compression
  5. Resource binding

3. Server-to-Server Recommendations

3.1 Standard XMPP Features

The XMPP RFCs define an ordering for the features defined therein, namely:

  1. TLS
  2. SASL

That order MUST be followed if no other stream features are negotiated.

3.2 Dialback

RFC 3920 requires SASL negotiation after TLS negotiation. When the certificate presented by the initiating entity makes reference to a trusted root certification authority, SASL negotiation provides meaningful authentication. In that case, the order shown above is recommended.

However, it is possible that the initiating entity will present a self-signed certificate or a certificate whose associated root certification authority is not trusted by the receiving entity. In this situation, service provisioning policies at the receiving entity may dictate the use of server dialback in order to provide a stronger level of trust for the server-to-server stream (where such trust is essentially trust in the underlying Domain Name System), even though server dialback explicitly does not provide authentication. In this case, the following order is RECOMMENDED:

  1. TLS
  2. Dialback

3.3 Stream Compression

Stream Compression (XEP-0138) [4] is negotiated when it is not possible to set up TLS compression for whatever reason. It seems safest to negotiate stream compression after negotiation of both TLS (to safely complete the negotiation) and SASL (to prevent certain denial-of-service attacks). Therefore the following order is RECOMMENDED:

  1. TLS
  2. SASL
  3. Stream compression

If stream compression is negotiated in addition to TLS and dialback, it is RECOMMENDED to negotiate it after both TLS and dialback:

  1. TLS
  2. Dialback
  3. Stream compression

4. Security Considerations

The order of negotiated stream features has security implications and may be security-critical. In particular, TLS MUST be negotiated first.

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [6].

6. XMPP Registrar Considerations

This document requires no interaction with the XMPP Registrar.


Appendices

Appendix A: Document Information

Series
XEP
Number
0170
Publisher
XMPP Standards Foundation
Status
Active
Type
Informational
Version
1.0
Last Updated
2007-01-04
Approving Body
XMPP Council
Dependencies
XMPP Core, XEP-0077, XEP-0079, XEP-0138
Supersedes
None
Superseded By
None
Short Name
N/A
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre
Email
xsf@stpeter.im
JabberID
peter@jabber.org
URI
http://stpeter.im/

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc3920>.

2. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc3921>.

3. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

4. XEP-0138: Stream Compression <https://xmpp.org/extensions/xep-0138.html>.

5. XEP-0077: In-Band Registration <https://xmpp.org/extensions/xep-0077.html>.

6. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

  1. Version 1.0 (2007-01-04)

    Per a vote of the XMPP Council, advanced status to Active.

    psa
  2. Version 0.5 (2006-12-06)

    Per Council feedback, removed section on deprecated jabber:iq:auth protocol.

    psa
  3. Version 0.4 (2006-08-02)

    Modified recommended order of for server-to-server negotiations if service provisioning requires dialback after TLS negotiation.

    psa
  4. Version 0.3 (2006-01-24)

    Split into client-to-server and server-to-server sections; specified recommended order of server-to-server negotiations.

    psa
  5. Version 0.2 (2006-01-16)

    Changed order of SASL and stream compression to reflect list discussion.

    psa
  6. Version 0.1 (2006-01-11)

    Initial version.

    psa
  7. Version 0.0.1 (2006-01-10)

    First draft.

    psa

END