No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0210.xml 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Requirements for Encrypted Sessions</title>
  10. <abstract>This document describes the requirements for an XMPP end-to-end encrypted session protocol.</abstract>
  11. &LEGALNOTICE;
  12. <number>0210</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XMPP IM</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>N/A</shortname>
  23. &ianpaterson;
  24. <revision>
  25. <version>0.2</version>
  26. <date>2007-05-30</date>
  27. <initials>ip</initials>
  28. <remark><p>Clarified introduction.</p></remark>
  29. </revision>
  30. <revision>
  31. <version>0.1</version>
  32. <date>2007-04-20</date>
  33. <initials>ip</initials>
  34. <remark><p>Initial version (extracted from XEP-0188 version 0.4).</p></remark>
  35. </revision>
  36. </header>
  37. <section1 topic='Introduction' anchor='intro'>
  38. <p>Existing approaches to encryption of XMPP communications have generally assumed that each stanza to be encrypted is a standalone storeable object; the term "object encryption" well captures this assumption. Both &xep0027; and &rfc3923; assume that no interactive session exists, and that XMPP communications are similar to the exchange of files or email messages - where the receiver is typically not connected to its server at the time the message is sent. Although <cite>Current Jabber OpenPGP Usage</cite> uses "old-style" PGP object encryption and <cite>RFC 3923</cite> uses "new-style" S/MIME object encryption, both specify the use of object encryption. Any new protocol based on &w3xmlenc; and &w3xmlsig;, would also be an "object encryption" protocol.</p>
  39. <p>However, encryption schemes that are appropriate for less dynamic Internet technologies are not appropriate for session-oriented communication technologies like XMPP. With XMPP the receiver is typically connected to its server at the time the message is sent, so XMPP can take advantage of much more secure session-oriented approaches to encryption - approaches that are not feasible for less dynamic technologies like email. Most importantly, XMPP can benefit from <link url='#reqs-forward'>Perfect Forward Secrecy</link> and <link url='#reqs-id-protect'>Identity Protection</link>.</p>
  40. <p>Therefore, for XMPP, the focus should be on "session encryption" rather than "object encryption". The paradigm should be something closer to the widely-deployed Secure Shell technology (see &rfc4253;) or &rfc6189; (an acclaimed SRTP - &rfc3711; - key agreement protocol) or TLS (see &rfc5246;) or IPsec (see &rfc4301;) than to the traditional encryption of files and email messages.</p>
  41. <p>The session metaphor applies to communication between any two XMPP endpoints. For instance, in IM applications, most instant messaging exchanges occur in bursts within limited time periods (e.g., two people may send a fairly large number of messages during a five-minute chat and then not exchange messages again for hours or even days). The XML stanzas exchanged during such a session may not be limited to &MESSAGE; stanzas; for instance, the session may be triggered by a change in one of the parties' presence status (e.g., changing from away to available) and the session may involve the exchange of &IQ; stanzas (e.g., to transfer a file as specified in &xep0096;).</p>
  42. <p>Note: The encryption of archived messages is necessarily less secure than session encryption. The encryption of such stored messages is described in &xep0136; and is therefore out-of-scope for this document.</p>
  43. </section1>
  44. <section1 topic='Scope' anchor='scope'>
  45. <p>The XMPP communications described above exist in the context of a one-to-one communication session between two entities. However, several forms of XMPP communication exist outside the context of one-to-one communication sessions:</p>
  46. <ul>
  47. <li>Many-to-many sessions, such as a text conference in a chatroom as specified in &xep0045;.</li>
  48. <li>One-to-many "broadcast", such as undirected presence stanzas sent from one user to many contacts (see &rfc3921;) and data syndication implemented using &xep0060;.</li>
  49. <li>One-to-one communications that are stored for later delivery rather than delivered immediately, such as so-called "offline messages".</li>
  50. </ul>
  51. <p>Ideally, any technology for end-to-end encryption in XMPP could be extended to cover all the scenarios above as well as one-to-one communication sessions. However, both many-to-many sessions and one-to-many broadcast are deemed out-of-scope for this document.</p>
  52. <p>Communications where the receiving entity is offline should ideally be handled via a simple extension to the protocol for one-to-one sessions between two entities that are online simultaneously. This approach enables code reuse, minimises the points of failure and significantly increases the security (for example, by providing Perfect Forward Secrecy).</p>
  53. </section1>
  54. <section1 topic='Security Requirements' anchor='reqs-sec'>
  55. <p>This document stipulates the following security requirements for end-to-end encryption of XMPP communications:</p>
  56. <ul>
  57. <li>Confidentiality</li>
  58. <li>Integrity</li>
  59. <li>Replay protection</li>
  60. <li>Perfect forward secrecy</li>
  61. <li>PKI Independence</li>
  62. <li>Authentication</li>
  63. <li>Identity Protection</li>
  64. <li>Repudiability</li>
  65. <li>Robustness</li>
  66. <li>Upgradability</li>
  67. </ul>
  68. <p>Each of these requirements is explained in greater depth below.</p>
  69. <section2 topic='Confidentiality' anchor='reqs-encrypt'>
  70. <p>The one-to-one XML stanzas exchanged between two entities MUST NOT be understandable to any other entity that might intercept the communications. The encrypted stanzas should be understood by an intermediate server only to the extent required to route them. (One complicating factor is that routing information may include not only the stanza's 'to', 'from', 'type, and 'id' attributes, but also &xep0079; extensions.)</p>
  71. </section2>
  72. <section2 topic='Integrity' anchor='reqs-integrity'>
  73. <p>Alice and Bob MUST be sure that no other entity may change the content of the XML stanzas they exchange, or remove or insert stanzas into the ESession undetected.</p>
  74. </section2>
  75. <section2 topic='Replay Protection' anchor='reqs-replay'>
  76. <p>Alice or Bob MUST be able to identify and reject any communications that are copies of their previous communications resent by another entity.</p>
  77. </section2>
  78. <section2 topic='Perfect Forward Secrecy' anchor='reqs-forward'>
  79. <p>The encrypted communication MUST NOT be revealed even if long-lived keys are compromised in the future (e.g., Steve steals Bob's computer). For long-lived sessions it MUST be possible to periodically change the decryption keys. <note>Long-lived keys are typically used for a few years, whereas Offline ESession keys are destroyed as soon as the stanza is decrypted - they typically exist for just a few hours. So Perfect Forward Secrecy should significantly enhance the security even of Offline ESessions.</note></p>
  80. </section2>
  81. <section2 topic='PKI Independence' anchor='reqs-pki'>
  82. <p>The protocol MUST NOT rely on any public key infrastructure (PKI), certification authority, web of trust, or any other trust model that is external to the trust established between Alice and Bob. However, if external authentication or trust models are available then Alice and Bob MUST be able to use them to enhance any trust that exists between them.</p>
  83. </section2>
  84. <section2 topic='Authentication' anchor='reqs-auth'>
  85. <p>Each party to a conversation MUST know that the other party is who they want to communicate with (Alice must be able to know that Bob really is Bob, and vice versa). <note>Authentication is not identification, authentication may be as simple as Alice confirming that Bob is the same Bob that she communicated with yesterday or that she talked to on the telephone. The reliable association between an entity and its public keys is "identification" and therefore beyond the scope of this document.</note></p>
  86. </section2>
  87. <section2 topic='Identity Protection' anchor='reqs-id-protect'>
  88. <p>No other entity should be able to identify Alice or Bob. The JIDs they use to route their stanzas are unavoidably vulnerable to interception. So, even if Alice and Bob protect their identities by using different JIDs for each session, it MUST be possible for their clients to authenticate them transparently, without any other entity identifying them via an active ("man-in-the-middle") attack, or even linking them to their previous sessions. If that is not possible because Alice and Bob choose to authenticate using public keys instead of retained shared secrets, then the public keys MUST NOT be revealed to other entities using a passive attack. Bob MUST also be able to choose between protecting either his public key or Alice's public key from disclosure through an active attack.</p>
  89. </section2>
  90. <section2 topic='Repudiability' anchor='reqs-repudiate'>
  91. <p>Alice and Bob MUST be able to repudiate any stanza that occurs within an ESession. After an ESession has finished, it MUST NOT be possible to <em>prove cryptographically</em> that any transcript has not been modified by a third party. <note>Naturally, it is possible that Alice or Bob may retain cleartext versions of the exchanged communications; however, that threat is out-of-scope for this document.</note></p>
  92. </section2>
  93. <section2 topic='Robustness' anchor='reqs-robust'>
  94. <p>The protocol SHOULD provide more than one difficult challenge that has to be overcome before an attack can succeed (for example, by generating encryption keys using as many shared secrets as possible - like retained secrets or optional passwords).</p>
  95. </section2>
  96. <section2 topic='Upgradability' anchor='reqs-upgrade'>
  97. <p>The protocol MUST be upgradable so that, if a vulnerability is discovered, a new version can fix it. Alice MUST tell Bob which versions of the protocol she is prepared to support. Then Bob MUST either choose one or reject the ESession. <note>It is exceptionally difficult to design a truly secure authenticated key-exchange protocol. Weaknesses are often only discovered after years of expert cryptographic analysis. In many cases, only the widespread use of a protocol will motivate experts to undertake exhaustive analyses and recommend enhancements.</note></p>
  98. </section2>
  99. </section1>
  100. <section1 topic='Application Requirements' anchor='reqs-xmpp'>
  101. <p>In addition to the foregoing security profile, this document also stipulates the following application-specific requirements for encrypted communication in the context of Jabber/XMPP technologies:</p>
  102. <ul>
  103. <li>Generality</li>
  104. <li>Implementability</li>
  105. <li>Usability</li>
  106. <li>Efficiency</li>
  107. <li>Flexibility</li>
  108. <li>Offline "sessions"</li>
  109. <li>Interoperability</li>
  110. <li>Object encryption</li>
  111. </ul>
  112. <p>Each of these is explained in greater depth below.</p>
  113. <section2 topic='Generality' anchor='reqs-generality'>
  114. <p>The solution MUST be generally applicable to the full content of any XML stanza type (&MESSAGE;, &PRESENCE;, &IQ;) sent between two entities. It is deemed acceptable if the solution does not apply to many-to-many stanzas (e.g., groupchat messages sent within the context of multi-user chat) or one-to-many stanzas (e.g., presence "broadcasts" and pubsub notifications); end-to-end encryption of such stanzas may require separate solutions.</p>
  115. </section2>
  116. <section2 topic='Implementability' anchor='reqs-implement'>
  117. <p>The only good security technology is an implemented security technology. The solution SHOULD be one that client developers can implement in a relatively straightforward and interoperable fashion.</p>
  118. </section2>
  119. <section2 topic='Usability' anchor='reqs-usable'>
  120. <p>The requirement of usability takes implementability one step further by stipulating that the solution MUST be one that organizations may deploy and humans may use with 100% transparency (with the ease-of-use of https:). Experience has shown that: solutions requiring a full public key infrastructure do not get widely deployed, and solutions requiring any user action are not widely used. If, however, Alice and/or Bob are prepared to verify the integrity of their copies of each other's keys (thus enabling them to discover targeted active attacks or even the mass surveilance of a population), then the actions necessary for them to achieve that MUST be minimal (requiring no more effort than a one-time out-of-band verification of a string of up to 6 alphanumeric characters).</p>
  121. </section2>
  122. <section2 topic='Efficiency' anchor='reqs-efficient'>
  123. <p>Cryptographic operations are highly CPU intensive, particularly public key and Diffie-Hellman operations. Cryptographic data structures can be relatively large, especially public keys and certificates. Network round trips can introduce unacceptable delays, especially over high-latency wireless connections. The solution MUST perform efficiently even when CPU and network bandwidth are constrained. The number of stanzas required for ESession negotiation MUST be minimized.</p>
  124. </section2>
  125. <section2 topic='Flexibility' anchor='reqs-flexible'>
  126. <p>The solution MUST be compatible with a variety of existing (and future) cryptographic algorithms and identity certification schemes (including X.509 and PGP). The protocol MUST also be able to evolve to correct the weaknesses that are inevitably discovered once any cryptographic protocol is in widespread use.</p>
  127. </section2>
  128. <section2 topic='Offline Sessions' anchor='reqs-offline'>
  129. <p>It SHOULD be possible to encrypt one-to-one communications that are stored for later delivery (instead of being delivered immediately - so-called "offline messages") and still benefit from Perfect Forward Secrecy (with a slightly longer period of vulnerability than if both parties were online simultaneously). However, any vulnerabilities introduced into the solution in order to enable such offline communications MUST NOT make online communications more vulnerable.</p>
  130. </section2>
  131. <section2 topic='Interoperability' anchor='reqs-interop'>
  132. <p>Ideally, it would be possible for an XMPP user to exchange encrypted messages (and, potentially, presence information) with users of non-XMPP messaging systems.</p>
  133. </section2>
  134. <section2 topic='Object Encryption' anchor='reqs-object'>
  135. <p>Ideally, it would be possible in cases where a session is not desired, to encrypt, sign and send a single stanza in isolation, so-called "object encryption".</p>
  136. </section2>
  137. </section1>
  138. <section1 topic='Security Considerations' anchor='sec'>
  139. <p>Security issues are discussed throughout this document.</p>
  140. </section1>
  141. <section1 topic='IANA Considerations' anchor='iana'>
  142. <p>This document requires no interaction with &IANA;. </p>
  143. </section1>
  144. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  145. <p>This document requires no interaction with the &REGISTRAR;.</p>
  146. </section1>
  147. </xep>