|
1 | 1 | <?xml version='1.0' encoding='UTF-8'?> |
2 | 2 | <!DOCTYPE xep SYSTEM 'xep.dtd' [ |
3 | | - <!ENTITY rfc5056 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5056'>RFC 5056</link></span> <note>RFC 5056: On the Use of Channel Bindings to Secure Channels <<link url='http://tools.ietf.org/html/rfc5056'>http://tools.ietf.org/html/rfc5056</link>>.</note>" > |
4 | 3 | <!ENTITY iana-cb-types "<span class='ref'><link url='https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml'>IANA Channel-Binding Types Registry</link></span> <note>IANA Channel-Binding Types Registry <<link url='https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml'>https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml</link>>.</note>" > |
5 | 4 | <!ENTITY % ents SYSTEM 'xep.ent'> |
6 | 5 | %ents; |
|
24 | 23 | <supersededby/> |
25 | 24 | <shortname>sasl-cb-types</shortname> |
26 | 25 | &flow; |
| 26 | + &tmolitor; |
| 27 | + <revision> |
| 28 | + <version>0.5</version> |
| 29 | + <date>2025-10-25</date> |
| 30 | + <initials>tm</initials> |
| 31 | + <remark> |
| 32 | + <ul> |
| 33 | + <li>Rework whole 'Interaction with SASL mechanisms' and 'Security Considerations' sections</li> |
| 34 | + </ul> |
| 35 | + </remark> |
| 36 | + </revision> |
27 | 37 | <revision> |
28 | 38 | <version>0.4.2</version> |
29 | 39 | <date>2024-07-02</date> |
|
32 | 42 | <ul> |
33 | 43 | <li>Add an XML schema.</li> |
34 | 44 | <li>Mention that this specification does add a new namespace that should go to the registrar.</li> |
35 | | - <li>Fix indentation, typos, misuse of '' vs. </> for elements, etc.</li> |
| 45 | + <li>Fix indentation, typos, misuse of '' vs. </> for elements, etc.</li> |
36 | 46 | </ul> |
37 | 47 | </remark> |
38 | 48 | </revision> |
|
93 | 103 | basically unspecified.</p> |
94 | 104 |
|
95 | 105 | <p>The extension defined herein fills the gap left by &rfc6120;, by |
96 | | - allowing the server the announce its supported channel-binding |
| 106 | + allowing the server to announce its supported channel-binding |
97 | 107 | types.</p> |
98 | 108 |
|
99 | 109 | </section1> |
|
108 | 118 | SHOULD be the "Channel-binding unique prefix" of a channel-binding |
109 | 119 | type which was registered with the &iana-cb-types;.</p> |
110 | 120 |
|
111 | | - <p>A server declares that it supports particular channel-binding |
| 121 | + <p>A server declares that it supports a particular channel-binding |
112 | 122 | types by listing the supported types via the <sasl-channel-binding/> |
113 | 123 | stream feature defined herein. The <sasl-channel-binding/> element could |
114 | 124 | appear next to the SASL <mechanisms/> |
|
119 | 129 | <authentication/> stream-feature element as specified in the |
120 | 130 | &xep0388;.</p> |
121 | 131 |
|
122 | | - <example caption='Example <mechanisms/> stream feature with SASL Channel-Binding Type Capability.'><![CDATA[ |
| 132 | + <example caption='Example SASL1 <mechanisms/> stream feature with SASL Channel-Binding Type Capability.'><![CDATA[ |
123 | 133 | <stream:features> |
124 | 134 | <sasl-channel-binding xmlns='urn:xmpp:sasl-cb:0'> |
125 | 135 | <channel-binding type='tls-server-end-point'/> |
|
132 | 142 | </mechanisms> |
133 | 143 | </stream:features>]]></example> |
134 | 144 |
|
| 145 | +<example caption='Example SASL2 <authentication> stream feature with SASL Channel-Binding Type Capability.'><![CDATA[ |
| 146 | +<stream:features> |
| 147 | + <sasl-channel-binding xmlns='urn:xmpp:sasl-cb:0'> |
| 148 | + <channel-binding type='tls-server-end-point'/> |
| 149 | + <channel-binding type='tls-exporter'/> |
| 150 | + </sasl-channel-binding> |
| 151 | + <authentication xmlns='urn:xmpp:sasl:2'> |
| 152 | + <mechanism>SCRAM-SHA-1</mechanism> |
| 153 | + <mechanism>SCRAM-SHA-1-PLUS</mechanism> |
| 154 | + <inline> |
| 155 | + <sm xmlns='urn:xmpp:sm:3'/> |
| 156 | + <bind xmlns='urn:xmpp:bind:0'/> |
| 157 | + </inline> |
| 158 | + </authentication> |
| 159 | +</stream:features>]]></example> |
| 160 | + |
135 | 161 | </section1> |
136 | 162 |
|
137 | 163 | <section1 topic='Interaction with SASL mechanisms' anchor='sasl-mech-interaction'> |
138 | 164 |
|
139 | | - <p>Some channel-binding enabled SASL mechanisms reflect the server's |
140 | | - presumed channel-binding abilities back to the server. This prevents |
141 | | - SASL mechanism stripping attacks, where a Man in the Middle (MITM) |
142 | | - removes certain SASL mechanisms in an attempt to downgrade the |
143 | | - mechanism choosen for authentication to a non-channel-binding enabled |
144 | | - one. An example of a SASL mechanism family with this feature is |
145 | | - &rfc5802;. This standard specifies the gs2-cbind-flag. The flag has a |
146 | | - tristate value of "I don't support channel-binding" (n), "I think you |
147 | | - do not support channel-binding, but I do" (y), or, "Let us use |
148 | | - channel-binding type X" (p).</p> |
149 | | - |
150 | | - <p>Clients using the information provided |
151 | | - via <sasl-channel-binding/> MAY want to indicate to the server |
152 | | - that they do not support channel-binding (even if they do) if no |
153 | | - mutual supported channel-binding type was found. The only alternative |
154 | | - is, that the client signals the server that it believes that the server |
155 | | - does not support channel binding. But this may cause the server to |
156 | | - terminate the connection, because it indicates a potential ongoing |
157 | | - SASL mechanism stripping attack.</p> |
| 165 | + <p>Client developers MUST follow the following rules to ensure that implementing this specification |
| 166 | + in conjunction with SCRAM (&rfc5802;) or any other SASL mechanism supporting channel-binding |
| 167 | + does not introduce a MITM attack vector.</p> |
| 168 | + |
| 169 | + <ol> |
| 170 | + <li>Servers MUST implement tls-server-end-point and enable/advertise it. |
| 171 | + Clients SHOULD implement tls-server-end-point and use it if no other |
| 172 | + (stronger) channel-binding method is supported by both sides.</li> |
| 173 | + <li>If the client doesn't support channel-binding, it MUST send "n" in the GSS-header (see &rfc5802;).</li> |
| 174 | + <li>If the client supports channel-binding, but the server announced neither 'SCRAM-*-PLUS' nor |
| 175 | + channel-binding types (via this specification), it MUST send "y" in accordance to &rfc5802;.</li> |
| 176 | + <li>If the client is using SASL2 (&xep0388;) to authenticate and received announcements |
| 177 | + for 'SCRAM-*-PLUS' from the server, but no channel-binding types, it MUST abort the authentication |
| 178 | + (this is either an implementation error or ongoing MITM attack). |
| 179 | + This condition is undefined with SASL1 (&rfc6120;), but the client MAY also abort authentication |
| 180 | + in this case (or just randomly pick a channel-binding and hope for the best).</li> |
| 181 | + <li>If the client is using SASL2 to authenticate and it receives channel-binding announcements, |
| 182 | + from the server, but no 'SCRAM-*-PLUS' methods are announced, it MUST abort authentication |
| 183 | + (this is an implementation error or ongoing MITM attack). It SHOULD do the same when using SASL1.</li> |
| 184 | + <li>If the client is using either SASL1 or SASL2 to authenticate and receives announcements for |
| 185 | + 'SCRAM-*-PLUS' methods and channel-binding types, but none of these announced channel-binding types are |
| 186 | + supported by it, it MUST abort authentication, if tls-server-end-point is also not advertised by the server |
| 187 | + (this is an ongoing MITM attack, as per our first rule above).</li> |
| 188 | + <li>The client SHOULD use a channel-binding stronger than tls-server-end-point, if advertised |
| 189 | + by the server and implemented by it (that is: set the p=<channel-binding-name> GSS-header |
| 190 | + to that channel-binding type according to &rfc5802;).</li> |
| 191 | + </ol> |
| 192 | + |
| 193 | + <p>When implementing &xep0474; the above rules might be relaxed a bit, see that specification for details.</p> |
158 | 194 |
|
159 | 195 | </section1> |
160 | 196 |
|
161 | 197 | <section1 topic='Security Considerations' anchor='security'> |
162 | 198 |
|
163 | | - <p>If a client signals to the server that it does not support |
164 | | - channel binding, because it found no mutual supported |
165 | | - channel-binding types, another MITM attack |
166 | | - vector is introduced. An active attacker could replace the |
167 | | - <sasl-channel-binding;> list with channel bindings unlikely |
168 | | - (or impossible) to be supported by the client. If the client is |
169 | | - configured to use non-channel-binding SASL mechanisms as a fallback, |
170 | | - this could be used to downgrade the connection security. Note that |
171 | | - this attack is a different one than the SASL mechanism stripping one: |
172 | | - Here the attacker tempers with the announced channel-binding types, |
173 | | - i.e., the values within <sasl-channel-binding;></p> |
174 | | - |
175 | | - <p>Depending on the application's security policy, clients may |
176 | | - refrain from falling back to non-channel-binding SASL mechanisms |
177 | | - if no mutual supported channel-binding type is available. |
178 | | - Alternatively, they may try channel-binding with a supported type |
179 | | - nevertheless. To mitigate the attack describe above, clients |
180 | | - could "pin" the announced channel bindings types by a service. In that |
181 | | - case, implementations may want to allow the set of pinned channel-binding |
182 | | - types to be extended to stronger ones.</p> |
183 | | - |
184 | | - <p>As further mitigation, servers MUST and clients are RECOMMENDED to |
185 | | - at least implement the channel-binding type tls-server-end-point (&rfc5929;) |
186 | | - to increase the probability of a mutual supported channel-binding type. However, |
187 | | - due its improved security properties, the tls-exporter (&rfc9266;) channel-binding |
188 | | - type should be prefered over tls-server-end-point.</p> |
| 199 | + <p>The following considerations refer to SCRAM, |
| 200 | + as it is the only widely depolyed mechanism with channel binding |
| 201 | + at the time of writing this document.</p> |
| 202 | + |
| 203 | + <p>In SCRAM (&rfc5802;) the client-first-message contains three possible values in the |
| 204 | + GSS-header part:</p> |
| 205 | + <ol> |
| 206 | + <li>y - The client would have used channel-binding, but the server did not offer any.</li> |
| 207 | + <li>n - The client does not support channel-binding (even if the server offered any).</li> |
| 208 | + <li>p=<cb-name> - The name of the channel-binding, the client wants to use.</li> |
| 209 | + </ol> |
| 210 | + |
| 211 | + <p>The RFC explains, that sending "y" when the server advertised channel-binding |
| 212 | + support is to be used as a MITM-detection. An attacker stripping out all *-PLUS variants can be detected this way: |
| 213 | + the server knows it advertised them and the client reports via "y", that it would have used them if it saw them advertised, |
| 214 | + so the server can abort the authentication in this case.</p> |
| 215 | + |
| 216 | + <p>This works reasonably well, if there is only one single channel-binding |
| 217 | + possible. But that's the exact assumption this specification now changes: |
| 218 | + it is now possible to advertise a list of different channel-bindings for the client |
| 219 | + to choose.</p> |
| 220 | + |
| 221 | + <p>But this creates a problem: what to do if the server advertised a list of |
| 222 | + channel-binding algorithms, but the client doesn't support any of these? |
| 223 | + Assuming there is no MITM attacker present, the client can't send "y" in the GSS-header, |
| 224 | + because the server would then abort the authentication because it advertised channel-bindings. |
| 225 | + Sending "n" and continuing without channel-binding is fine in this case, |
| 226 | + but it won't be if a MITM attacker were present. |
| 227 | + <note>This isn't fully hypothetical. An older client might only support tls-unique, |
| 228 | + while the server only advertises tls-exporter (which can be used for tls 1.2, |
| 229 | + too, if the extended master secret is used). |
| 230 | + Blocking the connection entirely is of course at the discretion of the client |
| 231 | + developer, but it hinders interoperability, especially while phasing out one |
| 232 | + channel-binding-type and introducing a new one.</note></p> |
| 233 | + |
| 234 | + <p>Any MITM attacker could just manipulate the list of channel-bindings advertised using this specification |
| 235 | + to just list some dummy mechanisms the client doesn't support. If the client acted like |
| 236 | + in the non-attacker case depicted in the last paragraph and sent "n", |
| 237 | + the attacker would have successfully downgraded the client to non-channel-binding. |
| 238 | + The client won't be able to distinguish the attacker case from the non-attacker one.</p> |
| 239 | + |
| 240 | + <p>The rules in the <link url="#sasl-mech-interaction">Interaction with SASL mechanisms</link> |
| 241 | + section fix that loophole. Tls-server-end-point was picked, because it is the lowest denominator |
| 242 | + that can be implemented by virtually everyone and even though it isn't as strong as tls-exporter |
| 243 | + or tls-unique, it still catches many attacks. |
| 244 | + <strong>This only works reliably, if <em>every</em> server supports and announces tls-server-end-point.</strong></p> |
| 245 | + |
| 246 | + <p>A client following the rules above and seeing a server-advertised list without |
| 247 | + tls-sever-end-point, immediately knows, that some attacker tampered with the list of channel-binding types |
| 248 | + and can abort the authentication. It never needs to send "n" even though it supports channel-binding and |
| 249 | + can still safely send "y" if it doesn't see any 'SCRAM-*-PLUS' variants and channel-bindings announced.</p> |
189 | 250 |
|
190 | 251 | </section1> |
191 | 252 |
|
|
0 commit comments