XEP-0175: Best Practices for Use of SASL ANONYMOUS

This document specifies best practices for use of the SASL ANONYMOUS mechanism in the context of client authentication with an XMPP server.
Peter Saint-Andre
© 2006 – 2009 XMPP Standards Foundation. SEE LEGAL NOTICES.


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.
1.2 (2009-09-30)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Active

1. Introduction

XMPP Core [1] allows XMPP server implementations to support any SASL mechanism (see RFC 4422 [2]) when authenticating clients. This document provides recommendations regarding use of the SASL ANONYMOUS mechanism (see RFC 4505 [3]) in XMPP systems.

2. Deployment Types

XMPP server implementations can be deployed in a variety of settings. Although it is difficult to provide recommendations for every kind of XMPP deployment, this document attempts to strike a balance between more and less controlled settings by defining three different deployment types:

3. Recommendations

An XMPP server implementation SHOULD NOT enable the SASL ANONYMOUS mechanism by default, but instead SHOULD force the administrator of a given service to explicitly enable support in the context of that deployment.

When a client authenticates using SASL ANONYMOUS, an XMPP server SHOULD assign a temporary, unique bare JID <localpart@domain.tld> to the client. Although the method for ensuring the uniqueness of the localpart is a matter of implementation, it is RECOMMENDED for the localpart to be a UUID as specified in RFC 4122 [4].

Although RFC 4505 allows the client to provide so-called "trace data" when authenticating via SASL ANONYMOUS, it is NOT RECOMMENDED for the client to include trace data as the XML character data of the <auth/> element (instead, the <auth/> element SHOULD be empty). However, if trace data is included, the server MUST NOT use it for any purpose other than tracing (e.g., not use it as the resource identifier of the anonymous user's full JID).

Because an anonymous user is unknown to the server, the server SHOULD appropriately restrict the user's access in order to limit the possibility of malicious behavior (such as denial of service attacks as described in Best Practices to Discourage Denial of Service Attacks (XEP-0205) [5]), especially on public deployments. The following restrictions are encouraged on public deployments. Administrators of private deployments and specialized deployments are advised to take these restrictions into account when configuring their services, but can reasonably relax these restrictions if they have appropriate access controls in place or their deployment requirements cannot be met using the more restrictive profile applied in public deployments.

  1. During resource binding, the server MAY ignore the resource identifier provided by the client (if any) and instead assign a resource identifier that it generates on behalf of the client.

  2. The server SHOULD NOT allow the client to initiate communication with entities hosted at remote servers.

  3. The server MAY allow the client to establish relationships with local services and users; such relationships might include presence subscriptions and roster additions (see XMPP IM [6]), Multi-User Chat (XEP-0045) [7] registrations, and Publish-Subscribe (XEP-0060) [8] subscriptions. (Note that allowing presence subscriptions and roster additions can create a sub-optimal user experience for the added contacts.) However, if the server permits such relationships, it MUST cancel them when the client's session ends.

  4. The server MAY allow the client to store information on the server for the purpsoe of providing an optimal user experience (e.g., storage of client preferences using Private XML Storage (XEP-0049) [9]). However, if the server allows this, it SHOULD remove such information when the client's session ends.

  5. The server SHOULD NOT allow the client to send large numbers of XMPP stanzas or otherwise use large amounts of system resources (e.g., by binding multiple resource identifiers or creating multiple SOCKS5 Bytestreams (XEP-0065) [10] sessions).

4. Protocol Flow

The RECOMMENDED protocol flow following TLS negotiation (refer to RFC 3920) is as follows:

  1. Client initiates stream to server.

    Example 1. Stream initiation
  2. Server replies with stream header.

    Example 2. Stream header reply
  3. Server advertises stream features.

    Example 3. Stream features advertisement
      <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
  4. Client requests SASL ANONYMOUS mechanism.

    Example 4. Requesting SASL ANONYMOUS
    <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/>
  5. Server sends <success/>.

    Example 5. Sending success
    <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
  6. Client opens new stream.

    Example 6. Initiating a new stream
  7. Server tells client that resource binding is required.

    Example 7. Stream header reply with features
      <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
  8. Client requests that server create a resource for it.

    Example 8. Requesting resource creation
    <iq type='set' id='bind_1'>
      <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
  9. Server replies with full JID.

    Example 9. Server informs client of full JID
    <iq type='result' id='bind_1'>
      <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>

5. Service Discovery

A server MUST reply to a Service Discovery (XEP-0030) [11] information ("disco#info") request sent to the bare JID <localpart@domain.tld> of the user with an identity of "account/anonymous", as shown in the following example.

Example 10. Server informs client of full JID
<iq from='59BEC12A-9BAB-452B-88F8-D1563F09E549@example.com'
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity category='account' type='anonymous'/>
    <feature var='http://jabber.org/protocol/disco#info'/>
    <feature var='http://jabber.org/protocol/disco#items'/>

6. Security Considerations

The security considerations discussed in RFC 3920 and RFC 4505 apply to the use of SASL ANONYMOUS in XMPP; specific suggestions regarding usage restrictions for anonymous users are provided under the Recommendations section of this document.

7. IANA Considerations

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

8. XMPP Registrar Considerations

This document requires no interaction with the XMPP Registrar [13].

9. Acknowledgements

Thanks to Dave Cridland, Tuomas Koski, Jack Moffitt, Andy Skelton, and Kurt Zeilenga for their feedback.


Appendix A: Document Information

XMPP Standards Foundation
Last Updated
Approving Body
XMPP Council
Superseded By
Short Name
Source Control

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre


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


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 <https://xmpp.org/community/> 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 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.

2. RFC 4422: Simple Authentication and Security Layer (SASL) <http://tools.ietf.org/html/rfc4422>.

3. RFC 4505: The SASL ANONYMOUS Mechanism <http://tools.ietf.org/html/rfc4505>.

4. RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace <http://tools.ietf.org/html/rfc4122>.

5. XEP-0205: Best Practices to Discourage Denial of Service Attacks <https://xmpp.org/extensions/xep-0205.html>.

6. RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc6121>.

7. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.

8. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.

9. XEP-0049: Private XML Storage <https://xmpp.org/extensions/xep-0049.html>.

10. XEP-0065: SOCKS5 Bytestreams <https://xmpp.org/extensions/xep-0065.html>.

11. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

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

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

Appendix H: Revision History

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

  1. Version 1.2 (2009-09-30)

    Provided more detailed recommendations regarding usage restrictions for anonymous users, including the concept of different deployment types; added note about the account/anonymous service discovery identity.

  2. Version 1.1 (2007-11-07)

    Recommended that node identifier be a UUID; recommended that trace data not be included.

  3. Version 1.0 (2006-09-20)

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

  4. Version 0.1 (2006-02-09)

    Initial version; modified flow to remove unecessary challenge.

  5. Version 0.0.1 (2006-01-24)

    First draft.


Appendix I: Bib(La)TeX Entry

  title = {Best Practices for Use of SASL ANONYMOUS},
  author = {Saint-Andre, Peter},
  type = {XEP},
  number = {0175},
  version = {1.2},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0175.html},
  date = {2006-01-24/2009-09-30},