Skip to main content

Use of Transport Layer Security (TLS) in the Extensible Messaging and Presence Protocol (XMPP)
draft-saintandre-xmpp-tls-03

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft whose latest revision state is "Replaced".
Author Peter Saint-Andre
Last updated 2013-12-17
Replaced by draft-ietf-uta-xmpp, RFC 7590
RFC stream (None)
Formats
Additional resources
Stream Stream state (No stream defined)
Consensus boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date (None)
Responsible AD (None)
Send notices to (None)
draft-saintandre-xmpp-tls-03
Network Working Group                                     P. Saint-Andre
Internet-Draft                                       Cisco Systems, Inc.
Updates: 6120 (if approved)                            December 17, 2013
Intended status: Standards Track
Expires: June 20, 2014

 Use of Transport Layer Security (TLS) in the Extensible Messaging and
                        Presence Protocol (XMPP)
                      draft-saintandre-xmpp-tls-03

Abstract

   This document provides recommendations for the use of Transport Layer
   Security (TLS) in the Extensible Messaging and Presence Protocol
   (XMPP).  This document updates RFC 6120.

Status of this Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

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

   This Internet-Draft will expire on June 20, 2014.

Copyright Notice

   Copyright (c) 2013 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Saint-Andre               Expires June 20, 2014                 [Page 1]
Internet-Draft                  XMPP TLS                   December 2013

Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  Terminology  . . . . . . . . . . . . . . . . . . . . . . . . .  3
   3.  Discussion Venue . . . . . . . . . . . . . . . . . . . . . . .  3
   4.  Recommendations  . . . . . . . . . . . . . . . . . . . . . . .  3
     4.1.  Support for TLS  . . . . . . . . . . . . . . . . . . . . .  3
     4.2.  Protocol Versions  . . . . . . . . . . . . . . . . . . . .  4
     4.3.  Cipher Suites  . . . . . . . . . . . . . . . . . . . . . .  4
     4.4.  Public Key Length  . . . . . . . . . . . . . . . . . . . .  6
     4.5.  Certificate Validation . . . . . . . . . . . . . . . . . .  6
     4.6.  Unauthenticated Connections  . . . . . . . . . . . . . . .  6
     4.7.  Server Name Indication . . . . . . . . . . . . . . . . . .  7
     4.8.  Session Resumption . . . . . . . . . . . . . . . . . . . .  7
     4.9.  Compression  . . . . . . . . . . . . . . . . . . . . . . .  7
     4.10. Human Factors  . . . . . . . . . . . . . . . . . . . . . .  8
   5.  Implementation Notes . . . . . . . . . . . . . . . . . . . . .  8
   6.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . .  8
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . .  8
   8.  References . . . . . . . . . . . . . . . . . . . . . . . . . .  8
     8.1.  Normative References . . . . . . . . . . . . . . . . . . .  8
     8.2.  Informative References . . . . . . . . . . . . . . . . . .  9
   Appendix A.  Acknowledgements  . . . . . . . . . . . . . . . . . . 10
   Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 10

Saint-Andre               Expires June 20, 2014                 [Page 2]
Internet-Draft                  XMPP TLS                   December 2013

1.  Introduction

   The Extensible Messaging and Presence Protocol (XMPP) [RFC6120]
   (along with its precursor, the so-called "Jabber protocol") has used
   Transport Layer Security (TLS) [RFC5246] (along with its precursor,
   Secure Sockets Layer or SSL) since 1999.  Both [RFC6120] and its
   predecessor [RFC3920] provided recommendations regarding the use of
   TLS in XMPP.  In order to address the evolving threat model on the
   Internet today (see, for example, [I-D.trammell-perpass-ppa]), this
   document provides stronger recommendations (see also
   [I-D.sheffer-tls-bcp]).  This document updates [RFC6120].

2.  Terminology

   Various security-related terms are to be understood in the sense
   defined in [RFC4949].

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   [RFC2119].

3.  Discussion Venue

   The discussion venue for this document is the mailing list of the
   XMPP Working Group, for which archives and subscription information
   can be found at <https://www.ietf.org/mailman/listinfo/xmpp>.
   Discussion might also occur on the mailing list of the UTA Working
   Group, for which archives and subscription information can be found
   at <https://www.ietf.org/mailman/listinfo/uta>.

4.  Recommendations

4.1.  Support for TLS

   Support for TLS (specifically, the XMPP profile of STARTTLS) is
   mandatory for XMPP implementations, as already specified in [RFC6120]
   and its predecessor [RFC3920].

   If the server to which an XMPP client or peer server connects does
   not offer a stream feature of <starttls
   xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> (thus indicating that it is
   an XMPP 1.0 server that supports TLS), the initiating entity MUST NOT
   proceed with the stream negotiation and MUST instead abort the
   connection attempt.  Although XMPP servers SHOULD include the

Saint-Andre               Expires June 20, 2014                 [Page 3]
Internet-Draft                  XMPP TLS                   December 2013

   <required/> child element to indicate that negotiation of TLS is
   mandatory, clients and peer servers MUST NOT depend on receiving the
   <required/> flag in determining whether TLS will be enforced for the
   stream.

4.2.  Protocol Versions

   It is important both to stop using old, less secure versions of SSL/
   TLS and to start using modern, more secure versions.  Therefore:

   o  XMPP implementations MUST NOT negotiate SSL version 2.

      Rationale: SSLv2 has serious security vulnerabilities [RFC6176].

   o  XMPP implementations SHOULD NOT negotiate SSL version 3.

      Rationale: SSLv3 [RFC6101] was an improvement over SSLv2 and
      plugged some significant security holes, but did not support
      strong cipher suites.

   o  XMPP implementations SHOULD NOT negotiate TLS version 1.0
      [RFC2246].

      Rationale: TLS 1.0 (published in 1999) includes a way to downgrade
      the connection to SSLv3 and does not support more modern, strong
      cipher suites.

   o  XMPP implementations MAY negotiate TLS version 1.1 [RFC4346].

      Rationale: TLS 1.1 (published in 2006) prevents downgrade attacks
      to SSL, but does not support certain stronger cipher suites.

   o  XMPP implementations MUST support, and prefer to negotiate, TLS
      version 1.2 [RFC5246].

      Rationale: Several stronger cipher suites are available only with
      TLS 1.2 (published in 2008).

   As of the date of this writing, the latest version of TLS is 1.2.
   When TLS is updated to a newer version, this document will be updated
   to recommend support for the latest version.  If this document is not
   updated in a timely manner, it can be assumed that support for the
   latest version of TLS is recommended.

4.3.  Cipher Suites

   NOTE: Currently this document provides its own recommendations
   regarding TLS cipher suites.  However, eventually it will be updated

Saint-Andre               Expires June 20, 2014                 [Page 4]
Internet-Draft                  XMPP TLS                   December 2013

   to instead reference [I-D.sheffer-tls-bcp].

   It is important both to stop using old, insecure cipher suites and to
   start using modern, more secure cipher suites.  Therefore:

   o  XMPP implementations MUST NOT negotiate the NULL cipher suites.

      Rationale: The NULL cipher suites offer no encryption whatsoever
      and thus are completely insecure.

   o  XMPP implementations MUST NOT negotiate RC4 cipher suites

      Rationale: The RC4 stream cipher has a variety of cryptographic
      weaknesses, as documented in [I-D.popov-tls-prohibiting-rc4].

   o  XMPP implementations MUST NOT negotiate cipher suites offering
      only so-called "export-level" encryption (including algorithms
      with 40 bits or 56 bits of security).

      Rationale: These cipher suites are deliberately "dumbed down" and
      are very easy to break.

   o  XMPP implementations MUST NOT negotiate cipher suites that use
      algorithms offering less than 128 bits of security (even if they
      advertise more bits, such as the 168-bit 3DES cipher suites).

      Rationale: Although these cipher suites are not actively subject
      to breakage, their useful life is short enough that stronger
      cipher suites are desirable.

   o  XMPP implementations SHOULD prefer cipher suites that use
      algorithms with at least 256 bits of security.

      Rationale: The useful life of such cipher suites is probably at
      least 3-5 years.

   o  XMPP implementations MUST support, and SHOULD prefer to negotiate,
      cipher suites offering authentication, such as the "AES-GCM"
      family.

      Rationale: Authenticated connections are better than
      unauthenticated connections (although, as explained under
      Section 4.6, unauthenticated connections are better than nothing).

   o  XMPP implementations MUST support, and SHOULD prefer to negotiate,
      cipher suites offering forward secrecy, such as those in the
      "EDH", "DHE", and "ECDHE" families.

Saint-Andre               Expires June 20, 2014                 [Page 5]
Internet-Draft                  XMPP TLS                   December 2013

      Rationale: Forward secrecy (sometimes called "perfect forward
      secrecy") prevents the recovery of information that was encrypted
      with older session keys, thus limiting the amount of time during
      which attacks can be successful.

   Given the foregoing considerations, implementation of the following
   cipher suites is RECOMMENDED:

   o  TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
   o  TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
   o  TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
   o  TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

   Unfortunately, those cipher suites are supported only in TLS 1.2.  A
   future version of this document might recommend cipher suites for
   earlier versions of TLS.

4.4.  Public Key Length

   Because Diffie-Hellman keys of 1024 bits are estimated to be roughly
   equivalent to 80-bit symmetric keys, it is better to use longer keys
   for the "DH" family of cipher suites.  Unfortunately, some existing
   software cannot handle (or cannot easily handle) key lengths greater
   than 1024 bits.  The most common workaround for these systems is to
   prefer the "ECDHE" family of cipher suites instead of the "DH"
   family, then use longer keys.  Key lengths of at least 2048 bits are
   RECOMMENDED, since they are estimated to be roughly equivalent to
   112-bit symmetric keys and might be sufficient for at least the next
   10 years.

   Note: The foregoing recommendations are preliminary and will likely
   be corrected and enhanced in a future version of this document.

4.5.  Certificate Validation

   Both the core XMPP specification [RFC6120] and the "CertID"
   specification [RFC6125] provide recommendations and requirements for
   certificate checking.  This document does not supersede those
   specifications.

4.6.  Unauthenticated Connections

   The core XMPP specification [RFC6120] states a preference for the use
   of TLS for encryption along with SASL [RFC4422] for authentication.
   In general, it is preferable for a connection to be authenticated,
   including proper identity checking as defined by the "CertID"
   specification [RFC6125].  However, given the pervasiveness of passive
   eavesdropping, even an unauthenticated connection might be better

Saint-Andre               Expires June 20, 2014                 [Page 6]
Internet-Draft                  XMPP TLS                   December 2013

   than an unencrypted connection (this is similar to the "better than
   nothing security" approach for IPsec [RFC5386]).  In particular,
   given current deployment challenges for authenticated connections
   between XMPP servers (see [I-D.ietf-xmpp-dna] for details), it might
   be reasonable for XMPP server implementations to accept
   unauthenticated connections when the Server Dialback protocol
   [XEP-0220] is used for weak identity verification; this will at least
   enable encryption of server-to-server connections.  Unauthenticated
   connections include connections negotiated using anonymous Diffie-
   Hellman algorithms or using self-signed certificates, among other
   scenarios.

4.7.  Server Name Indication

   Although there is no harm in supporting the TLS Server Name
   Indication (SNI) extension [RFC6066], this is not necessary since the
   same function is served in XMPP by the 'to' address of the initial
   stream header as explained in Section 4.7.2 of [RFC6120].

4.8.  Session Resumption

   If TLS session resumption is used (e.g., in concert with the XMPP
   Stream Management extension [XEP-0198]), care ought to be taken to do
   so safely.  In particular, the resumption information (either session
   IDs [RFC5246] or session tickets [RFC5077]) needs to be authenticated
   and encrypted to prevent modification or eavesdropping by an
   attacker.

   Use of session IDs [RFC5246] is RECOMMENDED instead of session
   tickets [RFC5077], since session tickets mandate a relatively small
   key size and a relatively weak cipher suite (AES_128_CBC_SHA256) that
   does not support forward secrecy.

4.9.  Compression

   XMPP is not generally subject to attacks based on TLS-layer
   compression (e.g., the "CRIME" attack), since it is not typically
   used to communicate static strings of the kind communicated over
   HTTP, such as "cookies" [RFC6265].  However, because XMPP also
   supports an application-layer compression technology [XEP-0138],
   implementers might wish to prefer XMPP compression over TLS
   compression in order to avoid any potential security issues with TLS-
   layer compression.  (See [I-D.sheffer-tls-bcp] for related
   discussion.)

Saint-Andre               Expires June 20, 2014                 [Page 7]
Internet-Draft                  XMPP TLS                   December 2013

4.10.  Human Factors

   It is RECOMMENDED that XMPP clients provide ways for end users (and
   that XMPP servers provide ways for administators) to complete the
   following tasks:

   o  Determine if a client-to-server or server-to-server connection is
      encrypted and authenticated.
   o  Determine the version of TLS used for a client-to-server or
      server-to-server connection.
   o  Inspect the certificate offered by an XMPP server.
   o  Determine the cipher suite used to encrypt a connection.
   o  Be warned if the certificate changes for a given server.

5.  Implementation Notes

   Some governments enforce legislation prohibiting the export of strong
   cryptographic technologies.  Nothing in this document ought to be
   taken as advice to violate such prohibitions.

6.  IANA Considerations

   This document requests no actions of the IANA.

7.  Security Considerations

   This entire document discusses security.

8.  References

8.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC4949]  Shirey, R., "Internet Security Glossary, Version 2",
              RFC 4949, August 2007.

   [RFC5077]  Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig,
              "Transport Layer Security (TLS) Session Resumption without
              Server-Side State", RFC 5077, January 2008.

   [RFC5246]  Dierks, T. and E. Rescorla, "The Transport Layer Security
              (TLS) Protocol Version 1.2", RFC 5246, August 2008.

Saint-Andre               Expires June 20, 2014                 [Page 8]
Internet-Draft                  XMPP TLS                   December 2013

   [RFC6120]  Saint-Andre, P., "Extensible Messaging and Presence
              Protocol (XMPP): Core", RFC 6120, March 2011.

   [RFC6125]  Saint-Andre, P. and J. Hodges, "Representation and
              Verification of Domain-Based Application Service Identity
              within Internet Public Key Infrastructure Using X.509
              (PKIX) Certificates in the Context of Transport Layer
              Security (TLS)", RFC 6125, March 2011.

   [RFC6176]  Turner, S. and T. Polk, "Prohibiting Secure Sockets Layer
              (SSL) Version 2.0", RFC 6176, March 2011.

8.2.  Informative References

   [I-D.ietf-xmpp-dna]
              Saint-Andre, P. and M. Miller, "Domain Name Associations
              (DNA) in the Extensible Messaging and Presence Protocol
              (XMPP)", draft-ietf-xmpp-dna-04 (work in progress),
              October 2013.

   [I-D.popov-tls-prohibiting-rc4]
              Popov, A., "Prohibiting RC4 Cipher Suites",
              draft-popov-tls-prohibiting-rc4-01 (work in progress),
              October 2013.

   [I-D.sheffer-tls-bcp]
              Sheffer, Y., "Recommendations for Secure Use of TLS and
              DTLS", draft-sheffer-tls-bcp-01 (work in progress),
              September 2013.

   [I-D.trammell-perpass-ppa]
              Trammell, B., Borkmann, D., and C. Huitema, "A Threat
              Model for Pervasive Passive Surveillance",
              draft-trammell-perpass-ppa-01 (work in progress),
              November 2013.

   [RFC2246]  Dierks, T. and C. Allen, "The TLS Protocol Version 1.0",
              RFC 2246, January 1999.

   [RFC3920]  Saint-Andre, P., Ed., "Extensible Messaging and Presence
              Protocol (XMPP): Core", RFC 3920, October 2004.

   [RFC4346]  Dierks, T. and E. Rescorla, "The Transport Layer Security
              (TLS) Protocol Version 1.1", RFC 4346, April 2006.

   [RFC4422]  Melnikov, A. and K. Zeilenga, "Simple Authentication and
              Security Layer (SASL)", RFC 4422, June 2006.

Saint-Andre               Expires June 20, 2014                 [Page 9]
Internet-Draft                  XMPP TLS                   December 2013

   [RFC5386]  Williams, N. and M. Richardson, "Better-Than-Nothing
              Security: An Unauthenticated Mode of IPsec", RFC 5386,
              November 2008.

   [RFC6066]  Eastlake, D., "Transport Layer Security (TLS) Extensions:
              Extension Definitions", RFC 6066, January 2011.

   [RFC6101]  Freier, A., Karlton, P., and P. Kocher, "The Secure
              Sockets Layer (SSL) Protocol Version 3.0", RFC 6101,
              August 2011.

   [RFC6265]  Barth, A., "HTTP State Management Mechanism", RFC 6265,
              April 2011.

   [XEP-0138]
              Hildebrand, J. and P. Saint-Andre, "Stream Compression",
              XSF XEP 0138, May 2009.

   [XEP-0198]
              Karneges, J., Saint-Andre, P., Hildebrand, J., Forno, F.,
              Cridland, D., and M. Wild, "Stream Management", XSF
              XEP 0198, June 2011.

   [XEP-0220]
              Miller, J., Saint-Andre, P., and P. Hancke, "Server
              Dialback", XSF XEP 0220, September 2013.

Appendix A.  Acknowledgements

   Thanks to the following individuals for their input: Thijs Alkemade,
   Dave Cridland, Philipp Hancke, Olle Johansson, Steve Kille, Tobias
   Markmann, Matt Miller, and Rene Treffer.

Author's Address

   Peter Saint-Andre
   Cisco Systems, Inc.
   1899 Wynkoop Street, Suite 600
   Denver, CO  80202
   USA

   Phone: +1-303-308-3282
   Email: psaintan@cisco.com

Saint-Andre               Expires June 20, 2014                [Page 10]