idnits 2.17.1 draft-ietf-tokbind-https-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 2 characters in excess of 72. ** The abstract seems to contain references ([RFC5246], [I-D.ietf-tokbind-protocol]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 26, 2016) is 2794 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC6750' is defined on line 900, but no explicit reference was found in the text == Outdated reference: A later version (-14) exists of draft-ietf-tokbind-negotiation-03 == Outdated reference: A later version (-19) exists of draft-ietf-tokbind-protocol-08 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 5 errors (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force A. Popov 3 Internet-Draft M. Nystroem 4 Intended status: Standards Track Microsoft Corp. 5 Expires: February 27, 2017 D. Balfanz, Ed. 6 A. Langley 7 Google Inc. 8 J. Hodges 9 Paypal 10 August 26, 2016 12 Token Binding over HTTP 13 draft-ietf-tokbind-https-06 15 Abstract 17 This document describes a collection of mechanisms that allow HTTP 18 servers to cryptographically bind authentication tokens (such as 19 cookies and OAuth tokens) to TLS [RFC5246] connections. 21 We describe both _first-party_ and _federated_ scenarios. In a 22 first-party scenario, an HTTP server is able to cryptographically 23 bind the security tokens it issues to a client, and which the client 24 subsequently returns to the server, to the TLS connection between the 25 client and server. Such bound security tokens are protected from 26 misuse since the server can generally detect if they are replayed 27 inappropriately, e.g., over other TLS connections. 29 Federated token bindings, on the other hand, allow servers to 30 cryptographically bind security tokens to a TLS connection that the 31 client has with a _different_ server than the one issuing the token. 33 This Internet-Draft is a companion document to The Token Binding 34 Protocol [I-D.ietf-tokbind-protocol] 36 Status of This Memo 38 This Internet-Draft is submitted in full conformance with the 39 provisions of BCP 78 and BCP 79. 41 Internet-Drafts are working documents of the Internet Engineering 42 Task Force (IETF). Note that other groups may also distribute 43 working documents as Internet-Drafts. The list of current Internet- 44 Drafts is at http://datatracker.ietf.org/drafts/current/. 46 Internet-Drafts are draft documents valid for a maximum of six months 47 and may be updated, replaced, or obsoleted by other documents at any 48 time. It is inappropriate to use Internet-Drafts as reference 49 material or to cite them other than as "work in progress." 51 This Internet-Draft will expire on February 27, 2017. 53 Copyright Notice 55 Copyright (c) 2016 IETF Trust and the persons identified as the 56 document authors. All rights reserved. 58 This document is subject to BCP 78 and the IETF Trust's Legal 59 Provisions Relating to IETF Documents 60 (http://trustee.ietf.org/license-info) in effect on the date of 61 publication of this document. Please review these documents 62 carefully, as they describe your rights and restrictions with respect 63 to this document. Code Components extracted from this document must 64 include Simplified BSD License text as described in Section 4.e of 65 the Trust Legal Provisions and are provided without warranty as 66 described in the Simplified BSD License. 68 Table of Contents 70 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 71 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 72 2. The Sec-Token-Binding Header Field . . . . . . . . . . . . . 4 73 2.1. HTTPS Token Binding Key Pair Scoping . . . . . . . . . . 4 74 3. First-party Use Cases . . . . . . . . . . . . . . . . . . . . 5 75 4. Federation Use Cases . . . . . . . . . . . . . . . . . . . . 5 76 4.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 5 77 4.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . 6 78 4.3. HTTP Redirects . . . . . . . . . . . . . . . . . . . . . 7 79 4.4. Negotiated Key Parameters . . . . . . . . . . . . . . . . 9 80 4.5. Federation Example . . . . . . . . . . . . . . . . . . . 10 81 5. Implementation Considerations . . . . . . . . . . . . . . . . 12 82 6. Security Considerations . . . . . . . . . . . . . . . . . . . 12 83 6.1. Security Token Replay . . . . . . . . . . . . . . . . . . 12 84 6.2. Triple Handshake Vulnerability in TLS 1.2 and Older TLS 85 Versions . . . . . . . . . . . . . . . . . . . . . . . . 13 86 6.3. Sensitivity of the Sec-Token-Binding Header . . . . . . . 13 87 6.4. Securing Federated Sign-On Protocols . . . . . . . . . . 14 88 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 16 89 7.1. Scoping of Token Binding Keys . . . . . . . . . . . . . . 16 90 7.2. Life Time of Token Binding Keys . . . . . . . . . . . . . 16 91 7.3. Correlation . . . . . . . . . . . . . . . . . . . . . . . 17 92 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 93 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 18 94 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 95 10.1. Normative References . . . . . . . . . . . . . . . . . . 18 96 10.2. Informative References . . . . . . . . . . . . . . . . . 19 97 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 20 99 1. Introduction 101 The Token Binding Protocol [I-D.ietf-tokbind-protocol] defines a 102 Token Binding ID for a TLS connection between a client and a server. 103 The Token Binding ID of a TLS connection is related to a private key, 104 that the client proves possession of to the server, and is long-lived 105 (i.e., subsequent TLS connections between the same client and server 106 have the same Token Binding ID). When issuing a security token (e.g. 107 an HTTP cookie or an OAuth token) to a client, the server can include 108 the Token Binding ID in the token, thus cryptographically binding the 109 token to TLS connections between that particular client and server, 110 and inoculating the token against abuse (re-use, attempted 111 impersonation, etc.) by attackers. 113 While the Token Binding Protocol [I-D.ietf-tokbind-protocol] defines 114 a message format for establishing a Token Binding ID, it does not 115 specify how this message is embedded in higher-level protocols. The 116 purpose of this specification is to define how TokenBindingMessages 117 are embedded in HTTP (both versions 1.1 [RFC7230] and 2 [RFC7540]). 118 Note that TokenBindingMessages are only defined if the underlying 119 transport uses TLS. This means that Token Binding over HTTP is only 120 defined when the HTTP protocol is layered on top of TLS (commonly 121 referred to as HTTPS). 123 HTTP clients establish a Token Binding ID with a server by including 124 a special HTTP header field in HTTP requests. The HTTP header field 125 value is a base64url-encoded TokenBindingMessage. 127 TokenBindingMessages allow clients to establish multiple Token 128 Binding IDs with the server, by including multiple TokenBinding 129 structures in the TokenBindingMessage. By default, a client will 130 establish a _provided_ Token Binding ID with the server, indicating a 131 Token Binding ID that the client will persistently use with the 132 server. Under certain conditions, the client can also include a 133 _referred_ Token Binding ID in the TokenBindingMessage, indicating a 134 Token Binding ID that the client is using with a _different_ server 135 than the one that the TokenBindingMessage is sent to. This is useful 136 in federation scenarios. 138 1.1. Requirements Language 140 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 141 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 142 document are to be interpreted as described in [RFC2119]. 144 2. The Sec-Token-Binding Header Field 146 Once a client and server have negotiated the Token Binding Protocol 147 with HTTP/1.1 or HTTP/2 (see [I-D.ietf-tokbind-protocol] and 148 [I-D.ietf-tokbind-negotiation]), clients MUST include the Sec-Token- 149 Binding header field in their HTTP requests. The ABNF of the Sec- 150 Token-Binding header field is (in [RFC7230] style, see also [RFC7231] 151 Section 8.3): 153 Sec-Token-Binding = EncodedTokenBindingMessage 155 The header field name is "Sec-Token-Binding" and its value is a 156 base64url encoding of the TokenBindingMessage defined in 157 [I-D.ietf-tokbind-protocol] using the URL- and filename-safe 158 character set described in Section 5 of [RFC4648], with all trailing 159 pad characters '=' omitted and without the inclusion of any line 160 breaks, whitespace, or other additional characters. 162 For example: 164 Sec-Token-Binding: 166 The TokenBindingMessage MUST contain one TokenBinding structure with 167 TokenBindingType of provided_token_binding, which MUST be signed with 168 the Token Binding private key used by the client for connections 169 between itself and the server that the HTTP request is sent to 170 (clients use different Token Binding keys for different servers, see 171 Section 2.1 below). The Token Binding ID established by this 172 TokenBinding is called a _Provided Token Binding ID_. 174 The TokenBindingMessage MAY also contain one TokenBinding structure 175 with TokenBindingType of referred_token_binding, as specified in 176 Section 4.3. In addition to the latter, or rather than the latter, 177 the TokenBindingMessage MAY contain other TokenBinding structures. 178 This is use case-specific, and such use cases are outside the scope 179 of this specification. 181 In HTTP/2, the client SHOULD use Header Compression [RFC7541] to 182 avoid the overhead of repeating the same header field in subsequent 183 HTTP requests. 185 2.1. HTTPS Token Binding Key Pair Scoping 187 HTTPS is used in conjunction with various application protocols, and 188 application contexts, in various ways. For example, general purpose 189 Web browsing is one such HTTP-based application context. Within the 190 latter context, HTTP cookies [RFC6265] are typically utilized for 191 state management, including client authentication. A related, though 192 distinct, example of other HTTP-based application contexts is where 193 OAuth tokens [RFC6749] are utilized to manage authorization for 194 third-party application access to resources. The token scoping rules 195 of these two examples can differ: the scoping rules for cookies are 196 concisely specified in [RFC6265], whereas OAuth is a framework and 197 defines various token types with various scopings, some of which are 198 determined by the encompassing application. 200 The Token Binding key pair scoping for those key pairs generated in 201 the context of the first-party and federation use cases defined in 202 this specification (below), and to be used for binding HTTP cookies 203 MUST be at the granularity of "effective top-level domain (public 204 suffix) + 1" (eTLD+1), i.e., at the same granularity at which cookies 205 can be set (see [RFC6265]). Key pairs used to bind other application 206 tokens, such as OAuth tokens, SHOULD adhere to the above eTLD+1 207 scoping requirement for those tokens being employed in first-party or 208 federation scenarios as described below, e.g., OAuth refresh tokens 209 or Open ID Connect "ID Tokens". See also Section 7.1, below. 211 Scoping rules for other HTTP-based application contexts are outside 212 the scope of this specification. 214 3. First-party Use Cases 216 In a first-party use case, an HTTP server issues a security token 217 such as a cookie (or similar) to a client, and expects the client to 218 return the security token at a later time, e.g., in order to 219 authenticate. Binding the security token to the TLS connection 220 between client and server protects the security token from misuse 221 since the server can detect if the security token is replayed 222 inappropriately, e.g., over other TLS connections. 224 See [I-D.ietf-tokbind-protocol] Section 6 for general guidance 225 regarding binding of security tokens and their subsequent validation. 227 4. Federation Use Cases 229 4.1. Introduction 231 For privacy reasons, clients use different private keys to establish 232 Provided Token Binding IDs with different servers. As a result, a 233 server cannot bind a security token (such as an OAuth token or an 234 OpenID Connect identity token) to a TLS connection that the client 235 has with a different server. This is, however, a common requirement 236 in federation scenarios: For example, an Identity Provider may wish 237 to issue an identity token to a client and cryptographically bind 238 that token to the TLS connection between the client and a Relying 239 Party. 241 In this section we describe mechanisms to achieve this. The common 242 idea among these mechanisms is that a server (called the _Token 243 Consumer_ in this document) signals to the client that it should 244 reveal the Provided Token Binding ID that is used between the client 245 and itself, to another server (called the _Token Provider_ in this 246 document). Also common across the mechanisms is how the Token 247 Binding ID is revealed to the Token Provider: The client uses the 248 Token Binding Protocol [I-D.ietf-tokbind-protocol], and includes a 249 TokenBinding structure in the Sec-Token-Binding HTTP header field 250 defined above. What differs between the various mechanisms is _how_ 251 the Token Consumer signals to the client that it should reveal the 252 Token Binding ID to the Token Provider. Below we specify one such 253 mechanism, which is suitable for redirect-based interactions between 254 Token Consumers and Token Providers. 256 4.2. Overview 258 In a Federated Sign-On protocol, an Identity Provider issues an 259 identity token to a client, which sends the identity token to a 260 Relying Party to authenticate itself. Examples of this include 261 OpenID Connect (where the identity token is called "ID Token") and 262 SAML (where the identity token is a SAML assertion). 264 To better protect the security of the identity token, the Identity 265 Provider may wish to bind the identity token to the TLS connection 266 between the client and the Relying Party, thus ensuring that only 267 said client can use the identity token: The Relying Party will 268 compare the Token Binding ID in the identity token with the Token 269 Binding ID of the TLS connection between it and the client. 271 This is an example of a federation scenario, which more generally can 272 be described as follows: 274 o A Token Consumer causes the client to issue a token request to the 275 Token Provider. The goal is for the client to obtain a token and 276 then use it with the Token Consumer. 278 o The client delivers the token request to the Token Provider. 280 o The Token Provider issues the token. The token is issued for the 281 specific Token Consumer who requested it (thus preventing 282 malicious Token Consumers from using tokens with other Token 283 Consumers). The token is, however, typically a bearer token, 284 meaning that any client can use it with the Token Consumer, not 285 just the client to which it was issued. 287 o Therefore, in the previous step, the Token Provider may want to 288 include in the token the Token-Binding public key that the client 289 uses when communicating with the Token Consumer, thus _binding_ 290 the token to client's Token-Binding keypair. The client proves 291 possession of the private key when communicating with the Token 292 Consumer through the Token Binding Protocol 293 [I-D.ietf-tokbind-protocol], and reveals the corresponding public 294 key of this keypair as part of the Token Binding ID. Comparing 295 the public key from the token with the public key from the Token 296 Binding ID allows the Token Consumer to verify that the token was 297 sent to it by the legitimate client. 299 o To allow the Token Provider to include the Token-Binding public 300 key in the token, the Token Binding ID (between client and Token 301 Consumer) must therefore be communicated to the Token Provider 302 along with the token request. Communicating a Token Binding ID 303 involves proving possession of a private key and is described in 304 the Token Binding Protocol [I-D.ietf-tokbind-protocol]. 306 The client will perform this last operation (proving possession of a 307 private key that corresponds to a Token Binding ID between the client 308 and the Token Consumer while delivering the token request to the 309 Token Provider) only if the Token Consumer requests the client to do 310 so. 312 Below, we specify how Token Consumers can signal this request in 313 redirect-based federation protocols. Note that this assumes that the 314 federated sign-on flow starts at the Token Consumer, or at the very 315 least include a redirect from Token Consumer to Token Provider. It 316 is outside the scope of this document to specify similar mechanisms 317 for flows that do not include such redirects. 319 4.3. HTTP Redirects 321 When a Token Consumer redirects the client to a Token Provider as a 322 means to deliver the token request, it SHOULD include a Include- 323 Referred-Token-Binding-ID HTTP response header field in its HTTP 324 response. The ABNF of the Include-Referred-Token-Binding-ID header 325 is (in [RFC7230] style, see also [RFC7231] Section 8.3): 327 Include-Referred-Token-Binding-ID = "true" 329 Where the header field name is "Include-Referred-Token-Binding-ID", 330 and the field-value of "true" is case-insensitive. For example: 332 Include-Referred-Token-Binding-ID: true 334 Including this response header field signals to the client that it 335 should reveal, to the Token Provider, the Token Binding ID used 336 between itself and the Token Consumer. In the absence of this 337 response header field, the client will not disclose any information 338 about the Token Binding used between the client and the Token 339 Consumer to the Token Provider. 341 As illustrated in Section 4.5, when a client receives this header 342 field, it should take the TokenBindingID of the provided TokenBinding 343 from the referrer and create a referred TokenBinding with it to 344 include in the TokenBindingMessage on the redirect request. In other 345 words, the Token Binding message in the redirect request to the Token 346 Provider now includes one provided binding and one referred binding, 347 the latter constructed from the binding between the client and the 348 Token Consumer. 350 When a client receives the Include-Referred-Token-Binding-ID header, 351 it includes the referred token binding even if both the Token 352 Provider and the Token Consumer fall under the same eTLD+1 and the 353 provided and referred token binding IDs are the same. Note that the 354 referred token binding is sent only on the request resulting from the 355 redirect and not on any subsequent requests to the Token Provider. 357 If the Include-Referred-Token-Binding-ID header field is received in 358 response to a request that did not include the Token-Binding header 359 field, the client MUST ignore the Include-Referred-Token-Binding-ID 360 header field. 362 This header field has only meaning if the HTTP status code is 301, 363 302, 303, 307 or 308, and MUST be ignored by the client for any other 364 status codes. If the client supports the Token Binding Protocol, and 365 has negotiated the Token Binding Protocol with both the Token 366 Consumer and the Token Provider, it already sends the Sec-Token- 367 Binding header field to the Token Provider with each HTTP request 368 (see above). 370 The TokenBindingMessage SHOULD contain a TokenBinding with 371 TokenBindingType referred_token_binding. If included, this 372 TokenBinding MUST be signed with the Token Binding key used by the 373 client for connections between itself and the Token Consumer (more 374 specifically, the web origin that issued the Include-Referred-Token- 375 Binding-ID response header field). The Token Binding ID established 376 by this TokenBinding is called a _Referred Token Binding ID_. 378 As described above, the TokenBindingMessage MUST additionally contain 379 a Provided Token Binding ID, i.e., a TokenBinding structure with 380 TokenBindingType provided_token_binding, which MUST be signed with 381 the Token Binding key used by the client for connections between 382 itself and the Token Provider (more specifically, the web origin that 383 the token request is being sent to). 385 If for some deployment-specific reason the initial Token Provider 386 ("TP1") needs to redirect the client to another Token Provider 387 ("TP2"), rather than directly back to the Token Consumer, it can be 388 accomodated using the header fields defined in this specification in 389 the following fashion ("the redirect-chain approach"): 391 Initially, the client is redirected to TP1 by the Token Consumer 392 ("TC"), as described above. Upon receiving the client's request, 393 containing a TokenBindingMessage which contains both provided and 394 referred TokenBindings (for TP1 and TC, respectively), TP1 395 responds to the client with a redirect response containing the 396 Include-Referred-Token-Binding-ID header field and directing the 397 client to send a request to TP2. This causes the client to follow 398 the same pattern and send a request containing a 399 TokenBindingMessage which contains both provided and referred 400 TokenBindings (for TP2 and TP1, respectively) to TP2. Note that 401 this pattern can continue to further Token Providers. In this 402 case, TP2 issues a security token, bound to the client's 403 TokenBinding with TP1, and sends a redirect response to the client 404 pointing to TP1. TP1 in turn constructs a security token for the 405 Token Consumer, bound to the TC's referred TokenBinding which had 406 been conveyed earlier, and sends a redirect response pointing to 407 the TC, containing the bound security token, to the client. 409 The above is intended as only a non-normative example. Details are 410 specific to deployment contexts. Other approaches are possible, but 411 are outside the scope of this specification. 413 4.4. Negotiated Key Parameters 415 The TLS Extension for Token Binding Protocol Negotiation 416 [I-D.ietf-tokbind-negotiation] allows the server and client to 417 negotiate the parameters (signature algorithm, length) of the Token 418 Binding key. It is possible that the Token Binding ID used between 419 the client and the Token Consumer, and the Token Binding ID used 420 between the client and Token Provider, use different key parameters. 421 The client MUST use the key parameters negotiated with the Token 422 Consumer in the referred_token_binding TokenBinding of the 423 TokenBindingMessage, even if those key parameters are different from 424 the ones negotiated with the origin that the header field is sent to. 426 Token Providers SHOULD support all the Token Binding key parameters 427 specified in the [I-D.ietf-tokbind-protocol]. If a token provider 428 does not support the key parameters specified in the 429 referred_token_binding TokenBinding in the TokenBindingMessage, it 430 MUST NOT issue a bound token. 432 4.5. Federation Example 434 The diagram below shows a typical HTTP Redirect-based Web Browser SSO 435 Profile (no artifact, no callbacks), featuring binding of, e.g., a 436 TLS Token Binding ID into an OpenID Connect "ID Token". 438 Legend: 440 +------------+------------------------------------------------------+ 441 | EKM: | TLS Exported Keying Material [RFC5705] | 442 | {EKMn}Ksm: | EKM for server "n", signed by private key of TBID | 443 | | "m", where "n" must represent server receiving the | 444 | | ETBMSG, if a conveyed TB's type is | 445 | | provided_token_binding, then m = n, else if TB's | 446 | | type is referred_token_binding, then m != n. E.g., | 447 | | see step 1b in diagram below. | 448 | ETBMSG: | "Sec-Token-Binding" HTTP header field conveying an | 449 | | EncodedTokenBindingMessage, in turn conveying | 450 | | TokenBinding (TB)struct(s), e.g.: ETBMSG[[TB]] or | 451 | | ETBMSG[[TB1],[TB2]] | 452 | ID Token: | the "ID Token" in OIDC, it is the semantic | 453 | | equivalent of a SAML "authentication assertion". "ID | 454 | | Token w/TBIDn" denotes a "token bound" ID Token | 455 | | containing TBIDn. | 456 | Ks & Kp: | private (aka secret) key, and public key, | 457 | | respectively, of client-side Token Binding key pair | 458 | OIDC: | Open ID Connect | 459 | TB: | TokenBinding struct containing signed EKM, TBID, and | 460 | | TB type, e.g.: | 461 | | [{EKM1}Ks1,TBID1,provided_token_binding] | 462 | TBIDn: | Token Binding ID for client and server n's token- | 463 | | bound TLS association. TBIDn contains Kpn. | 464 +------------+------------------------------------------------------+ 466 Client, Token Consumer, Token Provider, 467 aka: aka: aka: 468 User Agent OpenID Client, OpenID Provider, 469 OIDC Relying Party, OIDC Provider, 470 SAML Relying Party SAML Identity Provider 471 [ server "1" ] [ server "2" ] 472 +--------+ +----+ +-----+ 473 | Client | | TC | | TP | 474 +--------+ +----+ +-----+ 475 | | | 476 | | | 477 | | | 478 | 0. Client interacts w/TC | | 479 | over HTTPS, establishes Ks1 & Kp1, TBID1 | 480 | ETBMSG[[{EKM1}Ks1,TBID1,provided_token_binding]] | 481 |------------------------------>| | 482 | | | 483 | | | 484 | | | 485 | 1a. OIDC ID Token request, aka| | 486 | "Authentication Request", conveyed with | 487 | HTTP response header field of: | 488 | Include-Referred-Token-Binding-ID:true | 489 | any security-relevant cookies | | 490 | should contain TBID1 | | 491 +<- - - - - - - - - - - - - - - - | | 492 . | (redirect to TP via 301, 302, | | 493 . | 303, 307, or 308) | | 494 . | | | 495 +------------------------------------------------------->| 496 | 1b. opens HTTPS w/TP, | 497 | establishes Ks2, Kp2, TBID2; | 498 | sends GET or POST with | 499 | ETBMSG[[{EKM2}Ks2,TBID2,provided_token_binding], | 500 | [{EKM2}Ks1,TBID1,referred_token_binding]] | 501 | as well as the ID Token request | 502 | | | 503 | | | 504 | | | 505 | 2. user authentication (if applicable, | 506 | methods vary, particulars are out of scope) | 507 |<====================================================>| 508 | (TP generates ID Token for TC containing TBID1, may | 509 | also set cookie(s) containing TBID2 and/or TBID1, | 510 | details vary, particulars are out of scope) | 511 | | | 512 | | | 513 | | | 514 | 3a. ID Token containing Kp1, issued for TC, | 515 | conveyed via OIDC "Authentication Response" | 516 +<- - - - - - - - - - - - - - - - - - - - - - - - - - - -| 517 . | (redirect to TC) | | 518 . | | | 519 . | | | 520 +-------------------------------->| | 521 | 3b. HTTPS GET or POST with | 522 | ETBMSG[[{EKM1}Ks1,TBID1,provided_token_binding]] | 523 | conveying Authn Reponse containing | 524 | ID Token w/TBID1, issued for TC | 525 | | | 526 | | | 527 | | | 528 | 4. user is signed-on, any security-relevant cookie(s)| 529 | that are set SHOULD contain TBID1 | 530 |<------------------------------| | 531 | | | 532 | | | 534 5. Implementation Considerations 536 HTTPS-based applications may have multi-party use cases other than, 537 or in addition to, the HTTP redirect-based signaling-and-conveyance 538 of referred token bindings, as presented above in Section 4.3. 540 Thus, generic Token Binding implementations intended to support any 541 HTTPS-based client-side application (e.g., so-called "native 542 applications"), should provide means for applications to have Token 543 Binding messages, containing Token Binding IDs of various 544 application-specified Token Binding types and for application- 545 specified TLS connections, conveyed over an application-specified 546 HTTPS connection, i.e., within the TokenBindingMessage conveyed by 547 the Sec-Token-Binding header field. 549 However, such applications MUST only convey Token Binding IDs to 550 other servers if the server associated with a Token Binding ID 551 explicitly signals to do so, e.g., by returning an Include-Referred- 552 Token-Binding-ID HTTP response header field. 554 NOTE: See Section 7 "Privacy Considerations", for privacy guidance 555 regarding the use of this functionality. 557 6. Security Considerations 559 6.1. Security Token Replay 561 The goal of the Federated Token Binding mechanisms is to prevent 562 attackers from exporting and replaying tokens used in protocols 563 between the client and Token Consumer, thereby impersonating 564 legitimate users and gaining access to protected resources. Bound 565 tokens can still be replayed by malware present in the client. In 566 order to export the token to another machine and successfully replay 567 it, the attacker also needs to export the corresponding private key. 568 The Token Binding private key is therefore a high-value asset and 569 MUST be strongly protected, ideally by generating it in a hardware 570 security module that prevents key export. 572 6.2. Triple Handshake Vulnerability in TLS 1.2 and Older TLS Versions 574 The Token Binding protocol relies on the exported key material (EKM) 575 value [RFC5705] to associate a TLS connection with a TLS Token 576 Binding. The triple handshake attack [TRIPLE-HS] is a known 577 vulnerability in TLS 1.2 and older TLS versions, allowing the 578 attacker to synchronize keying material between TLS connections. The 579 attacker can then successfully replay bound tokens. For this reason, 580 the Token Binding protocol MUST NOT be negotiated with these TLS 581 versions, unless the Extended Master Secret [RFC7627] TLS extension 582 has also been negotiated. In addition, TLS renegotiation MUST NOT be 583 initiated or allowed, unless the Renegotiation Indication [RFC5746] 584 TLS extension has been negotiated. 586 6.3. Sensitivity of the Sec-Token-Binding Header 588 The purpose of the Token Binding protocol is to convince the server 589 that the client that initiated the TLS connection controls a certain 590 key pair. For the server to correctly draw this conclusion after 591 processing the Sec-Token-Binding header field, certain secrecy and 592 integrity requirements must be met. 594 For example, the client's private Token Binding key must be kept 595 secret by the client. If the private key is not secret, then another 596 actor in the system could create a valid Token Binding header field, 597 impersonating the client. This can render the main purpose of the 598 protocol - to bind bearer tokens to certain clients - moot: Consider, 599 for example, an attacker who obtained (perhaps through a network 600 intrusion) an authentication cookie that a client uses with a certain 601 server. Consider further that the server bound that cookie to the 602 client's Token Binding ID precisely to thwart misuse of the cookie. 603 If the attacker were to come into possession of the client's private 604 key, he could then establish a TLS connection with the server and 605 craft a Sec-Token-Binding header field that matches the binding 606 present in the cookie, thus successfully authenticating as the 607 client, and gaining access to the client's data at the server. The 608 Token Binding protocol, in this case, did not successfully bind the 609 cookie to the client. 611 Likewise, we need integrity protection of the Sec-Token-Binding 612 header field: A client should not be tricked into sending a Sec- 613 Token-Binding header field to a server that contains Token Binding 614 messages about key pairs that the client does not control. Consider 615 an attacker A that somehow has knowledge of the exported keying 616 material (EKM) for a TLS connection between a client C and a server 617 S. (While that is somewhat unlikely, it is also not entirely out of 618 the question, since the client might not treat the EKM as a secret - 619 after all, a pre-image-resistant hash function has been applied to 620 the TLS master secret, making it impossible for someone knowing the 621 EKM to recover the TLS master secret. Such considerations might lead 622 some clients to not treat the EKM as a secret.) Such an attacker A 623 could craft a Sec-Token-Binding header field with A's key pair over 624 C's EKM. If the attacker could now trick C to send such a header 625 field to S, it would appear to S as if C controls a certain key pair 626 when in fact it does not (the attacker A controls the key pair). 628 If A has a pre-existing relationship with S (perhaps has an account 629 on S), it now appears to the server S as if A is connecting to it, 630 even though it is really C. (If the server S does not simply use 631 Token Binding keys to identify clients, but also uses bound 632 authentication cookies, then A would also have to trick C into 633 sending one of A's cookies to S, which it can do through a variety of 634 means - inserting cookies through Javascript APIs, setting cookies 635 through related-domain attacks, etc.) In other words, A tricked C 636 into logging into A's account on S. This could lead to a loss of 637 privacy for C, since A presumably has some other way to also access 638 the account, and can thus indirectly observe A's behavior (for 639 example, if S has a feature that lets account holders see their 640 activity history on S). 642 Therefore, we need to protect the integrity of the Sec-Token-Binding 643 header field. One origin should not be able to set the Sec-Token- 644 Binding header field (through a DOM API or otherwise) that the User 645 Agent uses with another origin. Employing the "Sec-" header field 646 prefix helps to meet this requirement by denoting the header field 647 name to be a "forbidden header name", see [fetch-spec]. 649 6.4. Securing Federated Sign-On Protocols 651 As explained above, in a federated sign-in scenario a client will 652 prove possession of two different key pairs to a Token Provider: One 653 key pair is the "provided" Token Binding key pair (which the client 654 normally uses with the Token Provider), and the other is the 655 "referred" Token Binding key pair (which the client normally uses 656 with the Token Consumer). The Token Provider is expected to issue a 657 token that is bound to the referred Token Binding key. 659 Both proofs (that of the provided Token Binding key and that of the 660 referred Token Binding key) are necessary. To show this, consider 661 the following scenario: 663 o The client has an authentication token with the Token Provider 664 that is bound to the client's Token Binding key. 666 o The client wants to establish a secure (i.e., free of men-in-the- 667 middle) authenticated session with the Token Consumer, but has not 668 done so yet (in other words, we are about to run the federated 669 sign-on protocol). 671 o A man-in-the-middle is allowed to intercept the connection between 672 client and Token Consumer or between Client and Token Provider (or 673 both). 675 The goal is to detect the presence of the man-in-the-middle in these 676 scenarios. 678 First, consider a man-in-the-middle between the client and the Token 679 Provider. Recall that we assume that the client possesses a bound 680 authentication token (e.g., cookie) for the Token Provider. The man- 681 in-the-middle can intercept and modify any message sent by the client 682 to the Token Provider, and any message sent by the Token Provider to 683 the client. (This means, among other things, that the man-in-the- 684 middle controls the Javascript running at the client in the origin of 685 the Token Provider.) It is not, however, in possession of the 686 client's Token Binding key. Therefore, it can either choose to 687 replace the Token Binding key in requests from the client to the 688 Token Provider, and create a Sec-Token-Binding header field that 689 matches the TLS connection between the man-in-the-middle and the 690 Token Provider; or it can choose to leave the Sec-Token-Binding 691 header field unchanged. If it chooses the latter, the signature in 692 the Token Binding message (created by the original client on the 693 exported keying material (EKM) for the connection between client and 694 man-in-the-middle) will not match the EKM between man-in-the-middle 695 and the Token Provider. If it chooses the former (and creates its 696 own signature, with its own Token Binding key, over the EKM for the 697 connection between man-in-the-middle and Token Provider), then the 698 Token Binding message will match the connection between man-in-the- 699 middle and Token Provider, but the Token Binding key in the message 700 will not match the Token Binding key that the client's authentication 701 token is bound to. Either way, the man-in-the-middle is detected by 702 the Token Provider, but only if the proof of key possession of the 703 provided Token Binding key is required in the protocol (as we do 704 above). 706 Next, consider the presence of a man-in-the-middle between client and 707 Token Consumer. That man-in-the-middle can intercept and modify any 708 message sent by the client to the Token Consumer, and any message 709 sent by the Token Consumer to the client. The Token Consumer is the 710 party that redirects the client to the Token Provider. In this case, 711 the man-in-the-middle controls the redirect URL, and can tamper with 712 any redirect URL issued by the Token Consumer (as well as with any 713 Javascript running in the origin of the Token Consumer). The goal of 714 the man-in-the-middle is to trick the Token Issuer to issue a token 715 bound to _its_ Token Binding key, not to the Token Binding key of the 716 legitimate client. To thwart this goal of the man-in-the-middle, the 717 client's referred Token Binding key must be communicated to the Token 718 Producer in a manner that can not be affected by the man-in-the- 719 middle (who, as we recall, can modify redirect URLs and Javascript at 720 the client). Including the referred Token Binding message in the 721 Sec-Token-Binding header field (as opposed to, say, including the 722 referred Token Binding key in an application-level message as part of 723 the redirect URL) is one way to assure that the man-in-the-middle 724 between client and Token Consumer cannot affect the communication of 725 the referred Token Binding key to the Token Provider. 727 Therefore, the Sec-Token-Binding header field in the federated sign- 728 on use case contains both, a proof of possession of the provided 729 Token Binding key, as well as a proof of possession of the referred 730 Token Binding key. 732 7. Privacy Considerations 734 7.1. Scoping of Token Binding Keys 736 Clients use different Token Binding key pairs for different servers, 737 so as to not allow Token Binding to become a tracking tool across 738 different servers. However, the scoping of the Token Binding key 739 pairs to servers varies according to the scoping rules of the 740 application protocol ([I-D.ietf-tokbind-protocol] section 4.1). 742 In the case of HTTP cookies, servers may use Token Binding to secure 743 their cookies. These cookies can be attached to any sub-domain of 744 effective top-level domains, and clients therefore should use the 745 same Token Binding key across such subdomains. This will ensure that 746 any server capable of receiving the cookie will see the same Token 747 Binding ID from the client, and thus be able to verify the token 748 binding of the cookie. See Section 2.1, above. 750 7.2. Life Time of Token Binding Keys 752 Token Binding keys do not have an expiration time. This means that 753 they can potentially be used by a server to track a user across an 754 extended period of time (similar to a long-lived cookie). HTTPS 755 clients such as web user agents should therefore provide a user 756 interface for discarding Token Binding keys (similar to the 757 affordances provided to delete cookies). 759 If a user agent provides modes such as private browsing mode in which 760 the user is promised that browsing state such as cookies are 761 discarded after the session is over, the user agent should also 762 discard Token Binding keys from such modes after the session is over. 763 Generally speaking, users should be given the same level of control 764 over life time of Token Binding keys as they have over cookies or 765 other potential tracking mechanisms. 767 7.3. Correlation 769 An application's various communicating endpoints, that receive Token 770 Binding IDs for TLS connections other than their own, obtain 771 information about the application's other TLS connections (in this 772 context, "an application" is a combination of client-side and server- 773 side components, communicating over HTTPS, where the client side may 774 be either or both web browser-based or native application-based). 775 These other Token Binding IDs can serve as correlation handles for 776 the endpoints of the other connections. If the receiving endpoints 777 are otherwise aware of these other connections, then no additional 778 information is being exposed. For instance, if in a redirect-based 779 federation protocol, the Identity Provider and Relying Party already 780 possess URLs for one another, also having Token Binding IDs for these 781 connections does not provide additional correlation information. If 782 not, then, by providing the other Token Binding IDs, additional 783 information is exposed that can be used to correlate the other 784 endpoints. In such cases, a privacy analysis of enabled correlations 785 and their potential privacy impacts should be performed as part of 786 the application design decisions of how, and whether, to utilize 787 Token Binding. 789 Also, applications must take care to only reveal Token Binding IDs to 790 other endpoints if the server associated with a Token Binding ID 791 explicitly signals to do so, see Section 5 792 "Implementation Considerations". 794 Finally, care should be taken to ensure that unrelated applications 795 do not obtain information about each other's Token Bindings. For 796 instance, a Token Binding implementation shared between multiple 797 applications on a given system should prevent unrelated applications 798 from obtaining each other's Token Binding information. This may be 799 accomplished by using techniques such as application isolation and 800 key segregation, depending upon system capabilities. 802 8. IANA Considerations 804 Below are the Internet Assigned Numbers Authority (IANA) Permanent 805 Message Header Field registration information per [RFC3864]. 807 Header field name: Sec-Token-Binding 808 Applicable protocol: HTTP 809 Status: standard 810 Author/Change controller: IETF 811 Specification document(s): this one 812 Header field name: Include-Referred-Token-Binding-ID 813 Applicable protocol: HTTP 814 Status: standard 815 Author/Change controller: IETF 816 Specification document(s): this one 818 [[TODO: possibly add further considerations wrt the behavior of the 819 above header fields, per ]] 822 9. Acknowledgements 824 This document incorporates comments and suggestions offered by Eric 825 Rescorla, Gabriel Montenegro, Martin Thomson, Vinod Anupam, Anthony 826 Nadalin, Michael B. Jones, Bill Cox, Nick Harper, Brian Campbell, 827 and others. 829 10. References 831 10.1. Normative References 833 [fetch-spec] 834 WhatWG, "Fetch", Living Standard , 835 . 837 [I-D.ietf-tokbind-negotiation] 838 Popov, A., Nystrom, M., Balfanz, D., and A. Langley, 839 "Transport Layer Security (TLS) Extension for Token 840 Binding Protocol Negotiation", draft-ietf-tokbind- 841 negotiation-03 (work in progress), July 2016. 843 [I-D.ietf-tokbind-protocol] 844 Popov, A., Nystrom, M., Balfanz, D., Langley, A., and J. 845 Hodges, "The Token Binding Protocol Version 1.0", draft- 846 ietf-tokbind-protocol-08 (work in progress), July 2016. 848 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 849 Requirement Levels", BCP 14, RFC 2119, 850 DOI 10.17487/RFC2119, March 1997, 851 . 853 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 854 Procedures for Message Header Fields", BCP 90, RFC 3864, 855 DOI 10.17487/RFC3864, September 2004, 856 . 858 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 859 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 860 . 862 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 863 (TLS) Protocol Version 1.2", RFC 5246, 864 DOI 10.17487/RFC5246, August 2008, 865 . 867 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 868 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 869 March 2010, . 871 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 872 DOI 10.17487/RFC6265, April 2011, 873 . 875 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 876 Protocol (HTTP/1.1): Message Syntax and Routing", 877 RFC 7230, DOI 10.17487/RFC7230, June 2014, 878 . 880 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 881 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 882 DOI 10.17487/RFC7231, June 2014, 883 . 885 [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for 886 HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, 887 . 889 10.2. Informative References 891 [RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, 892 "Transport Layer Security (TLS) Renegotiation Indication 893 Extension", RFC 5746, DOI 10.17487/RFC5746, February 2010, 894 . 896 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 897 RFC 6749, DOI 10.17487/RFC6749, October 2012, 898 . 900 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 901 Framework: Bearer Token Usage", RFC 6750, 902 DOI 10.17487/RFC6750, October 2012, 903 . 905 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 906 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 907 DOI 10.17487/RFC7540, May 2015, 908 . 910 [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., 911 Langley, A., and M. Ray, "Transport Layer Security (TLS) 912 Session Hash and Extended Master Secret Extension", 913 RFC 7627, DOI 10.17487/RFC7627, September 2015, 914 . 916 [TRIPLE-HS] 917 Bhargavan, K., Delignat-Lavaud, A., Fournet, C., Pironti, 918 A., and P. Strub, "Triple Handshakes and Cookie Cutters: 919 Breaking and Fixing Authentication over TLS. IEEE 920 Symposium on Security and Privacy", 2014. 922 Authors' Addresses 924 Andrei Popov 925 Microsoft Corp. 926 USA 928 Email: andreipo@microsoft.com 930 Magnus Nystroem 931 Microsoft Corp. 932 USA 934 Email: mnystrom@microsoft.com 936 Dirk Balfanz (editor) 937 Google Inc. 938 USA 940 Email: balfanz@google.com 942 Adam Langley 943 Google Inc. 944 USA 946 Email: agl@google.com 947 Jeff Hodges 948 Paypal 949 USA 951 Email: Jeff.Hodges@paypal.com