This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.
This Internet-Draft will expire on November 25, 2004.
Copyright (C) The Internet Society (2004). All Rights Reserved.
This memo defines a method for end-to-end object signing and encryption in the Extensible Messaging and Presence Protocol (XMPP).
3. Securing Messages
4. Securing Presence
5. Securing Arbitrary XMPP Data
6. Rules for S/MIME Generation and Handling
7. Secure Communications Through a Gateway
8. urn:ietf:params:xml:xmpp-e2e Namespace
9. application/xmpp+xml Media Type
10. Security Considerations
11. IANA Considerations
§ Normative References
§ Informative References
§ Author's Address
A. Schema for urn:ietf:params:xml:ns:xmpp-e2e
B. Revision History
§ Intellectual Property and Copyright Statements
This memo define a method for end-to-end signing and encryption in the Extensible Messaging and Presence Protocol (XMPP). (For information about XMPP, see [XMPP-CORE] and [XMPP-IM].) The method specified herein enables a sender to encrypt and/or sign an instant message sent to a specific recipient, encrypt and/or sign presence information that is directed to a specific user, and sign presence information that is broadcasted to a specific user. This memo thereby helps the XMPP specifications meet the requirements specified in [IMP-REQS].
This document inherits terminology defined in [SMIME], [IMP-MODEL], [CMS], and [XMPP-CORE].
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [TERMS].
The authors welcome discussion and comments related to the topics presented in this document. The preferred forum is the <email@example.com> mailing list, for which archives and subscription information are available at <http://www.jabber.org/cgi-bin/mailman/listinfo/xmppwg/>.
For the purposes of this memo, we stipulate the following requirements:
In order to encrypt a message, a sending entity MUST use the following procedure:
Example 1: Sender generates "Message/CPIM" object:
Content-type: Message/CPIM From: Juliet Capulet <im:firstname.lastname@example.org> To: Romeo Montague <im:email@example.com> DateTime: 2003-12-09T11:45:36.66Z Subject: Imploring Content-type: text/plain; charset=utf-8 Content-ID: <firstname.lastname@example.org> Wherefore art thou, Romeo?
Example 2: Sender generates signed message (the 'from' address on the XMPP message stanza is stamped by sender's server):
<message email@example.com/orchard' type='chat'> <e2e xmlns='urn:ietf:params:xml:ns:xmpp-e2e'> <![CDATA[ Content-Type: multipart/signed; boundary=next; micalg=sha1; protocol=application/pkcs7-signature --next Content-type: Message/CPIM From: Juliet Capulet <im:firstname.lastname@example.org> To: Romeo Montague <im:email@example.com> DateTime: 2003-12-09T23:45:36.66Z Subject: Imploring Content-type: text/plain; charset=utf-8 Content-ID: <firstname.lastname@example.org> Wherefore art thou, Romeo? --next Content-Type: application/pkcs7-signature Content-Disposition: attachment;handling=required;filename=smime.p7s [signed body part] --next-- ]]> </e2e> </message>
In order to encrypt presence information, a sending entity MUST use the following procedure:
Example 3: Sender generates "application/pidf+xml" object:
<?xml version="1.0" encoding="UTF-8"?> <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:im="urn:ietf:params:xml:ns:pidf:im" entity="pres:email@example.com"> <tuple id="h40zny" <status> <basic>open</basic> <im:im>away</im:im> </status> <note xml:lang="en">retired to the chamber</note> <timestamp>2003-12-09T23:53:11.31</timestamp> </tuple> </presence>
Example 4: Sender generates signed presence (the 'from' address on the XMPP presence stanza is stamped by sender's server):
<presence firstname.lastname@example.org/orchard'> <e2e xmlns='urn:ietf:params:xml:ns:xmpp-e2e'> <![CDATA[ Content-Type: multipart/signed; boundary=next; micalg=sha1; protocol=application/pkcs7-signature --next Content-type: application/pidf+xml Content-ID: <email@example.com> <xml version="1.0" encoding="UTF-8"?> <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:im="urn:ietf:params:xml:ns:pidf:im" entity="pres:firstname.lastname@example.org"> <tuple id="hr0zny"> <status> <basic>open</basic> <im:im>away</im:im> </status> <note xml:lang="en">retired to the chamber</note> <timestamp>2003-12-09T23:53:11.31Z</timestamp> </tuple> </presence> --next Content-Type: application/pkcs7-signature Content-Disposition: attachment;handling=required;filename=smime.p7s [signed body part] --next-- ]]> </e2e> </presence>
The foregoing sections of this memo describe how to secure "least common denominator" messaging and presence data of the kind that can be directly translated into the MSGFMT or PIDF formats. However, XMPP possesses a third base-level stanza type (<iq/>) in addition to <message/> and <presence/>, as well as the ability to include extended XML data within arbitrary child elements of the three core stanza types. Therefore it would be desirable to secure such data if possible.
Because [MSGFMT] specifies the ability to encapsulate any MIME type, the approach taken in this memo is to include arbitrary XMPP data in an XML media type named "application/xmpp+xml" as specified more fully in Section 9 below.
The following examples illustrate the structure of the "application/xmpp+xml" MIME type.
Example 5: Message stanza with extended data contained in "application/xmpp+xml" MIME type:
<?xml version='1.0' encoding='UTF-8'?> <xmpp xmlns='jabber:client'> <message email@example.com/pda' firstname.lastname@example.org/cell'> <body> I told him what I thought, and told no more Than what he found himself was apt and true. </body> <evil xmlns='http://jabber.org/protocol/evil'/> </message> </xmpp>
Example 6: Presence stanza with extended data contained in "application/xmpp+xml" MIME type:
<?xml version='1.0' encoding='UTF-8'?> <xmpp xmlns='jabber:client'> <presence email@example.com/pda'> <show>dnd</show> <status>Fomenting dissension</status> <evil xmlns='http://jabber.org/protocol/evil'/> </presence> </xmpp>
Example 7: IQ stanza with extended data contained in "application/xmpp+xml" MIME type:
<?xml version='1.0' encoding='UTF-8'?> <xmpp xmlns='jabber:client'> <iq type='result' firstname.lastname@example.org/pda' email@example.com/cell' id='evil1'> <query xmlns='jabber:iq:version'> <name>Stabber</name> <version>666</version> <os>FiendOS</os> </query> <evil xmlns='http://jabber.org/protocol/evil'/> </iq> </xmpp>
[SMIME] does not specify how to obtain a certificate from a certificate authority, but instead mandates that every sending agent must already have a certificate. The PKIX Working Group has, at the time of this writing, produced two separate standards for certificate enrollment: [CMP] and [CMC]. Which method to use for certificate enrollment is outside the scope of this memo.
A receiving agent MUST provide some certificate retrieval mechanism in order to gain access to certificates for recipients of digital envelopes. This memo does not cover how S/MIME agents handle certificates, only what they do after a certificate has been validated or rejected. S/MIME certification issues are covered in [CERT].
At a minimum, for initial S/MIME deployment, a user agent could automatically generate a message to an intended recipient requesting that recipient's certificate in a signed return message. Receiving and sending agents SHOULD also provide a mechanism to allow a user to "store and protect" certificates for correspondents in such a way so as to guarantee their later retrieval.
End-entity certificates used by XMPP entities in the context of this memo SHOULD contain a valid instant messaging and presence address. The address SHOULD be specified as both an 'im:' URI (for instant messaging, as defined in [CPIM]) and a 'pres:' URI (for presence, as defined in [CPP]); each of these URIs SHOULD be specified in a separate GeneralName entry of type uniformResourceIdentifier inside the subjectAltName (i.e., two separate entries). Information in the subject distinguished name SHOULD be ignored.
Each URI MUST be of the form <im:address> or <pres:address>, where the "address" portion is an XMPP address (also referred to as a Jabber Identifier or JID) as defined in [XMPP-CORE], prepended with the 'im:' or 'pres:' URI scheme. The address SHOULD be of the form <node@domain> (i.e., a "bare JID"), although any valid JID form MAY be used.
The value of the JID contained in the XMPP 'from' attribute SHOULD match the JID provided in the signer's certificate, with the exception that the resource identifier portion of the JID contained in the 'from' attribute SHOULD be ignored for matching purposes.
Receiving agents SHOULD check that sending JID matches a JID provided in the signer's certificate, with the exception that the resource identifier portion of the JID contained in the 'from' attribute MAY be ignored for matching purposes. A receiving agent SHOULD provide some explicit alternate processing of the message if this comparison fails, which may be to display a message that shows the recipient the addresses in the certificate or other certificate details.
The subject alternative name extension is used in S/MIME as the preferred means to convey the instant messaging and presence address that corresponds to the entity for this certificate. Any instant messaging or presence address present in the certificate SHOULD be encoded using the otherName choice of the subjectAltName type along with a type-id of "xmpp" (as these terms are profiled in [X509]).
Because it is expected that XMPP applications will not interface with older 7-bit systems, the transfer encoding (as defined in Section 3.1.2 of [SMIME]) MUST be "binary".
Sending agents SHOULD attach a signature to each encrypted message or presence stanza. If a signature is attached, a Content-Disposition header field (as defined in [DISP]) SHOULD be included to specify how the signature is to be handled by the receiving application.
If the sender and recipient are involved in an active messaging session over a period of time, the sending agent SHOULD include the sender's certificate along with at least one encrypted message stanza every five minutes. Outside the context of an active messaging session, the sending agent SHOULD include the sender's certificate along with each encrypted message stanza. A sending agent MAY include the sender's certificate along with each encrypted presence stanza. However, a sending agent SHOULD NOT include a certificate more than once every five minutes.
If a stanza is both signed and encrypted, it SHOULD be signed first, then encrypted.
Timestamps are included in "Message/CPIM" and "application/pidf+xml" objects to help prevent replay attacks. All timestamps MUST conform to [DATETIME] and be presented as UTC with no offset, including fractions of a second as appropriate. Absent a local adjustment to the sending application's perceived time or the underlying clock time, the sending application MUST ensure that the timestamps it sends to the receiver increase monotonically (if necessary by incrementing the seconds fraction in the timestamp if the clock returns the same time for multiple requests). The following rules apply to the receiving application:
At a minimum, all implementations MUST support the following CMS algorithms as defined in [CMS-ALG]:
- for digest:
- for signing:
- for content encryption:
A common method for achieving interoperability between two disparate services is through the use of a "gateway" that interprets the protocols of each service and translates them into the protocols of the other. The CPIM specifications (specifically [MSGFMT] and [PIDF] define the common profiles to be used for interoperability between instant messaging and presence services that comply with [IMP-REQS]. In the case of communications between an XMPP service and a non-XMPP service, we can visualize this relationship as follows:
+-------------+ +-------------+ +------------+ | | | | | | | XMPP | | XMPP-CPIM | | Non-XMPP | | Service | <----> | Gateway | <----> | Service | | | | | | | +-------------+ +-------------+ +------------+
The end-to-end encryption method defined herein enables the exchange of encrypted and/or signed instant messages and presence through an XMPP-CPIM gateway. In particular:
The wrapped S/MIME object MUST be immutable and MUST NOT be modified by an XMPP-CPIM gateway.
The <e2e xmlns='urn:ietf:params:xml:ns:xmpp-e2e'/> element is a wrapper for an XML CDATA section (as specified in Section 2.7 of [XML]) that contains a "Message/CPIM", "application/pidf+xml", or "application/xmpp+xml" object. Thus the 'urn:ietf:params:xml:xmpp-e2e' namespace has no inherent semantics, and the semantics of the encapsulated object are defined by one of the following specifications:
Although the "application/xmpp+xml" media type is specified in this document, the <xmpp/> element is simply a wrapper for a <message/>, <presence/>, or <iq/> stanza, where the semantics of those stanza types are specified in [XMPP-CORE].
Given that the 'urn:ietf:params:xml:ns:xmpp-e2e' namespace has no inherent semantics and specifies a using protocol only, versioning is the responsibility of the protocols that define the encapsulated objects ([MSGFMT], [PIDF], and [XMPP-CORE]).
The "application/xmpp+xml" media type adheres to the guidelines specified in [XML-MEDIA]. The root element for this MIME type is <xmpp/>, and the root element MUST contain one and only one child element, corresponding to one of the XMPP stanza types (i.e., message, presence, or iq) if the default namespace is 'jabber:client' or 'jabber:server' as defined in [XMPP-CORE]. The character encoding for this XML media type MUST be UTF-8, in accordance with Section 11.5 of [XMPP-CORE].
This entire memo discusses security. Detailed security considerations for instant messaging and presence protocols are given in [IMP-REQS] (Sections 5.1 through 5.4), and for XMPP in particular are given in [XMPP-CORE] (Sections 12.1 through 12.6). In addition, all of the security considerations specified in [XML-MEDIA] apply to the "application/xmpp+xml" media type.
The end-to-end security method defined here MAY result in exchanging secured instant messages and presence information through a gateway that implements the CPIM specifications. Such a gateway MUST be compliant with the minimum security requirements of the instant messaging and presence protocols with which it interfaces.
A URN sub-namespace for signed and encrypted content in the Extensible Messaging and Presence Protocol (XMPP) is defined as follows. (This namespace name adheres to the format defined in [XML-REG].)
- This is the XML namespace name for signed and encrypted content in the Extensible Messaging and Presence Protocol as defined by XXXX.
- Registrant Contact:
- IESG, <firstname.lastname@example.org>
Subject: Registration of MIME media type application/xmpp+xml
- MIME media type name: application
- MIME subtype name: xmpp+xml
- Required parameters: (none)
- Optional parameters: (charset)
- Same as charset parameter of application/xml as specified in RFC 3023; per Section 11.5 of [draft-ietf-xmpp-core-24], the charset must be UTF-8.
- Encoding considerations:
- Same as encoding considerations of application/xml as specified in RFC 3023; per Section 11.5 of [draft-ietf-xmpp-core-24], the encoding must be UTF-8.
- Security considerations:
- All of the security considerations specified in RFC 3023 and [draft-ietf-xmpp-core-24] apply to this XML media type. Refer to Section 10 of XXXX.
- Interoperability considerations: (none)
- Applications which use this media type:
- XMPP-compliant instant messaging and presence systems.
- Additional information: (none)
- Person and email address to contact for further information:
- IESG, <email@example.com>
- Intended usage:
- Author/Change controller:
- IETF, XMPP Working Group
|[CERT]||Ramsdell, B., "S/MIME Version 3 Certificate Handling", RFC 2632, June 1999.|
|[CMC]||Blaze, M., Ioannidis, J. and A. Keromytis, "DSA and RSA Key and Signature Encoding for the KeyNote Trust Management System", RFC 2792, March 2000.|
|[CMP]||Adams, C. and S. Farrell, "Internet X.509 Public Key Infrastructure Certificate Management Protocols", RFC 2510, March 1999.|
|[CMS]||Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3369, August 2002.|
|[CMS-ALG]||Housley, R., "Cryptographic Message Syntax (CMS) Algorithms", RFC 3370, August 2002.|
|[CPIM]||Crocker, D. and J. Peterson, "Common Profile for Instant Messaging (CPIM)", draft-ietf-impp-im-03 (work in progress), May 2003.|
|[CPP]||Crocker, D. and J. Peterson, "Common Profile for Presence (CPP)", draft-ietf-impp-pres-03 (work in progress), May 2003.|
|[DATETIME]||Klyne, G. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002.|
|[DISP]||Troost, R., Dorner, S. and K. Moore, "Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field", RFC 2183, August 1997 (TXT, HTML, XML).|
|[IMP-MODEL]||Day, M., Rosenberg, J. and H. Sugano, "A Model for Presence and Instant Messaging", RFC 2778, February 2000.|
|[IMP-REQS]||Day, M., Aggarwal, S. and J. Vincent, "Instant Messaging / Presence Protocol Requirements", RFC 2779, February 2000.|
|[MSGFMT]||Atkins, D. and G. Klyne, "Common Presence and Instant Messaging: Message Format", draft-ietf-impp-cpim-msgfmt-08 (work in progress), January 2003.|
|[MULTI]||Galvin, J., Murphy, S., Crocker, S. and N. Freed, "Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", RFC 1847, October 1995.|
|[PIDF]||Fujimoto, S., Sugano, H., Klyne, G., Bateman, A., Carr, W. and J. Peterson, "Presence Information Data Format", draft-ietf-impp-cpim-pidf-08 (work in progress), May 2003.|
|[SMIME]||Ramsdell, B., "S/MIME Version 3 Message Specification", RFC 2633, June 1999.|
|[TERMS]||Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.|
|[X509]||Housley, R., Polk, W., Ford, W. and D. Solo, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 3280, April 2002.|
|[XML]||Bray, T., Paoli, J., Sperberg-McQueen, C. and E. Maler, "Extensible Markup Language (XML) 1.0 (2nd ed)", W3C REC-xml, October 2000.|
|[XML-MEDIA]||Murata, M., St. Laurent, S. and D. Kohn, "XML Media Types", RFC 3023, January 2001.|
|[XMPP-CORE]||Saint-Andre, P., "XMPP Core", draft-ietf-xmpp-core-24 (work in progress), May 2004.|
|[XMPP-IM]||Saint-Andre, P., "XMPP Instant Messaging", draft-ietf-xmpp-im-22 (work in progress), May 2004.|
|[XML-REG]||Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.|
|[XMPP-CPIM]||Saint-Andre, P., "Mapping the Extensible Messaging and Presence Protocol (XMPP) to Common Presence and Instant Messaging (CPIM)", draft-ietf-xmpp-cpim-05 (work in progress), May 2004.|
|Jabber Software Foundation|
The following XML schema is descriptive, not normative.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:ietf:params:xml:ns:xmpp-e2e' xmlns='urn:ietf:params:xml:ns:xmpp-e2e' elementFormDefault='qualified'> <xs:element name='e2e' type='xs:string'/> </xs:schema>
Note to RFC Editor: please remove this entire appendix, and the corresponding entries in the table of contents, prior to publication.
The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director.
Copyright (C) The Internet Society (2004). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Funding for the RFC Editor function is currently provided by the Internet Society.