XEP-0283: Moved

Abstract:This document defines an XMPP protocol extension that enables a user to inform its contacts about a change in JID.
Author:Tory Patnoe
Copyright:© 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.1
Last Updated:2010-06-16

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.


Table of Contents


1. Introduction
2. Requirements
3. The Move
    3.1. Unsubscribing the original JID from outbound subscriptions
    3.2. Unsubscribing the original JID from inbound subscriptions
    3.3. Subscribing the new JID to all your existing contacts
    3.4. Contacts Offline at the Time the Rename Occurs
    3.5. Presence Ordering
    3.6. Preservation of Groups
    3.7. One-way subcriptions and full roster state
       3.7.1. One-way Inbound subscription
       3.7.2. One-way Outbound subscription
       3.7.3. Roster state and action table
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
    6.1. Protocol Namespaces
    6.2. Protocol Versioning
7. XML Schema
8. 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


1. Introduction

There are a variety of reasons why a user may wish to change their JID. For example, a surname change because of marriage or simply an easier JID to remember.

This XEP defines an approach for communicating that your JID has moved to a new JID, extending the existing subscription protocol documented in RFC 3921 [1]. The steps outlined here may be done either through a client or automated by a server.

2. Requirements

3. The Move

In this scenario user@example.com moves to user2@example2.com. Both the user@example.com and user2@example2.com accounts have been created and still exist. The roster for user@example2.com is empty and the user wants to populate it with their entries from user@example.com.

original JID
user@example.com
new JID
user2@example2.com

3.1 Unsubscribing the original JID from outbound subscriptions

Because the original JID is no longer going to be used, the user SHOULD unsubscribe from all the outbound subscriptions user@example.com had. These can be identified as those in the 'to' or 'ask' states as defined in the 'jabber:iq:roster' protocol in RFC 3921 [4].

To unsubscribe all outbound subscriptions for the original JID send an unsubscribe <presence/> stanza to all the old contacts with a <moved/> element containing the new JID.

There is the potential for other users to send a malicious unsubscribe containing a spoofed <moved/> JID. Therefore, clients SHOULD NOT automatically subscribe to the JID contained in the <moved/> stanza when receiving a subscribe <presence/> stanza without displaying the <moved/> JID to the user. See the Security Considerations section for details.

Example 1. Client unsubscribes outbound subscriptions from original JID


<presence from='user@example.com' to='contact@example.com' type='unsubscribe'>
    <status>I've changed JIDs from user@example.com to user2@example2.com</status>
    <moved xmlns='urn:xmpp:moved:0' new='user2@example2.com'/>
</presence>

    

3.2 Unsubscribing the original JID from inbound subscriptions

Because the original JID is no longer going to be used, the user SHOULD unsubscribe from all contacts the user@example.com had an inbound subscription from. These can be identified as those in the 'from' subscription state as defined in in the 'jabber:iq:roster' protocol in RFC 3921 [5].

To unsubscribe all inbound subscriptions send an unsubscribed <presence/> stanza to all the old contacts with a <moved/> element containing the new JID.

There is the potential for other users to send a malicious unsubscribed containing a spoofed <moved/> JID. Therefore, clients SHOULD NOT automatically subscribe to the JID contained in the <moved/> stanza without displaying the <moved/> JID to the user. See the Security Considerations section for details.

Example 2. Client unsubscribes inbound subscriptions from original JID


<presence from='user@example.com' to='contact@example.com' type='unsubscribed'>
    <status>I've changed JIDs from user@example.com to user2@example2.com</status>
    <moved xmlns='urn:xmpp:moved:0' new='user2@example2.com'/>
</presence>

    

3.3 Subscribing the new JID to all your existing contacts

Once the new JID has been created on a server it is possible for the new JID to subscribe to the contacts they had on the original JID's roster. This is done by sending a new subscription request with a <moved/> element containing the new JID.

The new subscription MUST come from the new JID's server.

There is the potential for other users to send a malicious subscribe request and spoof the content of the <moved/> element identifying an original JID. Therefore, clients SHOULD NOT automatically unsubscribe an existing roster entry if is listed as the target in the <moved/> element when a subscribe is received. See the Security Consideration section for details.

Clients accepting the moved subscription SHOULD indicate to the user that that this subscription request was the result of a move operation and because of potential malicious behavior SHOULD NOT auto-accept the subscription without displaying the <moved/> JID to the user.

Example 3. Client requests subscription from new JID

  
  <presence from='user2@example2.com' to='contact@example.com' type='subscribe'>
      <status>I've changed JIDs from user@example.com to user2@example2.com</status>
      <moved xmlns='urn:xmpp:moved:0' old='user@example.com'/>
  </presence>
  
      

3.4 Contacts Offline at the Time the Rename Occurs

rfc3920bis [6] clarifies that an incoming subscribe <presence/> stanza MUST be preserved by the server and <presence/> stanzas of type unsubscribe and unsubscribed are not preserved on the server. Therefore, for a contact who is offline, their servers MAY have automatically removed the original roster entry when seeing the unsubscribe and unsubscribed stanzas. At the time of writing this XEP, NOT saving and forwarding the presence stanzas will be the default behavior of most servers.

What this means is that a contact coming online after the rename outlined above MAY only see the <presence/> of type 'subscribe' with the <moved/> element. Clients should be aware of this behavior.

3.5 Presence Ordering

In following the principle of least surprise, it is considered good practice to send the subscribe stanza after the unsubscribe and unsubscribed stanzas.

3.6 Preservation of Groups

One of the side effects of this scheme is the potential for a contact to lose the groups to which it had organized the original JID. Clients aware of the <moved/> element can mitigate this with the following rules.

As discussed in 'Contacts Offline at the Time the Rename Occurs', a server MAY automatically handle the unsubscribe and unsubscribed stanzas. If this occurs it will be impossible to preserve the original groups.

3.7 One-way subcriptions and full roster state

3.7.1 One-way Inbound subscription

If the original JID, user@example.com, had only an inbound subscription (from or pending in), then the contact will only receive an unsubscribed <presence/> stanza. The contact's client, knowing the state of the subscription (which is 'to' or 'none' with 'ask='subscribe' from the contact's perspective), at that point MAY choose to prompt the user to subscribe to the new JID listed in the <moved/> element.

Because of the ability to spoof the <moved/> element, the client SHOULD NOT automatically subscribe to the <moved/> element target, but SHOULD present the new JID to the contact before sending out a subscription request.

3.7.2 One-way Outbound subscription

If the original JID, user@example.com, had only an outbound subscription (to or ask), then the contact SHOULD only receive an unsubscribe <presence/> stanza. The contact's client, knowing the state of the subscription (which is 'from' from the contact's perspective), at that point MAY choose to prompt the user to subscribe to the new JID listed in the <moved/> element.

Because of the ability to spoof the <moved/> element, the client SHOULD NOT automatically subscribe to the <moved/> element target

.

3.7.3 Roster state and action table

Table 1: Roster states and actios from the renamed user's perspective

Server state Client state (jabber:iq:roster) Send unsubscribe from original JID Send unsubscribed from original JID Send subscribe from new JID
none none
none + pending out none + ask='subscribe' yes yes
none + pending in n/a yes - server only
none + pending in/out none + ask='subscribe' yes yes - server only yes
to to yes yes
to + pending in to yes yes - server only yes
from from yes
from + pending out from/none + ask='subscribe' yes yes yes
both both yes yes yes

4. Security Considerations

It is not intended for servers to strip any <moved/> elements from <presence/> stanzas sent in from a client. This allows clients as well as servers to implement these same procedures.

In order to prevent other users from maliciously altering contacts the client SHOULD NOT automatically subscribe to a <moved/> JID when it receives an unsubscribe and SHOULD NOT automatically unsubscribe to a <moved/> JID when it receives a subscribe.

The following illustrates an example malicious attack.

  1. userA@example.com subscribes to userB@example.com
  2. The userB@example.com automatically accepts the subscription from userA@example.com. (Automatically done by the client using a simple domain trust).
  3. userA@example.com unsubscribes with the <moved/> 'new' JID set to companyCEO@example.com.
  4. The previous steps can be repeated and have userB@example.com subscribe to a large number of people.

A similar attack can be done with a new subscribe request causing users by guessing which users are subscribed to a contact.

  1. hacker@example.com subscribes to userB@example.com guessing that userA@example.com is on userB's roster. <presence from='hacker@example.com' to='userB@example.com' type='subscribe'> <status>Subscribe to me!</status> <moved xmlns='urn:xmpp:moved:0' old='userA@example.com'/> </presence>
  2. If userB's client automatically accepted the subscription without displaying at prompt to userB showing the new JID to be hacker@example.com, then the user has no idea that hacker@example.com was just added to the roster.

5. IANA Considerations

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

6. XMPP Registrar Considerations

6.1 Protocol Namespaces

This specification defines the following XML namespace:

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [8] shall add the foregoing namespace to the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function [9].

6.2 Protocol Versioning

If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.

7. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:moved:0'
    xmlns='urn:xmpp:moved:0'
    elementFormDefault='qualified'>

  <xs:element name='moved'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='xs:string'>
          <xs:attribute name='new' type='xs:string' use='optional'/>
          <xs:attribute name='old' type='xs:string' use='optional'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

</xs:schema>
  

8. Acknowledgements

The author wishes to thank Doug Abbink, Mikhail Belov, Peter Saint-Andre, and Peter Sheu for their feedback.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0283
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.1
Last Updated: 2010-06-16
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: moved
Source Control: HTML  RSS
This document in other formats: XML  PDF


Appendix B: Author Information

Tory Patnoe

Email: tpatnoe@cisco.com
JabberID: tpatnoe@cisco.com


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2010 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 <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc3921>.

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

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

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

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

6. rfc3920bis: proposed revisions to Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/draft-ietf-xmpp-3920bis>. (work in progress)

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

8. 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 <http://xmpp.org/registrar/>.

9. XEP-0053: XMPP Registrar Function <http://xmpp.org/extensions/xep-0053.html>.


Appendix H: Revision History

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

Version 0.1 (2010-06-16)

Initial published version.

(psa)

Version 0.0.7 (2010-06-09)

Modified syntax to use 'old' and 'new' attributes.

(tp)

Version 0.0.6 (2010-06-07)

(tp)

Version 0.0.5 (2010-06-02)

Added one-way subscription section

(tp)

Version 0.0.4 (2010-05-30)

Change MUST NOT to SHOULD NOT for clients auto-subscribing back; differentiate between inbound and outbound subscriptions.

(tp)

Version 0.0.3 (2010-06-02)

Add one-way subscription comments.

(tp)

Version 0.0.2 (2010-05-25)

Minor tweaks.

(tp)

Version 0.0.1 (2010-05-22)

First draft.

(tp)

END