Abstract: | This document specifies best practices for use of the SASL ANONYMOUS mechanism in the context of client authentication with an XMPP server. |
Author: | Peter Saint-Andre |
Copyright: | © 1999 – 2018 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Active |
Type: | Informational |
Version: | 1.2 |
Last Updated: | 2009-09-30 |
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. Introduction
2. Deployment Types
3. Recommendations
4. Protocol Flow
5. Service Discovery
6. Security Considerations
7. IANA Considerations
8. XMPP Registrar Considerations
9. Acknowledgements
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
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.
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:
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.
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.
The server SHOULD NOT allow the client to initiate communication with entities hosted at remote servers.
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.
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.
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).
The RECOMMENDED protocol flow following TLS negotiation (refer to RFC 3920) is as follows:
Client initiates stream to server.
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='example.com' version='1.0'>
Server replies with stream header.
Example 2. Stream header reply
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' id='c2s_234' from='example.com' version='1.0'>
Server advertises stream features.
Example 3. Stream features advertisement
<stream:features> <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <mechanism>DIGEST-MD5</mechanism> <mechanism>ANONYMOUS</mechanism> </mechanisms> </stream:features>
Client requests SASL ANONYMOUS mechanism.
Example 4. Requesting SASL ANONYMOUS
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/>
Server sends <success/>.
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
Client opens new stream.
Example 6. Initiating a new stream
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='example.com' version='1.0'>
Server tells client that resource binding is required.
Example 7. Stream header reply with features
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' id='c2s_345' from='example.com' version='1.0'> <stream:features> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> </stream:features>
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'/> </iq>
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'> <jid>59BEC12A-9BAB-452B-88F8-D1563F09E549@example.com/2384F02A7E01</jid> </bind> </iq>
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' id='kj37vd95' to='requester@example.com/foo' type='result'> <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'/> </query> </iq>
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.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [12].
This document requires no interaction with the XMPP Registrar [13].
Thanks to Dave Cridland, Tuomas Koski, Jack Moffitt, Andy Skelton, and Kurt Zeilenga for their feedback.
Series: XEP
Number: 0175
Publisher: XMPP Standards Foundation
Status:
Active
Type:
Informational
Version: 1.2
Last Updated: 2009-09-30
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: N/A
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
xsf@stpeter.im
JabberID:
peter@jabber.org
URI:
http://stpeter.im/
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.
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>.
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".
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/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
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.
(psa)Recommended that node identifier be a UUID; recommended that trace data not be included.
(psa)Per a vote of the Jabber Council, advanced status to Active.
(psa)Initial version; modified flow to remove unecessary challenge.
(psa)First draft.
(psa)END