idnits 2.17.1 draft-ietf-tokbind-https-01.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 : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** There are 3 instances of too long lines in the document, the longest one being 10 characters in excess of 72. ** The abstract seems to contain references ([RFC5246], [TBPROTO]), 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 (June 30, 2015) is 3217 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: 'RFC4492' is defined on line 348, but no explicit reference was found in the text == Unused Reference: 'RFC5226' is defined on line 352, but no explicit reference was found in the text == Unused Reference: 'RFC5929' is defined on line 359, but no explicit reference was found in the text == Unused Reference: 'RFC7301' is defined on line 362, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 4492 (Obsoleted by RFC 8422) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) -- Possible downref: Non-RFC (?) normative reference: ref. 'TBPROTO' == Outdated reference: A later version (-06) exists of draft-ietf-tls-session-hash-05 Summary: 7 errors (**), 0 flaws (~~), 6 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet Engineering Task Force A. Popov 2 Internet-Draft M. Nystroem 3 Intended status: Standards Track Microsoft Corp. 4 Expires: January 1, 2016 D. Balfanz, Ed. 5 A. Langley 6 Google Inc. 7 June 30, 2015 9 Token Binding over HTTP 10 draft-ietf-tokbind-https-01 12 Abstract 14 This document describes a collection of mechanisms that allow HTTP 15 servers to cryptographically bind authentication tokens (such as 16 cookies and OAuth tokens) to a TLS [RFC5246] connection. 18 We describe both _first-party_ as well as _federated_ scenarios. In 19 a first-party scenario, an HTTP server issues a security token (such 20 as a cookie) to a client, and expects the client to send the security 21 token back to the server at a later time in order to authenticate. 22 Binding the token to the TLS connection between client and server 23 protects the security token from theft, and ensures that the security 24 token can only be used by the client that it was issued to. 26 Federated token bindings, on the other hand, allow servers to 27 cryptographically bind security tokens to a TLS [RFC5246] connection 28 that the client has with a _different_ server than the one issuing 29 the token. 31 This Internet-Draft is a companion document to The Token Binding 32 Protocol [TBPROTO] 34 Status of This Memo 36 This Internet-Draft is submitted in full conformance with the 37 provisions of BCP 78 and BCP 79. 39 Internet-Drafts are working documents of the Internet Engineering 40 Task Force (IETF). Note that other groups may also distribute 41 working documents as Internet-Drafts. The list of current Internet- 42 Drafts is at http://datatracker.ietf.org/drafts/current/. 44 Internet-Drafts are draft documents valid for a maximum of six months 45 and may be updated, replaced, or obsoleted by other documents at any 46 time. It is inappropriate to use Internet-Drafts as reference 47 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on January 1, 2016. 50 Copyright Notice 52 Copyright (c) 2015 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (http://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 68 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 69 2. The Sec-Token-Binding Header . . . . . . . . . . . . . . . . 3 70 3. Federation Use Cases . . . . . . . . . . . . . . . . . . . . 4 71 3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 4 72 3.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . 4 73 3.3. HTTP Redirects . . . . . . . . . . . . . . . . . . . . . 6 74 3.4. Negotiated Key Parameters . . . . . . . . . . . . . . . . 6 75 4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 76 4.1. Security Token Replay . . . . . . . . . . . . . . . . . . 7 77 4.2. Privacy Considerations . . . . . . . . . . . . . . . . . 7 78 4.3. Triple Handshake Vulnerability in TLS . . . . . . . . . . 7 79 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 80 5.1. Normative References . . . . . . . . . . . . . . . . . . 8 81 5.2. Informative References . . . . . . . . . . . . . . . . . 8 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 84 1. Introduction 86 The Token Binding Protocol [TBPROTO] defines a Token Binding ID for a 87 TLS connection between a client and a server. The Token Binding ID 88 of a TLS connection is related to a private key that the client 89 proves possession of to the server, and is long-lived (i.e., 90 subsequent TLS connections between the same client and server have 91 the same Token Binding ID). When issuing a security token (e.g. an 92 HTTP cookie or an OAuth token) to a client, the server can include 93 the Token Binding ID in the token, thus cryptographically binding the 94 token to TLS connections between that particular client and server, 95 and inoculating the token against theft by attackers. 97 While the Token Binding Protocol [TBPROTO] defines a message format 98 for establishing a Token Binding ID, it doesn't specify how this 99 message is embedded in higher-level protocols. The purpose of this 100 specification is to define how TokenBindingMessages are embedded in 101 HTTP (both versions 1.1 [RFC2616] and 2 [I-D.ietf-httpbis-http2]). 102 Note that TokenBindingMessages are only defined if the underlying 103 transport uses TLS. This means that Token Binding over HTTP is only 104 defined when the HTTP protocol is layered on top of TLS (commonly 105 referred to as HTTPS). 107 HTTP clients establish a Token Binding ID with a server by including 108 a special HTTP header in HTTP requests. The HTTP header value is a 109 TokenBindingMessage. 111 TokenBindingMessages allow clients to establish multiple Token 112 Binding IDs with the server, by including multiple TokenBinding 113 structures in the TokenBindingMessage. By default, a client will 114 establish a _provided_ Token Binding ID with the server, indicating a 115 Token Binding ID that the client will persistently use with the 116 server. Under certain conditions, the client can also include a 117 _referred_ Token Binding ID in the TokenBindingMessage, indicating a 118 Token Binding ID that the client is using with a _different_ server 119 than the one that the TokenBindingMessage is sent to. This is useful 120 in federation scenarios. 122 1.1. Requirements Language 124 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 125 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 126 document are to be interpreted as described in [RFC2119]. 128 2. The Sec-Token-Binding Header 130 Once a client and server have negotiated the Token Binding Protocol 131 with HTTP/1.1 or HTTP/2 (see The Token Binding Protocol [TBPROTO]), 132 clients MUST include the Sec-Token-Binding header in their HTTP 133 requests. The ABNF of the Sec-Token-Binding header is: 135 Sec-Token-Binding = "Sec-Token-Binding" ":" [CFWS] EncodedTokenBindingMessage 137 The EncodedTokenBindingMessage is a web-safe Base64-encoding of the 138 TokenBindingMessage as defined in the TokenBindingProtocol [TBPROTO]. 140 The TokenBindingMessage MUST contain a TokenBinding with 141 TokenBindingType provided_token_binding, which MUST be signed with 142 the Token Binding key used by the client for connections between 143 itself and the server that the HTTP request is sent to (clients use 144 different Token Binding keys for different servers). The Token 145 Binding ID established by this TokenBinding is called a _Provided 146 Token Binding ID_ 148 In HTTP/2, the client SHOULD use Header Compression 149 [I-D.ietf-httpbis-header-compression] to avoid the overhead of 150 repeating the same header in subsequent HTTP requests. 152 3. Federation Use Cases 154 3.1. Introduction 156 For privacy reasons, clients use different private keys to establish 157 Provided Token Binding IDs with different servers. As a result, a 158 server cannot bind a security token (such as an OAuth token or an 159 OpenID Connect identity token) to a TLS connection that the client 160 has with a different server. This is, however, a common requirement 161 in federation scenarios: For example, an Identity Provider may wish 162 to issue an identity token to a client and cryptographically bind 163 that token to the TLS connection between the client and a Relying 164 Party. 166 In this section we describe mechanisms to achieve this. The common 167 idea among these mechanisms is that a server (called the _Token 168 Consumer_ in this document) gives the client permission to reveal the 169 Provided Token Binding ID that is used between the client and itself, 170 to another server (called the _Token Provider_ in this document). 171 Also common across the mechanisms is how the Token Binding ID is 172 revealed to the Token Provider: The client uses the Token Binding 173 Protocol [TBPROTO], and includes a TokenBinding structure in the Sec- 174 Token-Binding HTTP header defined above. What differs between the 175 various mechanisms is _how_ the Token Consumer grants the permission 176 to reveal the Token Binding ID to the Token Provider. Below we 177 specify one such mechanism, which is suitable for redirect-based 178 interactions between Token Consumers and Token Providers. 180 3.2. Overview 182 In a Federated Sign-On protocol, an Identity Provider issues an 183 identity token to a client, which sends the identity token to a 184 Relying Party to authenticate itself. Examples of this include 185 OpenID Connect (where the identity token is called "ID Token") and 186 SAML (where the identity token is a SAML assertion). 188 To better protect the security of the identity token, the Identity 189 Provider may wish to bind the identity token to the TLS connection 190 between the client and the Relying Party, thus ensuring that only 191 said client can use the identity token: The Relying Party will 192 compare the Token Binding ID in the identity token with the Token 193 Binding ID of the TLS connection between it an the client. 195 This is an example of a federation scenario, which more generally can 196 be described as follows: 198 o A Token Consumer causes the client to issue a token request to the 199 Token Provider. The goal is for the client to obtain a token and 200 then use it with the Token Consumer. 202 o The client delivers the token request to the Token Provider. 204 o The Token Provider issues the token. The token is issued for the 205 specific Token Consumer who requested it (thus preventing 206 malicious Token Consumers from using tokens with other Token 207 Consumers). The token is, however, typically a bearer token, 208 meaning that any client can use it with the Token Consumer, not 209 just the client to which it was issued. 211 o Therefore, in the previous step, the Token Provider may want to 212 include in the token the Token-Binding public key that the client 213 uses when communicating with the Token Consumer, thus _binding_ 214 the token to client's Token-Binding keypair. The client proves 215 possession of the private key when communicating with the Token 216 Consumer through the Token Binding Protocol [TBPROTO], and reveals 217 the corresponding public key of this keypair as part of the Token 218 Binding ID. Comparing the public key from the token with the 219 public key from the Token Binding ID allows the Token Consumer to 220 verify that the token was sent to it by the legitimate client. 222 o To allow the Token Provider to include the Token-Binding public 223 key in the token, the Token Binding ID (between client and Token 224 Consumer) must therefore be communicated to the Token Provider 225 along with the token request. Communicating a Token Binding ID 226 involves proving possession of a private key and is described in 227 the Token Binding Protocol [TBPROTO]. 229 The client will perform this last operation (proving possession of a 230 private key that corresponds to a Token Binding ID between the client 231 and the Token Consumer while delivering the token request to the 232 Token Provider) only if the Token Consumer permits the client to do 233 so. 235 Below, we specify how Token Consumers can grant this permission. 236 during redirect-based federation protocols. 238 3.3. HTTP Redirects 240 When a Token Consumer redirects the client to a Token Provider as a 241 means to deliver the token request, it SHOULD include a Include- 242 Referer-Token-Binding-ID HTTP response header in its HTTP response. 243 The ABNF of the Include-Referer-Token-Binding-ID header is: 245 Include-Referer-Token-Binding-ID = "Include-Referer-Token-Binding-ID" ":" 246 [CFWS] %x74.72.75.65 ; "true", case-sensitive 248 Including this response header signals to the client that it should 249 reveal the Token Binding ID used between the client and the Token 250 Consumer to the Token Provider. In the absence of this response 251 header, the client will not disclose any information about the Token 252 Binding used between the client and the Token Consumer to the Token 253 Provider. 255 This header has only meaning if the HTTP status code is 302 or 301, 256 and MUST be ignored by the client for any other status codes. If the 257 client supports the Token Binding Protocol, and has negotiated the 258 Token Binding Protocol with both the Token Consumer and the Token 259 Provider, it already sends the following header to the Token Provider 260 with each HTTP request (see above): 262 Sec-Token-Binding: EncodedTokenBindingMessage 264 The TokenBindingMessage SHOULD contain a TokenBinding with 265 TokenBindingType referred_token_binding. If included, this 266 TokenBinding MUST be signed with the Token Binding key used by the 267 client for connections between itself and the Token Consumer (more 268 specifically, the web origin that issued the Include-Referer-Token- 269 Binding-ID response header). The Token Binding ID established by 270 this TokenBinding is called a _Referred Token Binding ID_. 272 As described above, the TokenBindingMessage MUST additionally contain 273 a Provided Token Binding ID, i.e., a TokenBinding structure with 274 TokenBindingType provided_token_binding, which MUST be signed with 275 the Token Binding key used by the client for connections between 276 itself and the Token Privider (more specifically, the web origin that 277 the token request sent to). 279 3.4. Negotiated Key Parameters 281 The Token Binding Protocol [TBPROTO] allows the server and client to 282 negotiate a signature algorithm used in the TokenBindingMessage. It 283 is possible that the Token Binding ID used between the client and the 284 Token Consumer, and the Token Binding ID used between the client and 285 Token Provider, use different signature algorithms. The client MUST 286 use the signature algorithm negotiated with the Token Consumer in the 287 referred_token_binding TokenBinding of the TokenBindingMessage, even 288 if that signature algorithm is different from the one negotiated with 289 the origin that the header is sent to. 291 Token Providers SHOULD support all the SignatureAndHashAlgorithms 292 specified in the Token Binding Protocol [TBPROTO]. If a token 293 provider does not support the SignatureAndHashAlgorithm specified in 294 the referred_token_binding TokenBinding in the TokenBindingMessage, 295 it MUST issue an unbound token. 297 4. Security Considerations 299 4.1. Security Token Replay 301 The goal of the Federated Token Binding mechanisms is to prevent 302 attackers from exporting and replaying tokens used in protocols 303 between the client and Token Consumer, thereby impersonating 304 legitimate users and gaining access to protected resources. Bound 305 tokens can still be replayed by malware present in the client. In 306 order to export the token to another machine and successfully replay 307 it, the attacker also needs to export the corresponding private key. 308 The Token Binding private key is therefore a high-value asset and 309 MUST be strongly protected, ideally by generating it in a hardware 310 security module that prevents key export. 312 4.2. Privacy Considerations 314 The Token Binding protocol uses persistent, long-lived TLS Token 315 Binding IDs. To protect privacy, TLS Token Binding IDs are never 316 transmitted in clear text and can be reset by the user at any time, 317 e.g. when clearing browser cookies. Unique Token Binding IDs MUST be 318 generated for connections to different origins, so they cannot be 319 used by cooperating servers to link user identities. 321 4.3. Triple Handshake Vulnerability in TLS 323 The Token Binding protocol relies on the tls_unique value to 324 associate a TLS connection with a TLS Token Binding. The triple 325 handshake attack [TRIPLE-HS] is a known TLS protocol vulnerability 326 allowing the attacker to synchronize tls_unique values between TLS 327 connections. The attacker can then successfully replay bound tokens. 328 For this reason, the Token Binding protocol MUST NOT be negotiated 329 unless the Extended Master Secret TLS extension 330 [I-D.ietf-tls-session-hash] has also been negotiated. 332 5. References 334 5.1. Normative References 336 [I-D.ietf-httpbis-header-compression] 337 Peon, R. and H. Ruellan, "HPACK - Header Compression for 338 HTTP/2", draft-ietf-httpbis-header-compression-12 (work in 339 progress), February 2015. 341 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 342 Requirement Levels", BCP 14, RFC 2119, March 1997. 344 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 345 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 346 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 348 [RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. 349 Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites 350 for Transport Layer Security (TLS)", RFC 4492, May 2006. 352 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 353 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 354 May 2008. 356 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 357 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 359 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 360 for TLS", RFC 5929, July 2010. 362 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 363 "Transport Layer Security (TLS) Application-Layer Protocol 364 Negotiation Extension", RFC 7301, July 2014. 366 [TBPROTO] Popov, A., "The Token Binding Protocol Version 1.0", 2014. 368 5.2. Informative References 370 [I-D.ietf-httpbis-http2] 371 Belshe, M., Peon, R., and M. Thomson, "Hypertext Transfer 372 Protocol version 2", draft-ietf-httpbis-http2-17 (work in 373 progress), February 2015. 375 [I-D.ietf-tls-session-hash] 376 Bhargavan, K., Delignat-Lavaud, A., Pironti, A., Langley, 377 A., and M. Ray, "Transport Layer Security (TLS) Session 378 Hash and Extended Master Secret Extension", draft-ietf- 379 tls-session-hash-05 (work in progress), April 2015. 381 [TRIPLE-HS] 382 Bhargavan, K., Delignat-Lavaud, A., Fournet, C., Pironti, 383 A., and P. Strub, "Triple Handshakes and Cookie Cutters: 384 Breaking and Fixing Authentication over TLS. IEEE 385 Symposium on Security and Privacy", 2014. 387 Authors' Addresses 389 Andrei Popov 390 Microsoft Corp. 391 USA 393 Email: andreipo@microsoft.com 395 Magnus Nystroem 396 Microsoft Corp. 397 USA 399 Email: mnystrom@microsoft.com 401 Dirk Balfanz (editor) 402 Google Inc. 403 USA 405 Email: balfanz@google.com 407 Adam Langley 408 Google Inc. 409 USA 411 Email: agl@google.com