idnits 2.17.1 draft-sheffer-tls-pinning-ticket-05.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 15, 2017) is 2387 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Outdated reference: A later version (-28) exists of draft-ietf-tls-tls13-21 ** Obsolete normative reference: RFC 5077 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 6962 (Obsoleted by RFC 9162) -- Obsolete informational reference (is this intentional?): RFC 7507 (Obsoleted by RFC 8996) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Sheffer 3 Internet-Draft Intuit 4 Intended status: Experimental D. Migault 5 Expires: March 19, 2018 Ericsson 6 September 15, 2017 8 TLS Server Identity Pinning with Tickets 9 draft-sheffer-tls-pinning-ticket-05 11 Abstract 13 Misissued public-key certificates can prevent TLS clients from 14 appropriately authenticating the TLS server. Several alternatives 15 have been proposed to detect this situation and prevent a client from 16 establishing a TLS session with a TLS end point authenticated with an 17 illegitimate public-key certificate, but none is currently in wide 18 use. 20 This document proposes to extend TLS with opaque pinning tickets as a 21 way to pin the server's identity. During an initial TLS session, the 22 server provides an original encrypted pinning ticket. In subsequent 23 TLS session establishment, upon receipt of the pinning ticket, the 24 server proves its ability to decrypt the pinning ticket and thus the 25 ownership if the pinning protection key. The client can now safely 26 conclude that the TLS session is established with the same TLS server 27 as the original TLS session. One of the important properties of this 28 proposal is that no manual management actions are required. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at https://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on March 19, 2018. 47 Copyright Notice 49 Copyright (c) 2017 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (https://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 65 1.1. Conventions used in this document . . . . . . . . . . . . 6 66 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 6 67 2.1. Initial Connection . . . . . . . . . . . . . . . . . . . 6 68 2.2. Subsequent Connections . . . . . . . . . . . . . . . . . 8 69 2.3. Indexing the Pins . . . . . . . . . . . . . . . . . . . . 9 70 3. Message Definitions . . . . . . . . . . . . . . . . . . . . . 9 71 4. Cryptographic Operations . . . . . . . . . . . . . . . . . . 10 72 4.1. Pinning Secret . . . . . . . . . . . . . . . . . . . . . 10 73 4.2. Pinning Ticket . . . . . . . . . . . . . . . . . . . . . 10 74 4.3. Pinning Protection Key . . . . . . . . . . . . . . . . . 11 75 4.4. Pinning Proof . . . . . . . . . . . . . . . . . . . . . . 11 76 5. Operational Considerations . . . . . . . . . . . . . . . . . 12 77 5.1. Protection Key Synchronization . . . . . . . . . . . . . 12 78 5.2. Ticket Lifetime . . . . . . . . . . . . . . . . . . . . . 12 79 5.3. Certificate Renewal . . . . . . . . . . . . . . . . . . . 13 80 5.4. Certificate Revocation . . . . . . . . . . . . . . . . . 13 81 5.5. Disabling Pinning . . . . . . . . . . . . . . . . . . . . 13 82 5.6. Server Compromise . . . . . . . . . . . . . . . . . . . . 13 83 5.7. Disaster Recovery . . . . . . . . . . . . . . . . . . . . 14 84 6. Previous Work . . . . . . . . . . . . . . . . . . . . . . . . 14 85 6.1. Comparison: HPKP . . . . . . . . . . . . . . . . . . . . 14 86 6.2. Comparison: TACK . . . . . . . . . . . . . . . . . . . . 17 87 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 17 88 7.1. Mint Fork . . . . . . . . . . . . . . . . . . . . . . . . 18 89 7.1.1. Overview . . . . . . . . . . . . . . . . . . . . . . 18 90 7.1.2. Description . . . . . . . . . . . . . . . . . . . . . 18 91 7.1.3. Level of Maturity . . . . . . . . . . . . . . . . . . 18 92 7.1.4. Coverage . . . . . . . . . . . . . . . . . . . . . . 18 93 7.1.5. Version Compatibility . . . . . . . . . . . . . . . . 18 94 7.1.6. Licensing . . . . . . . . . . . . . . . . . . . . . . 19 95 7.1.7. Contact Information . . . . . . . . . . . . . . . . . 19 96 8. Security Considerations . . . . . . . . . . . . . . . . . . . 19 97 8.1. Trust on First Use (TOFU) and MITM Attacks . . . . . . . 19 98 8.2. Pervasive Monitoring . . . . . . . . . . . . . . . . . . 19 99 8.3. Server-Side Error Detection . . . . . . . . . . . . . . . 19 100 8.4. Client Policy and SSL Proxies . . . . . . . . . . . . . . 20 101 8.5. Client-Side Error Behavior . . . . . . . . . . . . . . . 20 102 8.6. Stolen and Forged Tickets . . . . . . . . . . . . . . . . 20 103 8.7. Client Privacy . . . . . . . . . . . . . . . . . . . . . 20 104 8.8. Ticket Protection Key Management . . . . . . . . . . . . 21 105 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 106 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 21 107 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 22 108 11.1. Normative References . . . . . . . . . . . . . . . . . . 22 109 11.2. Informative References . . . . . . . . . . . . . . . . . 22 110 Appendix A. Document History . . . . . . . . . . . . . . . . . . 24 111 A.1. draft-sheffer-tls-pinning-ticket-05 . . . . . . . . . . . 24 112 A.2. draft-sheffer-tls-pinning-ticket-04 . . . . . . . . . . . 24 113 A.3. draft-sheffer-tls-pinning-ticket-03 . . . . . . . . . . . 24 114 A.4. draft-sheffer-tls-pinning-ticket-02 . . . . . . . . . . . 24 115 A.5. draft-sheffer-tls-pinning-ticket-01 . . . . . . . . . . . 24 116 A.6. draft-sheffer-tls-pinning-ticket-00 . . . . . . . . . . . 25 117 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 25 119 1. Introduction 121 The weaknesses of the global PKI system are by now widely known. 122 Essentially, any valid CA may issue a certificate for any 123 organization without the organization's approval (a misissued or 124 "fake" certificate), and use the certificate to impersonate the 125 organization. There are many attempts to resolve these weaknesses, 126 including Certificate Transparency (CT) [RFC6962], HTTP Public Key 127 Pinning (HPKP) [RFC7469], and TACK [I-D.perrin-tls-tack]. CT 128 requires cooperation of a large portion of the hundreds of extant 129 certificate authorities (CAs) before it can be used "for real", in 130 enforcing mode. It is noted that the relevant industry forum (CA/ 131 Browser Forum) is indeed pushing for such extensive adoption. TACK 132 has some similarities to the current proposal, but work on it seems 133 to have stalled. Section 6.2 compares our proposal to TACK. 135 HPKP is an IETF standard, but so far has proven hard to deploy. HPKP 136 pins (fixes) a public key, one of the public keys listed in the 137 certificate chain. As a result, HPKP needs to be coordinated with 138 the certificate management process. Certificate management impacts 139 HPKP and thus increases the probability of HPKP failures. This risk 140 is made even higher given the fact that, even though work has been 141 done at the ACME WG to automate certificate management, in many or 142 even most cases, certificates are still managed manually. As a 143 result, HPKP cannot be completely automated resulting in error-prone 144 manual configuration. Such errors could prevent the web server from 145 being accessed by some clients. In addition, HPKP uses a HTTP header 146 which makes this solution HTTPS specific and not generic to TLS. On 147 the other hand, the current document provides a solution that is 148 independent of the server's certificate management and that can be 149 entirely and easily automated. Section 6.1 compares HPKP to the 150 current draft in more detail. 152 The ticket pinning proposal augments these mechanisms with a much 153 easier to implement and deploy solution for server identity pinning, 154 by reusing some of the ideas behind TLS session resumption. 156 Ticket pinning is a second factor server authentication method and is 157 not proposed as a substitute of the authentication method provided in 158 the TLS key exchange. More specifically, the client only uses the 159 pinning identity method after the TLS key exchange is successfully 160 completed. In other words, the pinning identity method is only 161 performed over an authenticated TLS session. Note that Ticket 162 Pinning does not pin certificate information and as such should be 163 considered a "real" independent second factor authentication. 165 Ticket pinning is a Trust On First Use (TOFU) mechanism, in that the 166 first server authentication is only based on PKI certificate 167 validation, but for any follow-on sessions, the client is further 168 ensuring the server's identity based on the server's ability to 169 decrypt the ticket, in addition to normal PKI certificate 170 authentication. 172 During initial TLS session establishment, the client requests a 173 pinning ticket from the server. Upon receiving the request the 174 server generates a pinning secret which is expected to be 175 unpredictable for peers other than the client or the server. In our 176 case, the pinning secret is generated from parameters exchanged 177 during the TLS key exchange, so client and server can generate it 178 locally and independently. The server constructs the pinning ticket 179 with the necessary information to retrieve the pinning secret. The 180 server then encrypts the ticket and returns the pinning ticket to the 181 client with an associated pinning lifetime. 183 The pinning lifetime value indicates for how long the server promises 184 to retain the server-side ticket-encryption key, which allows it to 185 complete the protocol exchange correctly and prove its identity. The 186 committed lifetime is typically on the order of weeks or months. 188 Once the key exchange is completed and the server is deemed 189 authenticated, the client generates locally the pinning secret and 190 caches the server's identifiers to index the pinning secret as well 191 as the pinning ticket and its associated lifetime. 193 When the client re-establishes a new TLS session with the server, it 194 sends the pinning ticket to the server. Upon receiving it, the 195 server returns a proof of knowledge of the pinning secret. Once the 196 key exchange is completed and the server has been authenticated, the 197 client checks the pinning proof returned by the server using the 198 client's stored pinning secret. If the proof matches, the client can 199 conclude that the server it is currently connecting to is in fact the 200 correct server. 202 This version of the draft only applies to TLS 1.3. We believe that 203 the idea can also be back-fitted into earlier versions of the 204 protocol. 206 The main advantages of this protocol over earlier pinning solutions 207 are: 209 - The protocol is at the TLS level, and as a result is not 210 restricted to HTTP at the application level. 212 - The protocol is robust to server IP, CA, and public key changes. 213 The server is characterized by the ownership of the pinning 214 protection key, which is never provided to the client. Server 215 configuration parameters such as the CA and the public key may 216 change without affecting the pinning ticket protocol. 218 - Once a single parameter is configured (the ticket's lifetime), 219 operation is fully automated. The server administrator need not 220 bother with the management of backup certificates or explicit 221 pins. 223 - For server clusters, we reuse the existing [RFC5077] 224 infrastructure where it exists. 226 - Pinning errors, presumably resulting from MITM attacks, can be 227 detected both by the client and the server. This allows for 228 server-side detection of MITM attacks using large-scale analytics, 229 and with no need to rely on clients to explicitly report the 230 error. 232 A note on terminology: unlike other solutions in this space, we do 233 not do "certificate pinning" (or "public key pinning"), since the 234 protocol is oblivious to the server's certificate. We prefer the 235 term "server identity pinning" for this new solution. In out 236 solution, the server proves its identity by generating a proof that 237 it can read and decrypt an encrypted ticket. As a result, the 238 identity proof relies on proof of ownership of the pinning protection 239 key. However, this key is never exchanged with the client or known 240 by it, and so cannot itself be pinned. 242 1.1. Conventions used in this document 244 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 245 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 246 document are to be interpreted as described in [RFC2119]. 248 2. Protocol Overview 250 The protocol consists of two phases: the first time a particular 251 client connects to a server, and subsequent connections. 253 This protocol supports full TLS handshakes, as well as 0-RTT 254 handshakes. Below we present it in the context of a full handshake, 255 but behavior in 0-RTT handshakes should be identical. 257 The document presents some similarities with the ticket resumption 258 mechanism described in [RFC5077]. However the scope of this document 259 differs from session resumption mechanisms implemented with [RFC5077] 260 or with other mechanisms. Specifically, the pinning ticket does not 261 carry any state associated with a TLS session and thus cannot be used 262 for session resumption, or to authenticate the client. Instead, the 263 pinning ticket only contains the Pinning Secret used to generate the 264 proof. 266 With TLS 1.3, session resumption is based on a preshared key (PSK). 267 This is orthogonal to this protocol. With TLS 1.3, a TLS session can 268 be established using PKI and a pinning ticket, and later resumed with 269 PSK. 271 However, the protocol described in this document addresses the 272 problem of misissued certificates. Thus, it is not expected to be 273 used outside a certificate-based TLS key exchange, such as in PSK. 274 As a result, PSK handshakes MUST NOT include the extension defined 275 here. 277 2.1. Initial Connection 279 When a client first connects to a server, it requests a pinning 280 ticket by sending an empty PinningTicket extension, and receives it 281 as part of the server's first response, in the returned PinningTicket 282 extension. 284 Client Server 286 ClientHello 287 + key_share 288 + signature_algorithms* 289 + PinningTicket --------> 290 ServerHello 291 + key_share 292 {EncryptedExtensions 293 + PinningTicket} 294 {CertificateRequest*} 295 {Certificate*} 296 {CertificateVerify*} 297 <-------- {Finished} 298 {Certificate*} 299 {CertificateVerify*} 300 {Finished} --------> 301 [Application Data] <-------> [Application Data] 303 * Indicates optional or situation-dependent 304 messages that are not always sent. 306 {} Indicates messages protected using keys 307 derived from the ephemeral secret. 309 [] Indicates messages protected using keys 310 derived from the master secret. 312 If a client supports the pinning ticket extension and does not have 313 any pinning ticket associated with the server, the exchange is 314 considered as an initial connection. Other reasons the client may 315 not have a pinning ticket include the client having flushed its 316 pinning ticket store, or the committed lifetime of the pinning ticket 317 having expired. 319 Upon receipt of the PinningTicket extension, the server computes a 320 pinning secret (Section 4.1), and sends the pinning ticket 321 (Section 4.2) encrypted with the pinning protection key 322 (Section 4.3). The pinning ticket is associated with a lifetime 323 value by which the server assumes the responsibility of retaining the 324 pinning protection key and being able to decrypt incoming pinning 325 tickets during the period indicated by the committed lifetime. 327 Once the pinning ticket has been generated, the server returns the 328 pinning ticket and the committed lifetime in a PinningTicket 329 extension embedded in the EncryptedExtensions message. We note that 330 a PinningTicket extension MUST NOT be sent as part of a 331 HelloRetryRequest. 333 Upon receiving the pinning ticket, the client MUST NOT accept it 334 until the key exchange is completed and the server authenticated. If 335 the key exchange is not completed successfully, the client MUST 336 ignore the received pinning ticket. Otherwise, the client computes 337 the pinning secret and SHOULD cache the pinning secret and the 338 pinning ticket for the duration indicated by the pinning ticket 339 lifetime. The client SHOULD clean up the cached values at the end of 340 the indicated lifetime. 342 2.2. Subsequent Connections 344 When the client initiates a connection to a server it has previously 345 seen (see Section 2.3 on identifying servers), it SHOULD send the 346 pinning ticket for that server. The pinning ticket, pinning secret 347 and pinning ticket lifetime computed during the establishment of the 348 previous TLS session are designated in this document as the 349 "original" ones, to distinguish them from a new ticket that may be 350 generated during the current session. 352 The server MUST extract the original pinning_secret value from the 353 ticket and MUST respond with a PinningTicket extension, which 354 includes: 356 - A proof that the server can understand the ticket that was sent by 357 the client; this proof also binds the pinning ticket to the 358 server's (current) public key, as well as the ongoing TLS session. 359 The proof is MANDATORY if a pinning ticket was sent by the client. 361 - A fresh pinning ticket. The main reason for refreshing the ticket 362 on each connection is privacy: to avoid the ticket serving as a 363 fixed client identifier. It is RECOMMENDED to include a fresh 364 ticket with each response. 366 If the server cannot validate the received ticket, that might 367 indicate an earlier MITM attack on this client. The server MUST then 368 abort the connection with a handshake_failure alert, and SHOULD log 369 this failure. 371 The client MUST verify the proof, and if it fails to do so, MUST 372 issue a handshake_failure alert and abort the connection (see also 373 Section 8.5). It is important that the client does not attempt to 374 "fall back" by omitting the PinningTicket extension. 376 When the connection is successfully set up, i.e. after the Finished 377 message is verified, the client SHOULD store the new ticket along 378 with the corresponding pinning_secret, replacing the original ticket. 380 Although this is an extension, if the client already has a ticket for 381 a server, the client MUST interpret a missing PinningTicket extension 382 in the server's response as an attack, because of the server's prior 383 commitment to respect the ticket. The client MUST abort the 384 connection in this case. See also Section 5.5 on ramping down 385 support for this extension. 387 2.3. Indexing the Pins 389 Each pin is associated with a host name, protocol (TLS or DTLS) and 390 port number. In other words, the pin for port TCP/443 may be 391 different from that for DTLS or from the pin for port TCP/8443. The 392 host name MUST be the value sent inside the Server Name Indication 393 (SNI) extension. This definition is similar to a Web Origin 394 [RFC6454], but does not assume the existence of a URL. 396 The purpose of ticket pinning is to pin the server identity. As a 397 result, any information orthogonal to the server's identity MUST NOT 398 be considered in indexing. More particularly, IP addresses are 399 ephemeral and forbidden in SNI and therefore pins MUST NOT be 400 associated with IP addresses. Similarly, CA names or public keys 401 associated with server MUST NOT be used for indexing as they may 402 change over time. 404 3. Message Definitions 406 This section defines the format of the PinningTicket extension. We 407 follow the message notation of [I-D.ietf-tls-tls13]. 409 opaque pinning_ticket<0..2^16-1>; 411 opaque pinning_proof<0..2^8-1>; 413 struct { 414 select (Role) { 415 case client: 416 pinning_ticket ticket<0..2^16-1>; //omitted on 1st connection 418 case server: 419 pinning_proof proof<0..2^8-1>; //no proof on 1st connection 420 pinning_ticket ticket<0..2^16-1>; //omitted on ramp down 421 uint32 lifetime; 422 } 423 } PinningTicketExtension; 425 ticket: a pinning ticket sent by the client or returned by the 426 server. The ticket is opaque to the client. The extension MUST 427 contain exactly 0 or 1 tickets. 429 proof: a demonstration by the server that it understands the 430 received ticket and therefore that it is in possession of the 431 secret that was used to generate it originally. The extension 432 MUST contain exactly 0 or 1 proofs. 434 lifetime: the duration (in seconds) that the server commits to 435 accept offered tickets in the future. 437 4. Cryptographic Operations 439 This section provides details on the cryptographic operations 440 performed by the protocol peers. 442 4.1. Pinning Secret 444 The pinning secret is generated locally by the client and the server 445 which means they must use the same inputs to generate it. This value 446 must be generated before the ServerHello message is sent, as the 447 server includes the corresponding pinning ticket in the ServerHello 448 message. In addition, the pinning secret must be unpredictable to 449 any party other than the client and the server. 451 The pinning secret is derived using the Derive-Secret function 452 provided by TLS 1.3, described in Section "Key Schedule" of 453 [I-D.ietf-tls-tls13]. 455 pinning secret = Derive-Secret(Handshake Secret, "pinning secret", 456 ClientHello...ServerHello) 458 4.2. Pinning Ticket 460 The pinning ticket contains the pinning secret. The pinning ticket 461 is provided by the client to the server which decrypts it in order to 462 extract the pinning secret and responds with a pinning proof. As a 463 result, the characteristics of the pinning ticket are: 465 - Pinning tickets MUST be encrypted and integrity-protected using 466 strong cryptographic algorithms. 468 - Pinning tickets MUST be protected with a long-term pinning 469 protection key. 471 - Pinning tickets MUST include a pinning protection key ID or serial 472 number as to enable the pinning protection key to be refreshed. 474 - The pinning ticket MAY include other information, in addition to 475 the pinning secret. 477 The pinning ticket's format is not specified by this document, but we 478 RECOMMEND a format similar to the one proposed by [RFC5077]. 480 4.3. Pinning Protection Key 482 The pinning protection key is only used by the server and so remains 483 server implementation specific. [RFC5077] recommends the use of two 484 keys, but when using AEAD algorithms only a single key is required. 486 When a single server terminates TLS for multiple virtual servers 487 using the Server Name Indication (SNI) mechanism, we strongly 488 RECOMMEND to use a separate protection key for each one of them, in 489 order to allow migrating virtual servers between different servers 490 while keeping pinning active. 492 As noted in Section 5.1, if the server is actually a cluster of 493 machines, the protection key MUST be synchronized between all the 494 nodes that accept TLS connections to the same server name. When 495 [RFC5077] is deployed, an easy way to do it is to derive the 496 protection key from the session-ticket protection key, which is 497 already synchronized. For example: 499 pinning_protection_key = HKDF-Expand(resumption_protection_key, 500 "pinning protection", L) 502 4.4. Pinning Proof 504 The pinning proof is sent by the server to demonstrate that it has 505 been able to decrypt the pinning ticket and retrieve the pinning 506 secret. The proof must be unpredictable and must not be replayed. 507 Similarly to the pinning secret, the pinning proof is sent by the 508 server in the ServerHello message. In addition, it must not be 509 possible for a MITM server with a fake certificate to obtain a 510 pinning proof from the original server. 512 In order to address these requirements, the pinning proof is bound to 513 the TLS session as well as the public key of the server: 515 proof = HMAC(original_pinning_secret, "pinning proof" + 516 Handshake-Secret + Hash(server_public_key)) 518 where HMAC [RFC2104] uses the Hash algorithm that was negotiated in 519 the handshake, and the same hash is also used over the server's 520 public key. The original_pinning_secret value refers to the secret 521 value extracted from the ticket sent by the client, to distinguish it 522 from a new pinning secret value that is possibly computed in the 523 current exchange. The server_public_key value is the DER 524 representation of the public key, specifically the 525 SubjectPublicKeyInfo structure as-is. 527 5. Operational Considerations 529 The main motivation behind the current protocol is to enable identity 530 pinning without the need for manual operations. To achieve this goal 531 operations described in identity pinning are only performed within 532 the current TLS session, and there is no dependence on any TLS 533 configuration parameters such as CA identity or public keys. As a 534 result, configuration changes are unlikely to lead to desynchronized 535 state between the client and the server. Manual operations are 536 susceptible to human error and in the case of public key pinning, can 537 easily result in "server bricking": the server becoming inaccessible 538 to some or all of its users. 540 5.1. Protection Key Synchronization 542 The only operational requirement when deploying this protocol is that 543 if the server is part of a cluster, protection keys (the keys used to 544 encrypt tickets) MUST be synchronized between all cluster members. 545 The protocol is designed so that if resumption ticket protection keys 546 [RFC5077] are already synchronized between cluster members, nothing 547 more needs to be done. 549 Moreover, synchronization does not need to be instantaneous, e.g. 550 protection keys can be distributed a few minutes or hours in advance 551 of their rollover. In such scenarios, each cluster member MUST be 552 able to accept tickets protected with a new version of the protection 553 key, even while it is still using an old version to generate keys. 554 This ensures that a client that receives a "new" ticket does not next 555 hit a cluster member that still rejects this ticket. 557 Misconfiguration can lead to the server's clock being off by a large 558 amount of time. Therefore we RECOMMEND never to automatically delete 559 protection keys, even when they are long expired. 561 5.2. Ticket Lifetime 563 The lifetime of the ticket is a commitment by the server to retain 564 the ticket's corresponding protection key for this duration, so that 565 the server can prove to the client that it knows the secret embedded 566 in the ticket. For production systems, the lifetime SHOULD be 567 between 7 and 31 days. 569 5.3. Certificate Renewal 571 The protocol ensures that the client will continue speaking to the 572 correct server even when the server's certificate is renewed. In 573 this sense, we are not "pinning certificates" and the protocol should 574 more precisely be called "server identity pinning". 576 Note that this property is not impacted by the use of the server's 577 public key in the pinning proof, because the scope of the public key 578 used is only the current TLS session. 580 5.4. Certificate Revocation 582 The protocol is orthogonal to certificate validation in the sense 583 that, if the server's certificate has been revoked or is invalid for 584 some other reason, the client MUST refuse to connect to it regardless 585 of any ticket-related behavior. 587 5.5. Disabling Pinning 589 A server implementing this protocol MUST have a "ramp down" mode of 590 operation where: 592 - The server continues to accept valid pinning tickets and responds 593 correctly with a proof. 595 - The server does not send back a new pinning ticket. 597 After a while no clients will hold valid tickets any more and the 598 feature may be disabled. Note that clients that do not receive a new 599 pinning ticket do not remove the original ticket. Instead, the 600 client keeps on using the ticket until its lifetime expires. 602 Issuing a new pinning ticket with a shorter lifetime would only delay 603 the ramp down process, as the shorter lifetime can only affect 604 clients that actually initiated a new connection. Other clients 605 would still see the original lifetime for their pinning tickets. 607 5.6. Server Compromise 609 If a server compromise is detected, the pinning protection key MUST 610 be rotated immediately, but the server MUST still accept valid 611 tickets that use the old, compromised key. Clients that still hold 612 old pinning tickets will remain vulnerable to MITM attacks, but those 613 that connect to the correct server will immediately receive new 614 tickets protected with the newly generated pinning protection key. 616 The same procedure applies if the pinning protection key is 617 compromised directly, e.g. if a backup copy is inadvertently made 618 public. 620 5.7. Disaster Recovery 622 All web servers in production need to be backed up, so that they can 623 be recovered if a disaster (including a malicious activity) ever 624 wipes them out. Backup typically includes the certificate and its 625 private key, which must be backed up securely. The pinning secret, 626 including earlier versions that are still being accepted, must be 627 backed up regularly. However since it is only used as an 628 authentication second factor, it does not require the same level of 629 confidentiality as the server's private key. 631 Readers should note that [RFC5077] session resumption keys are more 632 security sensitive, and should normally not be backed up but rather 633 treated as ephemeral keys. Even when servers derive pinning secrets 634 from resumption keys (Section 4.1), they MUST NOT back up resumption 635 keys. 637 6. Previous Work 639 This section compares ticket pinning to two earlier proposals, HPKP 640 and TACK. 642 6.1. Comparison: HPKP 644 The current IETF standard for pinning the identity of web servers is 645 the Public Key Pinning Extension for HTTP, or HPKP [RFC7469]. 647 The main differences between HPKP and the current document are the 648 following: 650 - HPKP limits its scope to HTTPS, while the current document 651 considers all application above TLS. 653 - HPKP pins the public key of the server (or another public key 654 along the certificate chain) and as such is highly dependent on 655 the management of certificates. Such dependency increases the 656 potential error surface, especially as certificate management is 657 not yet largely automated. The current proposal, on the other 658 hand is independent of certificate management. 660 - HPKP pins public keys which are public and used for the standard 661 TLS authentication. Identity pinning relies on the ownership of 662 the pinning key which is not disclosed to the public and not 663 involved in the standard TLS authentication. As a result, 664 identity pinning is a completely independent second factor 665 authentication mechanism. 667 - HPKP relies on a backup key to recover the mis-issuance of a key. 668 We believe such backup mechanisms add excessive complexity and 669 cost. Reliability of the current mechanism is primarily based on 670 its being highly automated. 672 - HPKP relies on the client to report errors to the report-uri. The 673 current document not need any out-of band mechanism, and the 674 server is informed automatically. This provides an easier and 675 more reliable health monitoring. 677 On the other hand, HPKP shares the following aspects with identity 678 pinning: 680 - Both mechanisms provide hard failure. With HPKP only the client 681 is aware of the failure, while with the current proposal both 682 client and server are informed of the failure. This provides room 683 for further mechanisms to automatically recover such failures. 685 - Both mechanisms are subject to a server compromise in which users 686 are provided with an invalid ticket (e.g. a random one) or HTTP 687 Header, with a very long lifetime. For identity pinning, this 688 lifetime cannot be longer than 31 days. In both cases, clients 689 will not be able to reconnect the server during this lifetime. 690 With the current proposal, an attacker needs to compromise the TLS 691 layer, while with HPKP, the attacker needs to compromise the HTTP 692 server. Arguably, the TLS-level compromise is typically more 693 difficult for the attacker. 695 Unfortunately HPKP has not seen wide deployment yet. As of March 696 2016, the number of servers using HPKP was less than 3000 [Netcraft]. 697 This may simply be due to inertia, but we believe the main reason is 698 the interactions between HPKP and manual certificate management which 699 is needed to implement HPKP for enterprise servers. The penalty for 700 making mistakes (e.g. being too early or too late to deploy new pins) 701 is having the server become unusable for some of the clients. 703 To demonstrate this point, we present a list of the steps involved in 704 deploying HPKP on a security-sensitive Web server. 706 1. Generate two public/private key-pairs on a computer that is not 707 the Live server. The second one is the "backup1" key-pair. 709 "openssl genrsa -out "example.com.key" 2048;" 711 "openssl genrsa -out "example.com.backup1.key" 2048;" 713 2. Generate hashes for both of the public keys. These will be used 714 in the HPKP header: 716 "openssl rsa -in "example.com.key" -outform der -pubout | 717 openssl dgst -sha256 -binary | openssl enc -base64" 719 "openssl rsa -in "example.com.backup1.key" -outform der 720 -pubout | openssl dgst -sha256 -binary | openssl enc -base64" 722 3. Generate a single CSR (Certificate Signing Request) for the 723 first key-pair, where you include the domain name in the CN 724 (Common Name) field: 726 "openssl req -new -subj "/C=GB/ST=Area/L=Town/O=Company/ 727 CN=example.com" -key "example.com.key" -out "example.com.csr";" 729 4. Send this CSR to the CA (Certificate Authority), and go though 730 the dance to prove you own the domain. The CA will give you 731 back a single certificate that will typically expire within a 732 year or two. 734 5. On the Live server, upload and setup the first key-pair (and its 735 certificate). At this point you can add the "Public-Key-Pins" 736 header, using the two hashes you created in step 2. 738 Note that only the first key-pair has been uploaded to the 739 server so far. 741 6. Store the second (backup1) key-pair somewhere safe, probably 742 somewhere encrypted like a password manager. It won't expire, 743 as it's just a key-pair, it just needs to be ready for when you 744 need to get your next certificate. 746 7. Time passes... probably just under a year (if waiting for a 747 certificate to expire), or maybe sooner if you find that your 748 server has been compromised and you need to replace the key-pair 749 and certificate. 751 8. Create a new CSR (Certificate Signing Request) using the 752 "backup1" key-pair, and get a new certificate from your CA. 754 9. Generate a new backup key-pair (backup2), get its hash, and 755 store it in a safe place (again, not on the Live server). 757 10. Replace your old certificate and old key-pair, and update the 758 "Public-Key-Pins" header to remove the old hash, and add the new 759 "backup2" key-pair. 761 Note that in the above steps, both the certificate issuance as well 762 as the storage of the backup key pair involve manual steps. Even 763 with an automated CA that runs the ACME protocol, key backup would be 764 a challenge to automate. 766 6.2. Comparison: TACK 768 Compared with HPKP, TACK [I-D.perrin-tls-tack] is a lot more similar 769 to the current draft. It can even be argued that this document is a 770 symmetric-cryptography variant of TACK. That said, there are still a 771 few significant differences: 773 - Probably the most important difference is that with TACK, 774 validation of the server certificate is no longer required, and in 775 fact TACK specifies it as a "MAY" requirement (Sec. 5.3). With 776 ticket pinning, certificate validation by the client remains a 777 MUST requirement, and the ticket acts only as a second factor. If 778 the pinning secret is compromised, the server's security is not 779 immediately at risk. 781 - Both TACK and the current draft are mostly orthogonal to the 782 server certificate as far as their life cycle, and so both can be 783 deployed with no manual steps. 785 - TACK uses ECDSA to sign the server's public key. This allows 786 cooperating clients to share server assertions between themselves. 787 This is an optional TACK feature, and one that cannot be done with 788 pinning tickets. 790 - TACK allows multiple servers to share its public keys. Such 791 sharing is disallowed by the current document. 793 - TACK does not allow the server to track a particular client, and 794 so has better privacy properties than the current draft. 796 - TACK has an interesting way to determine the pin's lifetime, 797 setting it to the time period since the pin was first observed, 798 with a hard upper bound of 30 days. The current draft makes the 799 lifetime explicit, which may be more flexible to deploy. For 800 example, Web sites which are only visited rarely by users may opt 801 for a longer period than other sites that expect users to visit on 802 a daily basis. 804 7. Implementation Status 806 Note to RFC Editor: please remove this section before publication, 807 including the reference to [RFC7942]. 809 This section records the status of known implementations of the 810 protocol defined by this specification at the time of posting of this 811 Internet-Draft, and is based on a proposal described in [RFC7942]. 812 The description of implementations in this section is intended to 813 assist the IETF in its decision processes in progressing drafts to 814 RFCs. Please note that the listing of any individual implementation 815 here does not imply endorsement by the IETF. Furthermore, no effort 816 has been spent to verify the information presented here that was 817 supplied by IETF contributors. This is not intended as, and must not 818 be construed to be, a catalog of available implementations or their 819 features. Readers are advised to note that other implementations may 820 exist. 822 According to RFC 7942, "this will allow reviewers and working groups 823 to assign due consideration to documents that have the benefit of 824 running code, which may serve as evidence of valuable experimentation 825 and feedback that have made the implemented protocols more mature. 826 It is up to the individual working groups to use this information as 827 they see fit". 829 7.1. Mint Fork 831 7.1.1. Overview 833 A fork of the Mint TLS 1.3 implementation, developed by Yaron Sheffer 834 and available at https://github.com/yaronf/mint. 836 7.1.2. Description 838 This is a fork of the TLS 1.3 implementation, and includes client and 839 server code. In addition to the actual protocol, several utilities 840 are provided allowing to manage pinning protection keys on the server 841 side, and pinning tickets on the client side. 843 7.1.3. Level of Maturity 845 This is a prototype. 847 7.1.4. Coverage 849 The entire protocol is implemented. 851 7.1.5. Version Compatibility 853 The implementation is compatible with draft-sheffer-tls-pinning- 854 ticket-02. 856 7.1.6. Licensing 858 Mint itself and this fork are available under an MIT license. 860 7.1.7. Contact Information 862 See author details below. 864 8. Security Considerations 866 This section reviews several security aspects related to the proposed 867 extension. 869 8.1. Trust on First Use (TOFU) and MITM Attacks 871 This protocol is a "trust on first use" protocol. If a client 872 initially connects to the "right" server, it will be protected 873 against MITM attackers for the lifetime of each received ticket. If 874 it connects regularly (depending of course on the server-selected 875 lifetime), it will stay constantly protected against fake 876 certificates. 878 However if it initially connects to an attacker, subsequent 879 connections to the "right" server will fail. Server operators might 880 want to advise clients on how to remove corrupted pins, once such 881 large scale attacks are detected and remediated. 883 The protocol is designed so that it is not vulnerable to an active 884 MITM attacker who has real-time access to the original server. The 885 pinning proof includes a hash of the server's public key, to ensure 886 the client that the proof was in fact generated by the server with 887 which it is initiating the connection. 889 8.2. Pervasive Monitoring 891 Some organizations, and even some countries perform pervasive 892 monitoring on their constituents [RFC7258]. This often takes the 893 form of always-active SSL proxies. Because of the TOFU property, 894 this protocol does not provide any security in such cases. 896 8.3. Server-Side Error Detection 898 Uniquely, this protocol allows the server to detect clients that 899 present incorrect tickets and therefore can be assumed to be victims 900 of a MITM attack. Server operators can use such cases as indications 901 of ongoing attacks, similarly to fake certificate attacks that took 902 place in a few countries in the past. 904 8.4. Client Policy and SSL Proxies 906 Like it or not, some clients are normally deployed behind an SSL 907 proxy. Similarly to [RFC7469], it is acceptable to allow pinning to 908 be disabled for some hosts according to local policy. For example, a 909 UA MAY disable pinning for hosts whose validated certificate chain 910 terminates at a user-defined trust anchor, rather than a trust anchor 911 built-in to the UA (or underlying platform). Moreover, a client MAY 912 accept an empty PinningTicket extension from such hosts as a valid 913 response. 915 8.5. Client-Side Error Behavior 917 When a client receives a malformed or empty PinningTicket extension 918 from a pinned server, it MUST abort the handshake and MUST NOT retry 919 with no PinningTicket in the request. Doing otherwise would expose 920 the client to trivial fallback attacks, similar to those described in 921 [RFC7507]. 923 This rule can however have negative affects on clients that move from 924 behind SSL proxies into the open Internet and vice versa, if the 925 advice in Section 8.4 is not followed. Therefore, we RECOMMEND that 926 browser and library vendors provide a documented way to remove stored 927 pins. 929 8.6. Stolen and Forged Tickets 931 Stealing pinning tickets even in conjunction with other pinning 932 parameters, such as the associated pinning secret, provides no 933 benefit to the attacker since pinning tickets are used to secure the 934 client rather than the server. Similarly, it is useless to forge a 935 ticket for a particular sever. 937 8.7. Client Privacy 939 This protocol is designed so that an external attacker cannot 940 correlate between different requests of a single client, provided the 941 client requests and receives a fresh ticket upon each connection. 943 On the other hand, the server to which the client is connecting can 944 easily track the client. This may be an issue when the client 945 expects to connect to the server (e.g., a mail server) with multiple 946 identities. Implementations SHOULD allow the user to opt out of 947 pinning, either in general or for particular servers. 949 8.8. Ticket Protection Key Management 951 While the ticket format is not mandated by this document, we 952 RECOMMEND using authenticated encryption to protect it. Some of the 953 algorithms commonly used for authenticated encryption, e.g. GCM, are 954 highly vulnerable to nonce reuse, and this problem is magnified in a 955 cluster setting. Therefore implementations that choose AES-128-GCM 956 MUST adopt one of these two alternatives: 958 - Partition the nonce namespace between cluster members and use 959 monotonic counters on each member, e.g. by setting the nonce to 960 the concatenation of the cluster member ID and an incremental 961 counter. 963 - Generate random nonces but avoid the so-called birthday bound, 964 i.e. never generate more than 2**64 encrypted tickets for the same 965 ticket pinning protection Key. 967 An alternative design which has been attributed to Karthik Bhargavan 968 is as follows. Start with a 128-bit master key "K_master" and then 969 for each encryption, generate a 256-bit random nonce and compute: 971 K = HKDF(K_master, Nonce || "key") 972 N = HKDF(K_master, Nonce || "nonce") 974 And use these values to encrypt the ticket, AES-GCM(K, N, ). 976 9. IANA Considerations 978 IANA is requested to allocate a TicketPinning extension value in the 979 TLS ExtensionType Registry. 981 No registries are defined by this document. 983 10. Acknowledgements 985 The original idea behind this proposal was published in [Oreo] by 986 Moty Yung, Benny Pinkas and Omer Berkman. The current protocol is 987 but a distant relative of the original Oreo protocol, and any errors 988 are the draft authors' alone. 990 We would like to thank Dave Garrett, Daniel Kahn Gillmor, Eric 991 Rescorla and Yoav Nir for their comments on this draft. Special 992 thanks to Craig Francis for contributing the HPKP deployment script, 993 and to Ralph Holz for several fruitful discussions. 995 11. References 997 11.1. Normative References 999 [I-D.ietf-tls-tls13] 1000 Rescorla, E., "The Transport Layer Security (TLS) Protocol 1001 Version 1.3", draft-ietf-tls-tls13-21 (work in progress), 1002 July 2016. 1004 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1005 Requirement Levels", BCP 14, RFC 2119, 1006 DOI 10.17487/RFC2119, March 1997, 1007 . 1009 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1010 "Transport Layer Security (TLS) Session Resumption without 1011 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1012 January 2008, . 1014 11.2. Informative References 1016 [I-D.perrin-tls-tack] 1017 Marlinspike, M., "Trust Assertions for Certificate Keys", 1018 draft-perrin-tls-tack-02 (work in progress), January 2013. 1020 [Netcraft] 1021 Mutton, P., "HTTP Public Key Pinning: You're doing it 1022 wrong!", March 2016, 1023 . 1026 [Oreo] Berkman, O., Pinkas, B., and M. Yung, "Firm Grip 1027 Handshakes: A Tool for Bidirectional Vouching", Cryptology 1028 and Network Security, pp. 142-157 , 2012. 1030 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 1031 Hashing for Message Authentication", RFC 2104, 1032 DOI 10.17487/RFC2104, February 1997, 1033 . 1035 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 1036 DOI 10.17487/RFC6454, December 2011, 1037 . 1039 [RFC6962] Laurie, B., Langley, A., and E. Kasper, "Certificate 1040 Transparency", RFC 6962, DOI 10.17487/RFC6962, June 2013, 1041 . 1043 [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an 1044 Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May 1045 2014, . 1047 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 1048 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 1049 2015, . 1051 [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 1052 Suite Value (SCSV) for Preventing Protocol Downgrade 1053 Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, 1054 . 1056 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1057 Code: The Implementation Status Section", BCP 205, 1058 RFC 7942, DOI 10.17487/RFC7942, July 2016, 1059 . 1061 Appendix A. Document History 1063 A.1. draft-sheffer-tls-pinning-ticket-05 1065 - Multiple comments from Eric Rescorla. 1067 A.2. draft-sheffer-tls-pinning-ticket-04 1069 - Editorial changes. 1071 - Two-phase rotation of protection key. 1073 A.3. draft-sheffer-tls-pinning-ticket-03 1075 - Deleted redundant length fields in the extension's formal 1076 definition. 1078 - Modified cryptographic operations to align with the current state 1079 of TLS 1.3. 1081 - Numerous textual improvements. 1083 A.4. draft-sheffer-tls-pinning-ticket-02 1085 - Added an Implementation Status section. 1087 - Added lengths into the extension structure. 1089 - Changed the computation of the pinning proof to be more robust. 1091 - Clarified requirements on the length of the pinning_secret. 1093 - Revamped the HPKP section to be more in line with current 1094 practices, and added recent statistics on HPKP deployment. 1096 A.5. draft-sheffer-tls-pinning-ticket-01 1098 - Corrected the notation for variable-sized vectors. 1100 - Added a section on disaster recovery and backup. 1102 - Added a section on privacy. 1104 - Clarified the assumptions behind the HPKP procedure in the 1105 comparison section. 1107 - Added a definition of pin indexing (origin). 1109 - Adjusted to the latest TLS 1.3 notation. 1111 A.6. draft-sheffer-tls-pinning-ticket-00 1113 Initial version. 1115 Authors' Addresses 1117 Yaron Sheffer 1118 Intuit 1120 EMail: yaronf.ietf@gmail.com 1122 Daniel Migault 1123 Ericsson 1125 EMail: daniel.migault@ericsson.com