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-0219.xml 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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>Hop Check</title>
  10. <abstract>This document defines an XMPP protocol extension that enables an entity to check the security of client-to-server and server-to-server hops between it and another entity. Note: This specification has been retracted by the author because the problem is not compelling and a real solution would be too complicated.</abstract>
  11. &LEGALNOTICE;
  12. <number>0219</number>
  13. <status>Retracted</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. </dependencies>
  19. <supersedes/>
  20. <supersededby/>
  21. <shortname>TO BE ASSIGNED</shortname>
  22. &stpeter;
  23. <revision>
  24. <version>0.3</version>
  25. <date>2008-06-12</date>
  26. <initials>psa</initials>
  27. <remark><p>Retracted by the author because the problem is not compelling and a real solution would be too complicated.</p></remark>
  28. </revision>
  29. <revision>
  30. <version>0.2</version>
  31. <date>2007-10-30</date>
  32. <initials>psa</initials>
  33. <remark><p>Clarified meaning of encrypted; specified rules for reporting of server-to-server connections.</p></remark>
  34. </revision>
  35. <revision>
  36. <version>0.1</version>
  37. <date>2007-05-30</date>
  38. <initials>psa</initials>
  39. <remark><p>Initial published version.</p></remark>
  40. </revision>
  41. <revision>
  42. <version>0.0.4</version>
  43. <date>2007-05-16</date>
  44. <initials>psa</initials>
  45. <remark><p>Split secure attribute into encrypted (for TLS/SSL) and auth.</p></remark>
  46. </revision>
  47. <revision>
  48. <version>0.0.3</version>
  49. <date>2007-05-11</date>
  50. <initials>psa</initials>
  51. <remark><p>Specified protocol.</p></remark>
  52. </revision>
  53. <revision>
  54. <version>0.0.2</version>
  55. <date>2007-05-02</date>
  56. <initials>psa</initials>
  57. <remark><p>Added more detailed security considerations; broadened applicability to be more similar to traceroute; changed name of status attribute to secure and its type to boolean; added delay attribute; defined XML schema.</p></remark>
  58. </revision>
  59. <revision>
  60. <version>0.0.1</version>
  61. <date>2007-05-01</date>
  62. <initials>psa</initials>
  63. <remark><p>First draft.</p></remark>
  64. </revision>
  65. </header>
  66. <section1 topic='Introduction' anchor='intro'>
  67. <p><em>Note: This specification has been retracted by the author because the problem is not compelling and a real solution would be too complicated.</em></p>
  68. <section2 topic='Motivation' anchor='motivation'>
  69. <p>When two XMPP users communicate, one or both of them may want to know the status of the XMPP communications path (i.e., of all the hops) between them. While the primary motivation is to determine if all the hops are secured via Transport Layer Security (see &rfc5246;) as specified for XMPP in &xmppcore;, more general information about the communications path may also be of interest.</p>
  70. <p>This document describes a protocol for discovering such information, similar in spirit to the traceroute protocol specified in &rfc1393; but specific to XMPP.</p>
  71. </section2>
  72. <section2 topic='Approach' anchor='approach'>
  73. <p>As a user, I may want to know three things:</p>
  74. <ol>
  75. <li>If my connection to my server is encrypted.</li>
  76. <li>If my server's connection to my contact's server is encrypted.</li>
  77. <li>If my contact's connection to their server is encrypted.</li>
  78. </ol>
  79. <p>If the answer to all three of these questions is "yes" and I have some level of trust in my XMPP server (see <link url='#security'>Security Considerations</link>) then I have some assurance that communications between me and my contact will not be subject to interception by the likes of "Eve" (a passive attacker who can eavesdrop on messages) and "Mallory" (an active attacker who can maliciously modify messages in transit).</p>
  80. <p>Note: By "encrypted" is meant channel encryption with Transport Layer Security (or, for client-to-server connections, legacy SSL) using something other than the null cipher. This protocol does not include more sophisticated information about the connection, such as the cipher suite used, the SASL authentication mechanism used (if any), the certificate identity (if any), the trusted roots involved in certificate authenticate, etc.</p>
  81. <p>The answer to the first question is straightforward, since my client knows if its connection to my server is encrypted (as well as the certificates involved).</p>
  82. <p>If I trust my server, I can ask it to report on the security of its connection to my contact's server. (Note: Because server-to-server connections are unidirectional and it is possible for the connection in one direction to be encrypted but for the connection in the opposite direction to be unencrypted, my server MUST NOT report the connection to my contact's server as encrypted unless the connection is encrypted in both directions.)</p>
  83. <p>If the server-to-server connection is encrypted and my server trusts that connection, my server can ask my contact's server to report on the security of my contact's connection.</p>
  84. <p>By feeling my way along the hops in this manner, I can learn if all three hops are encrypted and therefore can have some assurance that the entire communications path is encrypted.</p>
  85. </section2>
  86. <section2 topic='How It Works' anchor='howitworks'>
  87. <p>Because XMPP has a decentralized architecture, there may be multiple hops along the communications path. Consider two users Juliet at capulet.lit and Romeo at montague.lit. <note>This specification uses the example of two clients, but the protocol can be used to check hops between any two XMPP entities.</note> There is one hop from Juliet's client to the capulet.lit server, one hop from the capulet.lit server to the montague.lit server, and one hop from the montague.lit server to Romeo's client. <note>If both capulet.lit and montague.lit are virtual hosts of the same server, it is possible that there are only two hops in this situation rather than three. Moreover, in certain circumstances (e.g., if one of the clients connects to a third-party HTTP connection manager) it is possible for there to be more than three hops. However, this document assumes a standard XMPP architecture.</note></p>
  88. <p>We assume that Juliet's connection to capulet.lit is encrypted and that she has some trust in her server. If she wants to check the security of the path between her and Romeo, she should would send the following request:</p>
  89. <example caption="Hop check request"><![CDATA[
  90. <iq type='get'
  91. from='juliet@capulet.lit/balcony'
  92. to='capulet.lit'
  93. id='check1'>
  94. <hopcheck xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  95. to='romeo@montague.lit/orchard'/>
  96. </iq>
  97. ]]></example>
  98. <p>Naturally, capulet.lit knows about the security of Juliet's connection to capulet.lit and about the security of its connection to montague.lit. But it does not know about the security of Romeo's connection to montague.net; therefore on behalf of Juliet it needs to ask montague.lit about that hop before returning an answer to Juliet:</p>
  99. <example caption="Intermediate hop check request"><![CDATA[
  100. <iq type='get'
  101. from='capulet.lit'
  102. to='montague.lit'
  103. id='check2'>
  104. <hopcheck xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  105. for='juliet@capulet.lit/balcony'
  106. to='romeo@montague.lit/orchard'/>
  107. </iq>
  108. ]]></example>
  109. <p>The montague.lit server would then report to capulet.lit regarding the hops from juliet@capulet.lit to romeo@montague.lit/orchard:</p>
  110. <example caption="Intermediate hop check result"><![CDATA[
  111. <iq type='result'
  112. from='montague.lit'
  113. to='juliet@capulet.lit'
  114. id='check2'>
  115. <hopcheck xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  116. for='juliet@capulet.lit/balcony'
  117. to='romeo@montague.lit/orchard'>
  118. <hop from='capulet.lit'
  119. to='montague.lit'
  120. ip='192.0.2.1'
  121. delay='7.178'
  122. auth='EXTERNAL'
  123. encrypted='1'/>
  124. <hop from='montague.lit'
  125. to='romeo@montague.lit/orchard'
  126. delay='15.734'
  127. auth='PLAIN'
  128. encrypted='1'/>
  129. </hopcheck>
  130. </iq>
  131. ]]></example>
  132. <p>The capulet.lit server would then report to Juliet regarding the security of all the hops:</p>
  133. <example caption="Hop check result"><![CDATA[
  134. <iq type='result'
  135. from='capulet.lit'
  136. to='juliet@capulet.lit/balcony'
  137. id='check1'>
  138. <hopcheck xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  139. from='juliet@capulet.lit/balcony'
  140. to='romeo@montague.lit/orchard'>
  141. <hop from='juliet@capulet.lit/balcony'
  142. to='capulet.lit'
  143. auth='DIGEST-MD5'
  144. encrypted='true'/>
  145. <hop from='capulet.lit'
  146. to='montague.lit'
  147. ip='192.0.2.1'
  148. delay='11.602'
  149. auth='EXTERNAL'
  150. encrypted='true'/>
  151. <hop from='montague.lit'
  152. to='romeo@montague.lit/orchard'
  153. delay='15.734'
  154. auth='PLAIN'
  155. encrypted='1'/>
  156. </hopcheck>
  157. </iq>
  158. ]]></example>
  159. <p>The foregoing shows only the "happy path"; many alternate flows and error conditions are possible, as described in the <link url='#protocol'>Protocol</link> section of this document.</p>
  160. </section2>
  161. </section1>
  162. <section1 topic='Protocol' anchor='protocol'>
  163. <section2 topic='Request' anchor='protocol-request'>
  164. <p>In order for an entity to check the communications path between itself and a target entity, the entity shall generate a hopcheck request of the following form:</p>
  165. <code><![CDATA[
  166. <iq type='get'
  167. from='sender'
  168. to='respondent'
  169. id='foo'>
  170. <hopcheck xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  171. [for='original-sender']
  172. to='target'/>
  173. </iq>
  174. ]]></code>
  175. <p>The sender MUST set the respondent to be the entity that the sender believes is the entity at the other end of the next hop in the communications path. (For a connected resource, this is the server to which the client is connected; for a server, this is the server corresponding to the domain portion of the JID in the triggering request received from a connected resource or other local entity.)</p>
  176. <p>If the sender is a server but it is making the request on behalf of a connected resource, it MUST include the 'for' attribute and set it to the 'from' address of the triggering request.</p>
  177. </section2>
  178. <section2 topic='Errors' anchor='protocol-errors'>
  179. <p>The following error cases are defined:</p>
  180. <ul>
  181. <li>If the respondent does not support the hopcheck namespace, it MUST return a &unavailable; error.</li>
  182. <li>If the &lt;hopcheck/&gt; element does not include a 'to' attribute, the respondent MUST return a &badrequest; error.</li>
  183. <li>If the 'to' or 'for' attribute of the &lt;hopcheck/&gt; element contains a JID that is malformed, the respondent MUST return a &badjid; error.</li>
  184. <li>If the respondent is a server and the sender is a full JID &LOCALFULL;, the server MUST verify that the JID is a connected resource of the server (per <cite>RFC 6120</cite>); if it is not, then the respondent MUST return a &forbidden; error.</li>
  185. <li>If both the sender and the respondent are servers and the domain identifier of the &lt;hopcheck/&gt; element's 'to' attribute does not match a validated domain of the respondent, the respondent MUST return a &notfound; error.</li>
  186. <li>If both the sender and the respondent are servers, the JID of the &lt;hopcheck/&gt; element's 'to' is a connected resource of the respondent server, and the JID of the &lt;hopcheck/&gt; element's 'for' is not authorized to know the presence of the target (either via presence subscription or temporary presence sharing via directed presence as defined in &xmppim;), then the respondent MUST return a &forbidden; error.</li>
  187. </ul>
  188. </section2>
  189. <section2 topic='Response' anchor='protocol-response'>
  190. <p>If an error does not occur, the response shall be of the following form:</p>
  191. <code><![CDATA[
  192. <iq type='result'
  193. from='respondent'
  194. to='sender'
  195. id='foo'>
  196. <hopcheck xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  197. [for='original-sender']
  198. to='target'>
  199. <hop auth='some-defined-value'
  200. [delay='float']
  201. from='sender-or-respondent'
  202. [ip='some-IP-address']
  203. encrypted='boolean'
  204. to='respondent-or-target'/>
  205. </hopcheck>
  206. </iq>
  207. ]]></code>
  208. <p>The 'delay' attribute is OPTIONAL. If included, it represents the time in milliseconds that it took for the respondent to receive a reply from the target or intermediate respondent.</p>
  209. <p>The 'ip' attribute is OPTIONAL. If included, it represents the IPv4 or IPv6 address of the target or intermediate respondent.</p>
  210. <p>The 'encrypted' attribute is REQUIRED. It is a boolean &BOOLEANNOTE; that represents whether the hop in question is encrypted via Transport Layer Security (see &rfc5246;) or at a legacy SSL port.</p>
  211. <p>The 'auth' attribute is REQUIRED. It represents whether and how the hop in question is authenticated, in particular via one of the following means:</p>
  212. <ul>
  213. <li>A Simple Authentication and Security Layer mechanism (see &rfc4422; for the specification and &ianasasl; for a list of registered SASL mechanisms; the names for standardized, non-obsolete mechanisms are used as values of the 'auth' attribute).</li>
  214. <li>The obsolete &xep0078; protocol using the "plaintext" or "digest" method.</li>
  215. <li>The server dialback protocol ("dialback") as specified in &xep0220;.</li>
  216. </ul>
  217. </section2>
  218. </section1>
  219. <section1 topic='Discovering Support' anchor='disco'>
  220. <p>If an entity supports the Hop Check protocol, it MUST report that by including a service discovery feature of "http://www.xmpp.org/extensions/xep-0219.html#ns" &NSNOTE; in response to a &xep0030; information request:</p>
  221. <example caption="Service Discovery information request"><![CDATA[
  222. <iq type='get'
  223. from='juliet@capulet.lit/balcony'
  224. from='capulet.lit'
  225. id='disco1'>
  226. <query xmlns='http://jabber.org/protocol/disco#info'/>
  227. </iq>
  228. ]]></example>
  229. <example caption="Service Discovery information response"><![CDATA[
  230. <iq type='result'
  231. from='capulet.lit'
  232. to='juliet@capulet.lit/balcony'
  233. id='disco1'>
  234. <query xmlns='http://jabber.org/protocol/disco#info'>
  235. ...
  236. <feature var='http://www.xmpp.org/extensions/xep-0219.html#ns'/>
  237. ...
  238. </query>
  239. </iq>
  240. ]]></example>
  241. </section1>
  242. <section1 topic='Security Considerations' anchor='security'>
  243. <section2 topic='Server Trust' anchor='security-trust'>
  244. <p>Trust levels vary. The administrator of a server may have complete trust in the server they run. A user of a friend's server may have significant trust in the server. A user of a server in a military environment may have no choice of server and may trust that their superiors are doing the right thing. And so on. While the trust that a user places in a server may or may not be warranted, this document uses the level of trust that exists to bootstrap greater trust in the entire communications path.</p>
  245. </section2>
  246. <section2 topic='Cleartext' anchor='security-cleartext'>
  247. <p>Even if all the hops are encrypted, the traffic may still be available in cleartext to a representative of an Internet Service Provider ("Isaac"), a representative of the justice system ("Justin"), or a malicious attacker ("Mallory") that has gained access to any of the servers along the communications path. The protocol described herein is decidedly NOT a substitute for end-to-end encryption technologies such as &xep0116;.</p>
  248. </section2>
  249. </section1>
  250. <section1 topic='IANA Considerations' anchor='iana'>
  251. <p>This document requires no interaction with &IANA;.</p>
  252. </section1>
  253. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  254. <section2 topic='Protocol Namespaces' anchor='ns'>
  255. <p>Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0219.html#ns"; upon advancement of this specification, the &REGISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.</p>
  256. </section2>
  257. </section1>
  258. <section1 topic='XML Schema' anchor='schema'>
  259. <code><![CDATA[
  260. <?xml version='1.0' encoding='UTF-8'?>
  261. <xs:schema
  262. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  263. targetNamespace='http://www.xmpp.org/extensions/xep-0219.html#ns'
  264. xmlns='http://www.xmpp.org/extensions/xep-0219.html#ns'
  265. elementFormDefault='qualified'>
  266. <xs:element name='hopcheck'>
  267. <xs:complexType>
  268. <xs:sequence minOccurs='0' maxOccurs='unbounded'>
  269. <xs:element ref='hop'/>
  270. </xs:sequence>
  271. <xs:attribute name='for' type='xs:string' use='optional'/>
  272. <xs:attribute name='to' type='xs:string' use='required'/>
  273. </xs:complexType>
  274. </xs:element>
  275. <xs:element name='hop'>
  276. <xs:complexType>
  277. <xs:simpleContent>
  278. <xs:extension base='empty'>
  279. <xs:attribute name='auth' use='required'>
  280. <xs:simpleType>
  281. <xs:restriction base='xs:NCName'>
  282. <xs:enumeration value='ANONYMOUS'/>
  283. <xs:enumeration value='CRAM-MD5'/>
  284. <xs:enumeration value='DIGEST-MD5'/>
  285. <xs:enumeration value='EXTERNAL'/>
  286. <xs:enumeration value='GSSAPI'/>
  287. <xs:enumeration value='KERBEROS_V4'/>
  288. <xs:enumeration value='OTP'/>
  289. <xs:enumeration value='PLAIN'/>
  290. <xs:enumeration value='SECURID'/>
  291. <xs:enumeration value='dialback'/>
  292. <xs:enumeration value='digest'/>
  293. <xs:enumeration value='plaintext'/>
  294. </xs:restriction>
  295. </xs:simpleType>
  296. </xs:attribute>
  297. <xs:attribute name='delay' type='xs:double' use='optional'/>
  298. <xs:attribute name='encrypted' type='xs:boolean' use='required'/>
  299. <xs:attribute name='from' type='xs:string' use='required'/>
  300. <xs:attribute name='ip' type='xs:string' use='optional'/>
  301. <xs:attribute name='to' type='xs:string' use='required'/>
  302. </xs:extension>
  303. </xs:simpleContent>
  304. </xs:complexType>
  305. </xs:element>
  306. <xs:simpleType name='empty'>
  307. <xs:restriction base='xs:string'>
  308. <xs:enumeration value=''/>
  309. </xs:restriction>
  310. </xs:simpleType>
  311. </xs:schema>
  312. ]]></code>
  313. </section1>
  314. </xep>