1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-23 08:08:53 -05:00

Merge branch 'xep-0156' into premerge

This commit is contained in:
Jonas Schäfer 2022-03-08 20:53:34 +01:00
commit 0bb46763d1

View File

@ -7,7 +7,7 @@
<xep>
<header>
<title>Discovering Alternative XMPP Connection Methods</title>
<abstract>This document defines an XMPP Extension Protocol for discovering alternative methods of connecting to an XMPP server using two ways: (1) DNS TXT Resource Record format; and (2) Web Host Metadata Link format.</abstract>
<abstract>This document defines an XMPP Extension Protocol for discovering alternative methods of connecting to an XMPP server via Web Host Metadata Link format.</abstract>
&LEGALNOTICE;
<number>0156</number>
<status>Draft</status>
@ -25,6 +25,12 @@
&hildjj;
&stpeter;
&lance;
<revision>
<version>1.4.0</version>
<date>2022-02-10</date>
<initials>tjb</initials>
<remark><p>Remove DNS _xmppconnect method due to security vulnerability.</p></remark>
</revision>
<revision>
<version>1.3.1</version>
<date>2020-07-07</date>
@ -155,46 +161,8 @@
</header>
<section1 topic='Introduction' anchor='intro'>
<p>Although &xmppcore; specifies the use of TCP as the method of connecting to an XMPP server, alternative connection methods exist, including the &xep0124; method (for which &xep0206; is the XMPP profile) and the websocket subprotocol specified in &rfc7395;. For some of these methods, it is necessary to discover further parameters before connecting, such as the HTTP URL of an alternative connection manager. Without ways to auto-discover alternative connection methods, the relevant information would need to be provided manually by a human user (which is cumbersome and error-prone) or hard-coded into XMPP software applications (which is brittle and not interoperable).</p>
<p>This document defines two ways to encapsulate information about alternative connection methods for auto-discovery:</p>
<ol>
<li>DNS TXT resource records</li>
<li>Link entries in a server's "host-meta" file</li>
</ol>
</section1>
<section1 topic='DNS Lookup Method' anchor='dns'>
<section2 topic='Record Format' anchor='dnsformat'>
<p>The following format for DNS TXT resource records is specified in <cite>RFC 1464</cite>:</p>
<code><![CDATA[<owner> <class> <ttl> <TXT> <"attribute name=attribute value">]]></code>
<p>This document specifies that the following additional rules apply for DNS TXT resource records used to specify alternative connection methods:</p>
<ol>
<li>It is RECOMMENDED for the owner to be "_xmppconnect".</li>
<li>The class field SHOULD be IN.</li>
<li>The ttl field is OPTIONAL.</li>
<li>The attribute name SHOULD begin with the string "_xmpp-client-" or "_xmpp-server-" and SHOULD be registered as described in the <link url='#registrar'>XMPP Registrar Considerations</link> section of this document.</li>
<li>If the txt-data field contains only an attribute name (i.e., no unquoted "=" character followed by additional characters), the receiving application SHOULD interpret it as indicating the presence of the attribute or feature with no defined value.</li>
<li>If the txt-data field contains an unquoted "=" character, it MUST also contain an attribute value.</li>
</ol>
</section2>
<section2 topic='Business Rules' anchor='dnsbizrules'>
<p>The following business rules apply:</p>
<ol start='1'>
<li>TXT lookups MUST be used only as a fallback after the methods specified in <cite>RFC 6120</cite> have been exhausted. <note>The point of this rule is to prevent someone from defining a new XEP-0156 connection method like "_xmpp-client-tcp" to override the SRV records defined in the core XMPP specification.</note></li>
<li>A domain SHOULD NOT present information in DNS TXT records that is available via the DNS SRV records defined in <cite>RFC 6120</cite>.</li>
<li>The order of DNS TXT records SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.</li>
</ol>
</section2>
<section2 topic='Examples' anchor='dnsexamples'>
<p>The following examples show two DNS TXT resource records: the first indicates support for the XMPP Over BOSH connection method defined in <cite>XEP-0124</cite> and <cite>XEP-0206</cite> and the second indicates support for XMPP over WebSocket connections defined in <cite>RFC 7395</cite>;.</p>
<example caption='TXT Resource Records'><![CDATA[
_xmppconnect IN TXT "_xmpp-client-xbosh=https://web.example.org:5280/bosh"
_xmppconnect IN TXT "_xmpp-client-websocket=wss://web.example.com:443/ws"
]]></example>
</section2>
<p>This document defines a way to encapsulate information about alternative connection methods for auto-discovery via Link entries in a server's "host-meta" file.
</p>
</section1>
<section1 topic='HTTP Lookup Method' anchor='http'>
@ -203,7 +171,6 @@ _xmppconnect IN TXT "_xmpp-client-websocket=wss://web.example.com:443/ws"
<p>The HTTP lookup method uses Web Host Metadata &rfc6415; to categorize and list the URIs of alternative connection methods. It is primarily intended for use by clients in environments where the ability to perform DNS queries is restricted, such as in web browsers.</p>
<p>Each alternative connection method is specified in the host-meta (XRD) file using a distinctive link relation &rfc5988;. This specification defines several extension relation types:</p>
<ul>
<li>urn:xmpp:alt-connections:httppoll</li>
<li>urn:xmpp:alt-connections:websocket</li>
<li>urn:xmpp:alt-connections:xbosh</li>
</ul>
@ -212,8 +179,9 @@ _xmppconnect IN TXT "_xmpp-client-websocket=wss://web.example.com:443/ws"
<section2 topic='Business Rules' anchor='httpbizrules'>
<p>The following business rules apply:</p>
<ol start='1'>
<li>host-meta files MUST be fetched only over HTTPS, and MUST only use connection URLs starting with 'https://' or 'wss://'. This provides secure delegation, meaning you SHOULD send SNI matching the host of the URL from the connection URL and validate that the certificate is valid for that host *or* the XMPP domain.</li>
<li>Services implementing this XEP MUST offer the information in the Extensible Resource Descriptor (XRD) format and SHOULD additionally provide the JRD format (both formats are specified in &rfc6415;).</li>
<li>HTTP queries for host-meta information MUST be used only as a fallback after the methods specified in <cite>RFC 6120</cite> have been exhausted.</li>
<li>HTTPS queries for host-meta information MUST be used only as a fallback after the methods specified in <cite>RFC 6120</cite> have been exhausted.</li>
<li>A domain SHOULD NOT present information in host-meta link records that is available via the DNS SRV records defined in <cite>RFC 6120</cite>.</li>
<li>The order of XMPP related link entries in the host-meta file SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.</li>
</ol>
@ -258,8 +226,9 @@ Access-Control-Allow-Origin: *
<p class="box"><em>Access-Control-Allow-Origin</em> header with a value of <em>*</em> allows JavaScript code running on a different domain to read the content of Web Host Metadata files. Special value <em>*</em> ensures that the request will only succeed if it is <link url="https://www.w3.org/TR/cors/#resource-requests">invoked without user credentials</link> (e.g. cookies, HTTP authentication).</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>It is possible that advertisement of alternative connection methods can introduce security vulnerabilities, since a connecting entity (usually a client) might deliberately seek to connect using the method with the weakest security mechanisms (e.g., no channel encryption or relatively weak authentication). Care needs to be taken in determining which alternative connection methods are appropriate to advertise.</p>
<p>Entities that use these connection methods MUST conform to the security considerations of each method, for example by preferring to use 'https' or 'wss' URLs that are protected using Transport Layer Security (TLS).</p>
<p>It is possible that advertisement of alternative connection methods can introduce security vulnerabilities, since a connecting entity (usually a client) might deliberately seek to connect using the method with the weakest security mechanisms (e.g., no channel encryption or relatively weak authentication). Care needs to be taken in determining which alternative connection methods are appropriate to advertise or implement in your lookup.</p>
<p>Entities that use these connection methods MUST only fetch host-meta over Transport Layer Security (TLS), and MUST only use 'https' or 'wss' URLs that are protected using TLS.</p>
<p>A previous version of this XEP defined a DNS method to look up this info using a TXT <em>_xmppconnect</em> record, this was insecure and has been removed.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
@ -273,52 +242,5 @@ Access-Control-Allow-Origin: *
<li>urn:xmpp:alt-connections</li>
</ul>
</section2>
<section2 topic='Alternative Connection Methods Registry' anchor='registrar-altconn'>
<p>The &REGISTRAR; maintains a registry of attributes for use in DNS TXT resource records that advertise alternative XMPP connection methods (see &ALTCONN;).</p>
<section3 topic='Process' anchor='registrar-altconn-process'>
&REGPROCESS;
<code><![CDATA[
<method>
<name>the name of the attribute to be used in DNS TXT records</name>
<desc>a natural-language description of the alternative connection method</desc>
<syntax>the syntax of the DNS TXT record attribute value</syntax>
<doc>the document in which the alternative connection method is specified</doc>
</method>
]]></code>
<p>The registrant can register more than one attribute at a time, each contained in a separate &lt;method/&gt; element.</p>
</section3>
<section3 topic='Registered Values' anchor='registrar-altconn-values'>
<p>This document registers the following values.</p>
<code><![CDATA[
<method>
<name>_xmpp-client-httppoll</name>
<desc>HTTP Polling connection method</desc>
<syntax>
The http: or https: URL at which to contact the HTTP Polling connection manager or proxy
</syntax>
<doc>XEP-0025</doc>
</method>
<method>
<name>_xmpp-client-websocket</name>
<desc>XMPP Over WebSocket connection method</desc>
<syntax>
The ws: or wss: URL at which to contact the WebSocket connection manager or proxy
</syntax>
<doc>RFC 7395</doc>
</method>
<method>
<name>_xmpp-client-xbosh</name>
<desc>XMPP Over Bosh connection method</desc>
<syntax>
The http: or https: URL at which to contact the HTTP Binding (BOSH) connection manager or proxy
</syntax>
<doc>XEP-0206</doc>
</method>
]]></code>
</section3>
</section2>
</section1>
</xep>