SASL channel-binding is a technique to increase the security of connections (RFC 5056 [1]). Unfortunately, the SASL profile specified in RFC 6120 [2] lacks a method for the server to announce its supported channel-binding types. This hinders the adoption of channel-binding, especially since the error protocol to execute after a client requested a channel-binding type unsupported by the server is basically unspecified.
The extension defined herein fills the gap left by RFC 6120 [2], by allowing the server to announce its supported channel-binding types.
This protocol consists of a stream feature named <sasl-channel-binding/> qualified by the 'urn:xmpp:sasl-cb:0' namespace. The <sasl-channel-binding/> element MUST contain one or more <channel-binding/> elements, of which each MUST have an attribute with the name 'type'. The value of the 'type' attribute SHOULD be the "Channel-binding unique prefix" of a channel-binding type which was registered with the IANA Channel-Binding Types Registry [3].
A server declares that it supports particular channel-binding types by listing the supported types via the <sasl-channel-binding/> stream feature defined herein. The <sasl-channel-binding/> element could appear next to the SASL <mechanisms/> stream-feature element, qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace, as specified in RFC 6120 [2]. Another potential appearance of <sasl-channel-binding/> is next to the <authentication/> stream-feature element as specified in the Extensible SASL Profile (XEP-0388) [4].
<stream:features>
<sasl-channel-binding xmlns='urn:xmpp:sasl-cb:0'>
<channel-binding type='tls-server-end-point'/>
<channel-binding type='tls-exporter'/>
</sasl-channel-binding>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>EXTERNAL</mechanism>
<mechanism>SCRAM-SHA-1-PLUS</mechanism>
<mechanism>PLAIN</mechanism>
</mechanisms>
</stream:features>
<stream:features>
<sasl-channel-binding xmlns='urn:xmpp:sasl-cb:0'>
<channel-binding type='tls-server-end-point'/>
<channel-binding type='tls-exporter'/>
</sasl-channel-binding>
<authentication xmlns='urn:xmpp:sasl:2'>
<mechanism>SCRAM-SHA-1</mechanism>
<mechanism>SCRAM-SHA-1-PLUS</mechanism>
<inline>
<sm xmlns='urn:xmpp:sm:3'/>
<bind xmlns='urn:xmpp:bind:0'/>
</inline>
</authentication>
</stream:features>Client developers MUST follow the following rules to ensure that implementing this specification in conjunction with SCRAM (RFC 5802 [5]) or any other equivalent SASL mechanism supporting channel-binding does not introduce a MITM attack vector. The rules are specifically taylored to SCRAM. For other SASL mechanisms supporting channel-binding, client developers MUST use the equivalent to "y" and "n" defined by those mechanisms.
When implementing SASL SCRAM Downgrade Protection (XEP-0474) [6] the above rules might be relaxed a bit, see that specification for details.
A more sophisticated attacker managing to steal the certificate and private key of the server won't be detected by the tls-server-end-point channel-binding. Clients and servers SHOULD implement stronger channel-binding types like tls-exporter, to detect and prevent such attacks
The following considerations refer to SCRAM, as it is the only widely depolyed mechanism with channel binding at the time of writing this document. As already stated in the Business Rules, other mechanisms supporting channel-binding will have some sort of equivalent for "y" and "n".
In SCRAM (RFC 5802 [5]) the client-first-message contains three possible values in the GSS-header part:
The RFC explains, that sending "y" when the server advertised channel-binding support is to be used as a MITM-detection. An attacker stripping out all *-PLUS variants can be detected this way: the server knows it advertised them and the client reports via "y", that it would have used them if it saw them advertised, so the server can abort the authentication in this case.
This works reasonably well, if there is only one single channel-binding possible. But that's the exact assumption this specification now changes: it is now possible to advertise a list of different channel-bindings for the client to choose.
But this creates a problem: what to do if the server advertised a list of channel-binding algorithms, but the client doesn't support any of these? Assuming there is no MITM attacker present, the client can't send "y" in the GSS-header, because the server would then abort the authentication because it advertised channel-bindings. Sending "n" and continuing without channel-binding is fine in this case, but it won't be if a MITM attacker were present. [7]
Any MITM attacker could just manipulate the list of channel-bindings advertised using this specification to just list some dummy mechanisms the client doesn't support. If the client acted like in the non-attacker case depicted in the last paragraph and sent "n", the attacker would have successfully downgraded the client to non-channel-binding. The client won't be able to distinguish the attacker case from the non-attacker one.
The rules in the Business Rules section fix that loophole. Tls-server-end-point was picked, because it is the lowest denominator that can be implemented by virtually everyone and even though it isn't as strong as tls-exporter or tls-unique, it still catches many attacks. This only works reliably, if every server supports and announces tls-server-end-point.
A client following the rules above and seeing a server-advertised list without tls-sever-end-point, immediately knows, that some attacker tampered with the list of channel-binding types and can abort the authentication. It never needs to send "n" even though it supports channel-binding and can still safely send "y" if it doesn't see any '*-PLUS' variants and channel-bindings announced.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].
Add the 'urn:xmpp:sasl-cb:0' namespace to the registry:
<var> <name>urn:xmpp:sasl-cb:0</name> <desc>Expose supported channel-binding types to clients</desc> <doc>XEP-0440</doc> </var>
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns='urn:xmpp:sasl-cb:0'
targetNamespace='urn:xmpp:sasl-cb:0'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0440: https://xmpp.org/extensions/xep-0440.html
</xs:documentation>
</xs:annotation>
<xs:element name='sasl-channel-binding'>
<xs:complexType>
<xs:sequence>
<xs:element ref='channel-binding' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='channel-binding'>
<xs:complexType>
<xs:attribute name='type' type='xs:string'/>
</xs:complexType>
</xs:element>
</xs:schema>
Thanks to Sam Whited for the discussion about the underlying issue and incentivizing me to come up with this extension. Further thanks goes to Ruslan N. Marchenko for pointing out the possible MITM attack vector. Last but not least, Dave Cridland, Thilo Molitor, and Simon Josefsson provided valuable feedback.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Errata can be sent to <editor@xmpp.org>.
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 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
1. RFC 5056: On the Use of Channel Bindings to Secure Channels <http://tools.ietf.org/html/rfc5056>.
2. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.
3. IANA Channel-Binding Types Registry <https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml>.
4. XEP-0388: Extensible SASL Profile <https://xmpp.org/extensions/xep-0388.html>.
5. RFC 5802: Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms <http://tools.ietf.org/html/rfc5802>.
6. XEP-0474: SASL SCRAM Downgrade Protection <https://xmpp.org/extensions/xep-0474.html>.
7. This isn't fully hypothetical. An older client might only support tls-unique, while the server only advertises tls-exporter (which can be used for tls 1.2, too, if the extended master secret is used). Blocking the connection entirely is of course at the discretion of the client developer, but it hinders interoperability, especially while phasing out one channel-binding-type and introducing a new one.
8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
First draft.
@report{schmaus2020sasl-cb-types,
title = {SASL Channel-Binding Type Capability},
author = {Schmaus, Florian and Molitor, Thilo},
type = {XEP},
number = {0440},
version = {0.5},
institution = {XMPP Standards Foundation},
url = {https://xmpp.org/extensions/xep-0440.html},
date = {2020-05-20/2025-10-25},
}END