idnits 2.17.1 draft-sheffer-tls-pinning-ticket-07.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 == Line 427 has weird spacing: '... ticket a pin...' == Line 431 has weird spacing: '... proof a dem...' == Line 436 has weird spacing: '...ifetime the d...' -- The document date (November 08, 2018) is 1986 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- ** 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 (~~), 4 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: May 12, 2019 Ericsson 6 November 08, 2018 8 TLS Server Identity Pinning with Tickets 9 draft-sheffer-tls-pinning-ticket-07 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 May 12, 2019. 47 Copyright Notice 49 Copyright (c) 2018 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 . . . . . . . . . . . . . . . . . . . . . . 22 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-07 . . . . . . . . . . . 24 112 A.2. draft-sheffer-tls-pinning-ticket-06 . . . . . . . . . . . 24 113 A.3. draft-sheffer-tls-pinning-ticket-05 . . . . . . . . . . . 24 114 A.4. draft-sheffer-tls-pinning-ticket-04 . . . . . . . . . . . 24 115 A.5. draft-sheffer-tls-pinning-ticket-03 . . . . . . . . . . . 24 116 A.6. draft-sheffer-tls-pinning-ticket-02 . . . . . . . . . . . 24 117 A.7. draft-sheffer-tls-pinning-ticket-01 . . . . . . . . . . . 24 118 A.8. draft-sheffer-tls-pinning-ticket-00 . . . . . . . . . . . 25 119 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 25 121 1. Introduction 123 The weaknesses of the global PKI system are by now widely known. 124 Essentially, any valid CA may issue a certificate for any 125 organization without the organization's approval (a misissued or 126 "fake" certificate), and use the certificate to impersonate the 127 organization. There are many attempts to resolve these weaknesses, 128 including Certificate Transparency (CT) [RFC6962], HTTP Public Key 129 Pinning (HPKP) [RFC7469], and TACK [I-D.perrin-tls-tack]. CT 130 requires cooperation of a large portion of the hundreds of extant 131 certificate authorities (CAs) before it can be used "for real", in 132 enforcing mode. It is noted that the relevant industry forum (CA/ 133 Browser Forum) is indeed pushing for such extensive adoption. TACK 134 has some similarities to the current proposal, but work on it seems 135 to have stalled. Section 6.2 compares our proposal to TACK. 137 HPKP is an IETF standard, but so far has proven hard to deploy. HPKP 138 pins (fixes) a public key, one of the public keys listed in the 139 certificate chain. As a result, HPKP needs to be coordinated with 140 the certificate management process. Certificate management impacts 141 HPKP and thus increases the probability of HPKP failures. This risk 142 is made even higher given the fact that, even though work has been 143 done at the ACME WG to automate certificate management, in many or 144 even most cases, certificates are still managed manually. As a 145 result, HPKP cannot be completely automated resulting in error-prone 146 manual configuration. Such errors could prevent the web server from 147 being accessed by some clients. In addition, HPKP uses a HTTP header 148 which makes this solution HTTPS specific and not generic to TLS. On 149 the other hand, the current document provides a solution that is 150 independent of the server's certificate management and that can be 151 entirely and easily automated. Section 6.1 compares HPKP to the 152 current draft in more detail. 154 The ticket pinning proposal augments these mechanisms with a much 155 easier to implement and deploy solution for server identity pinning, 156 by reusing some of the ideas behind TLS session resumption. 158 Ticket pinning is a second factor server authentication method and is 159 not proposed as a substitute of the authentication method provided in 160 the TLS key exchange. More specifically, the client only uses the 161 pinning identity method after the TLS key exchange is successfully 162 completed. In other words, the pinning identity method is only 163 performed over an authenticated TLS session. Note that Ticket 164 Pinning does not pin certificate information and as such should be 165 considered a "real" independent second factor authentication. 167 Ticket pinning is a Trust On First Use (TOFU) mechanism, in that the 168 first server authentication is only based on PKI certificate 169 validation, but for any follow-on sessions, the client is further 170 ensuring the server's identity based on the server's ability to 171 decrypt the ticket, in addition to normal PKI certificate 172 authentication. 174 During initial TLS session establishment, the client requests a 175 pinning ticket from the server. Upon receiving the request the 176 server generates a pinning secret which is expected to be 177 unpredictable for peers other than the client or the server. In our 178 case, the pinning secret is generated from parameters exchanged 179 during the TLS key exchange, so client and server can generate it 180 locally and independently. The server constructs the pinning ticket 181 with the necessary information to retrieve the pinning secret. The 182 server then encrypts the ticket and returns the pinning ticket to the 183 client with an associated pinning lifetime. 185 The pinning lifetime value indicates for how long the server promises 186 to retain the server-side ticket-encryption key, which allows it to 187 complete the protocol exchange correctly and prove its identity. The 188 committed lifetime is typically on the order of weeks or months. 190 Once the key exchange is completed and the server is deemed 191 authenticated, the client generates locally the pinning secret and 192 caches the server's identifiers to index the pinning secret as well 193 as the pinning ticket and its associated lifetime. 195 When the client re-establishes a new TLS session with the server, it 196 sends the pinning ticket to the server. Upon receiving it, the 197 server returns a proof of knowledge of the pinning secret. Once the 198 key exchange is completed and the server has been authenticated, the 199 client checks the pinning proof returned by the server using the 200 client's stored pinning secret. If the proof matches, the client can 201 conclude that the server it is currently connecting to is in fact the 202 correct server. 204 This version of the draft only applies to TLS 1.3. We believe that 205 the idea can also be back-fitted into earlier versions of the 206 protocol. 208 The main advantages of this protocol over earlier pinning solutions 209 are: 211 - The protocol is at the TLS level, and as a result is not 212 restricted to HTTP at the application level. 214 - The protocol is robust to server IP, CA, and public key changes. 215 The server is characterized by the ownership of the pinning 216 protection key, which is never provided to the client. Server 217 configuration parameters such as the CA and the public key may 218 change without affecting the pinning ticket protocol. 220 - Once a single parameter is configured (the ticket's lifetime), 221 operation is fully automated. The server administrator need not 222 bother with the management of backup certificates or explicit 223 pins. 225 - For server clusters, we reuse the existing [RFC5077] 226 infrastructure where it exists. 228 - Pinning errors, presumably resulting from MITM attacks, can be 229 detected both by the client and the server. This allows for 230 server-side detection of MITM attacks using large-scale analytics, 231 and with no need to rely on clients to explicitly report the 232 error. 234 A note on terminology: unlike other solutions in this space, we do 235 not do "certificate pinning" (or "public key pinning"), since the 236 protocol is oblivious to the server's certificate. We prefer the 237 term "server identity pinning" for this new solution. In out 238 solution, the server proves its identity by generating a proof that 239 it can read and decrypt an encrypted ticket. As a result, the 240 identity proof relies on proof of ownership of the pinning protection 241 key. However, this key is never exchanged with the client or known 242 by it, and so cannot itself be pinned. 244 1.1. Conventions used in this document 246 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 247 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 248 document are to be interpreted as described in [RFC2119]. 250 2. Protocol Overview 252 The protocol consists of two phases: the first time a particular 253 client connects to a server, and subsequent connections. 255 This protocol supports full TLS handshakes, as well as 0-RTT 256 handshakes. Below we present it in the context of a full handshake, 257 but behavior in 0-RTT handshakes should be identical. 259 The document presents some similarities with the ticket resumption 260 mechanism described in [RFC5077]. However the scope of this document 261 differs from session resumption mechanisms implemented with [RFC5077] 262 or with other mechanisms. Specifically, the pinning ticket does not 263 carry any state associated with a TLS session and thus cannot be used 264 for session resumption, or to authenticate the client. Instead, the 265 pinning ticket only contains the Pinning Secret used to generate the 266 proof. 268 With TLS 1.3, session resumption is based on a preshared key (PSK). 269 This is orthogonal to this protocol. With TLS 1.3, a TLS session can 270 be established using PKI and a pinning ticket, and later resumed with 271 PSK. 273 However, the protocol described in this document addresses the 274 problem of misissued certificates. Thus, it is not expected to be 275 used outside a certificate-based TLS key exchange, such as in PSK. 276 As a result, PSK handshakes MUST NOT include the extension defined 277 here. 279 2.1. Initial Connection 281 When a client first connects to a server, it requests a pinning 282 ticket by sending an empty PinningTicket extension, and receives it 283 as part of the server's first response, in the returned PinningTicket 284 extension. 286 Client Server 288 ClientHello 289 + key_share 290 + signature_algorithms* 291 + PinningTicket --------> 292 ServerHello 293 + key_share 294 {EncryptedExtensions 295 + PinningTicket} 296 {CertificateRequest*} 297 {Certificate*} 298 {CertificateVerify*} 299 <-------- {Finished} 300 {Certificate*} 301 {CertificateVerify*} 302 {Finished} --------> 303 [Application Data] <-------> [Application Data] 305 * Indicates optional or situation-dependent 306 messages that are not always sent. 308 {} Indicates messages protected using keys 309 derived from the ephemeral secret. 311 [] Indicates messages protected using keys 312 derived from the master secret. 314 If a client supports the pinning ticket extension and does not have 315 any pinning ticket associated with the server, the exchange is 316 considered as an initial connection. Other reasons the client may 317 not have a pinning ticket include the client having flushed its 318 pinning ticket store, or the committed lifetime of the pinning ticket 319 having expired. 321 Upon receipt of the PinningTicket extension, the server computes a 322 pinning secret (Section 4.1), and sends the pinning ticket 323 (Section 4.2) encrypted with the pinning protection key 324 (Section 4.3). The pinning ticket is associated with a lifetime 325 value by which the server assumes the responsibility of retaining the 326 pinning protection key and being able to decrypt incoming pinning 327 tickets during the period indicated by the committed lifetime. 329 Once the pinning ticket has been generated, the server returns the 330 pinning ticket and the committed lifetime in a PinningTicket 331 extension embedded in the EncryptedExtensions message. We note that 332 a PinningTicket extension MUST NOT be sent as part of a 333 HelloRetryRequest. 335 Upon receiving the pinning ticket, the client MUST NOT accept it 336 until the key exchange is completed and the server authenticated. If 337 the key exchange is not completed successfully, the client MUST 338 ignore the received pinning ticket. Otherwise, the client computes 339 the pinning secret and SHOULD cache the pinning secret and the 340 pinning ticket for the duration indicated by the pinning ticket 341 lifetime. The client SHOULD clean up the cached values at the end of 342 the indicated lifetime. 344 2.2. Subsequent Connections 346 When the client initiates a connection to a server it has previously 347 seen (see Section 2.3 on identifying servers), it SHOULD send the 348 pinning ticket for that server. The pinning ticket, pinning secret 349 and pinning ticket lifetime computed during the establishment of the 350 previous TLS session are designated in this document as the 351 "original" ones, to distinguish them from a new ticket that may be 352 generated during the current session. 354 The server MUST extract the original pinning_secret value from the 355 ticket and MUST respond with a PinningTicket extension, which 356 includes: 358 - A proof that the server can understand the ticket that was sent by 359 the client; this proof also binds the pinning ticket to the 360 server's (current) public key, as well as the ongoing TLS session. 361 The proof is MANDATORY if a pinning ticket was sent by the client. 363 - A fresh pinning ticket. The main reason for refreshing the ticket 364 on each connection is privacy: to avoid the ticket serving as a 365 fixed client identifier. It is RECOMMENDED to include a fresh 366 ticket with each response. 368 If the server cannot validate the received ticket, that might 369 indicate an earlier MITM attack on this client. The server MUST then 370 abort the connection with a handshake_failure alert, and SHOULD log 371 this failure. 373 The client MUST verify the proof, and if it fails to do so, MUST 374 issue a handshake_failure alert and abort the connection (see also 375 Section 8.5). It is important that the client does not attempt to 376 "fall back" by omitting the PinningTicket extension. 378 When the connection is successfully set up, i.e. after the Finished 379 message is verified, the client SHOULD store the new ticket along 380 with the corresponding pinning_secret, replacing the original ticket. 382 Although this is an extension, if the client already has a ticket for 383 a server, the client MUST interpret a missing PinningTicket extension 384 in the server's response as an attack, because of the server's prior 385 commitment to respect the ticket. The client MUST abort the 386 connection in this case. See also Section 5.5 on ramping down 387 support for this extension. 389 2.3. Indexing the Pins 391 Each pin is associated with a host name, protocol (TLS or DTLS) and 392 port number. In other words, the pin for port TCP/443 may be 393 different from that for DTLS or from the pin for port TCP/8443. The 394 host name MUST be the value sent inside the Server Name Indication 395 (SNI) extension. This definition is similar to a Web Origin 396 [RFC6454], but does not assume the existence of a URL. 398 The purpose of ticket pinning is to pin the server identity. As a 399 result, any information orthogonal to the server's identity MUST NOT 400 be considered in indexing. More particularly, IP addresses are 401 ephemeral and forbidden in SNI and therefore pins MUST NOT be 402 associated with IP addresses. Similarly, CA names or public keys 403 associated with server MUST NOT be used for indexing as they may 404 change over time. 406 3. Message Definitions 408 This section defines the format of the PinningTicket extension. We 409 follow the message notation of [RFC8446]. 411 opaque pinning_ticket<0..2^16-1>; 413 opaque pinning_proof<0..2^8-1>; 415 struct { 416 select (Role) { 417 case client: 418 pinning_ticket ticket<0..2^16-1>; //omitted on 1st connection 420 case server: 421 pinning_proof proof<0..2^8-1>; //no proof on 1st connection 422 pinning_ticket ticket<0..2^16-1>; //omitted on ramp down 423 uint32 lifetime; 424 } 425 } PinningTicketExtension; 427 ticket a pinning ticket sent by the client or returned by the 428 server. The ticket is opaque to the client. The extension MUST 429 contain exactly 0 or 1 tickets. 431 proof a demonstration by the server that it understands the received 432 ticket and therefore that it is in possession of the secret that 433 was used to generate it originally. The extension MUST contain 434 exactly 0 or 1 proofs. 436 lifetime the duration (in seconds) that the server commits to accept 437 offered tickets in the future. 439 4. Cryptographic Operations 441 This section provides details on the cryptographic operations 442 performed by the protocol peers. 444 4.1. Pinning Secret 446 The pinning secret is generated locally by the client and the server 447 which means they must use the same inputs to generate it. This value 448 must be generated before the ServerHello message is sent, as the 449 server includes the corresponding pinning ticket in the ServerHello 450 message. In addition, the pinning secret must be unpredictable to 451 any party other than the client and the server. 453 The pinning secret is derived using the Derive-Secret function 454 provided by TLS 1.3, described in Section "Key Schedule" of 455 [RFC8446]. 457 pinning secret = Derive-Secret(Handshake Secret, "pinning secret", 458 ClientHello...ServerHello) 460 4.2. Pinning Ticket 462 The pinning ticket contains the pinning secret. The pinning ticket 463 is provided by the client to the server which decrypts it in order to 464 extract the pinning secret and responds with a pinning proof. As a 465 result, the characteristics of the pinning ticket are: 467 - Pinning tickets MUST be encrypted and integrity-protected using 468 strong cryptographic algorithms. 470 - Pinning tickets MUST be protected with a long-term pinning 471 protection key. 473 - Pinning tickets MUST include a pinning protection key ID or serial 474 number as to enable the pinning protection key to be refreshed. 476 - The pinning ticket MAY include other information, in addition to 477 the pinning secret. 479 The pinning ticket's format is not specified by this document, but we 480 RECOMMEND a format similar to the one proposed by [RFC5077]. 482 4.3. Pinning Protection Key 484 The pinning protection key is only used by the server and so remains 485 server implementation specific. [RFC5077] recommends the use of two 486 keys, but when using AEAD algorithms only a single key is required. 488 When a single server terminates TLS for multiple virtual servers 489 using the Server Name Indication (SNI) mechanism, we strongly 490 RECOMMEND to use a separate protection key for each one of them, in 491 order to allow migrating virtual servers between different servers 492 while keeping pinning active. 494 As noted in Section 5.1, if the server is actually a cluster of 495 machines, the protection key MUST be synchronized between all the 496 nodes that accept TLS connections to the same server name. When 497 [RFC5077] is deployed, an easy way to do it is to derive the 498 protection key from the session-ticket protection key, which is 499 already synchronized. For example: 501 pinning_protection_key = HKDF-Expand(resumption_protection_key, 502 "pinning protection", L) 504 4.4. Pinning Proof 506 The pinning proof is sent by the server to demonstrate that it has 507 been able to decrypt the pinning ticket and retrieve the pinning 508 secret. The proof must be unpredictable and must not be replayed. 509 Similarly to the pinning secret, the pinning proof is sent by the 510 server in the ServerHello message. In addition, it must not be 511 possible for a MITM server with a fake certificate to obtain a 512 pinning proof from the original server. 514 In order to address these requirements, the pinning proof is bound to 515 the TLS session as well as the public key of the server: 517 proof = HMAC(original_pinning_secret, "pinning proof" + 518 Handshake-Secret + Hash(server_public_key)) 520 where HMAC [RFC2104] uses the Hash algorithm that was negotiated in 521 the handshake, and the same hash is also used over the server's 522 public key. The original_pinning_secret value refers to the secret 523 value extracted from the ticket sent by the client, to distinguish it 524 from a new pinning secret value that is possibly computed in the 525 current exchange. The server_public_key value is the DER 526 representation of the public key, specifically the 527 SubjectPublicKeyInfo structure as-is. 529 5. Operational Considerations 531 The main motivation behind the current protocol is to enable identity 532 pinning without the need for manual operations. To achieve this goal 533 operations described in identity pinning are only performed within 534 the current TLS session, and there is no dependence on any TLS 535 configuration parameters such as CA identity or public keys. As a 536 result, configuration changes are unlikely to lead to desynchronized 537 state between the client and the server. Manual operations are 538 susceptible to human error and in the case of public key pinning, can 539 easily result in "server bricking": the server becoming inaccessible 540 to some or all of its users. 542 5.1. Protection Key Synchronization 544 The only operational requirement when deploying this protocol is that 545 if the server is part of a cluster, protection keys (the keys used to 546 encrypt tickets) MUST be synchronized between all cluster members. 547 The protocol is designed so that if resumption ticket protection keys 548 [RFC5077] are already synchronized between cluster members, nothing 549 more needs to be done. 551 Moreover, synchronization does not need to be instantaneous, e.g. 552 protection keys can be distributed a few minutes or hours in advance 553 of their rollover. In such scenarios, each cluster member MUST be 554 able to accept tickets protected with a new version of the protection 555 key, even while it is still using an old version to generate keys. 556 This ensures that a client that receives a "new" ticket does not next 557 hit a cluster member that still rejects this ticket. 559 Misconfiguration can lead to the server's clock being off by a large 560 amount of time. Therefore we RECOMMEND never to automatically delete 561 protection keys, even when they are long expired. 563 5.2. Ticket Lifetime 565 The lifetime of the ticket is a commitment by the server to retain 566 the ticket's corresponding protection key for this duration, so that 567 the server can prove to the client that it knows the secret embedded 568 in the ticket. For production systems, the lifetime SHOULD be 569 between 7 and 31 days. 571 5.3. Certificate Renewal 573 The protocol ensures that the client will continue speaking to the 574 correct server even when the server's certificate is renewed. In 575 this sense, we are not "pinning certificates" and the protocol should 576 more precisely be called "server identity pinning". 578 Note that this property is not impacted by the use of the server's 579 public key in the pinning proof, because the scope of the public key 580 used is only the current TLS session. 582 5.4. Certificate Revocation 584 The protocol is orthogonal to certificate validation in the sense 585 that, if the server's certificate has been revoked or is invalid for 586 some other reason, the client MUST refuse to connect to it regardless 587 of any ticket-related behavior. 589 5.5. Disabling Pinning 591 A server implementing this protocol MUST have a "ramp down" mode of 592 operation where: 594 - The server continues to accept valid pinning tickets and responds 595 correctly with a proof. 597 - The server does not send back a new pinning ticket. 599 After a while no clients will hold valid tickets any more and the 600 feature may be disabled. Note that clients that do not receive a new 601 pinning ticket do not remove the original ticket. Instead, the 602 client keeps on using the ticket until its lifetime expires. 604 Issuing a new pinning ticket with a shorter lifetime would only delay 605 the ramp down process, as the shorter lifetime can only affect 606 clients that actually initiated a new connection. Other clients 607 would still see the original lifetime for their pinning tickets. 609 5.6. Server Compromise 611 If a server compromise is detected, the pinning protection key MUST 612 be rotated immediately, but the server MUST still accept valid 613 tickets that use the old, compromised key. Clients that still hold 614 old pinning tickets will remain vulnerable to MITM attacks, but those 615 that connect to the correct server will immediately receive new 616 tickets protected with the newly generated pinning protection key. 618 The same procedure applies if the pinning protection key is 619 compromised directly, e.g. if a backup copy is inadvertently made 620 public. 622 5.7. Disaster Recovery 624 All web servers in production need to be backed up, so that they can 625 be recovered if a disaster (including a malicious activity) ever 626 wipes them out. Backup typically includes the certificate and its 627 private key, which must be backed up securely. The pinning secret, 628 including earlier versions that are still being accepted, must be 629 backed up regularly. However since it is only used as an 630 authentication second factor, it does not require the same level of 631 confidentiality as the server's private key. 633 Readers should note that [RFC5077] session resumption keys are more 634 security sensitive, and should normally not be backed up but rather 635 treated as ephemeral keys. Even when servers derive pinning secrets 636 from resumption keys (Section 4.1), they MUST NOT back up resumption 637 keys. 639 6. Previous Work 641 This section compares ticket pinning to two earlier proposals, HPKP 642 and TACK. 644 6.1. Comparison: HPKP 646 The current IETF standard for pinning the identity of web servers is 647 the Public Key Pinning Extension for HTTP, or HPKP [RFC7469]. 649 The main differences between HPKP and the current document are the 650 following: 652 - HPKP limits its scope to HTTPS, while the current document 653 considers all application above TLS. 655 - HPKP pins the public key of the server (or another public key 656 along the certificate chain) and as such is highly dependent on 657 the management of certificates. Such dependency increases the 658 potential error surface, especially as certificate management is 659 not yet largely automated. The current proposal, on the other 660 hand is independent of certificate management. 662 - HPKP pins public keys which are public and used for the standard 663 TLS authentication. Identity pinning relies on the ownership of 664 the pinning key which is not disclosed to the public and not 665 involved in the standard TLS authentication. As a result, 666 identity pinning is a completely independent second factor 667 authentication mechanism. 669 - HPKP relies on a backup key to recover the mis-issuance of a key. 670 We believe such backup mechanisms add excessive complexity and 671 cost. Reliability of the current mechanism is primarily based on 672 its being highly automated. 674 - HPKP relies on the client to report errors to the report-uri. The 675 current document not need any out-of band mechanism, and the 676 server is informed automatically. This provides an easier and 677 more reliable health monitoring. 679 On the other hand, HPKP shares the following aspects with identity 680 pinning: 682 - Both mechanisms provide hard failure. With HPKP only the client 683 is aware of the failure, while with the current proposal both 684 client and server are informed of the failure. This provides room 685 for further mechanisms to automatically recover such failures. 687 - Both mechanisms are subject to a server compromise in which users 688 are provided with an invalid ticket (e.g. a random one) or HTTP 689 Header, with a very long lifetime. For identity pinning, this 690 lifetime cannot be longer than 31 days. In both cases, clients 691 will not be able to reconnect the server during this lifetime. 692 With the current proposal, an attacker needs to compromise the TLS 693 layer, while with HPKP, the attacker needs to compromise the HTTP 694 server. Arguably, the TLS-level compromise is typically more 695 difficult for the attacker. 697 Unfortunately HPKP has not seen wide deployment yet. As of March 698 2016, the number of servers using HPKP was less than 3000 [Netcraft]. 699 This may simply be due to inertia, but we believe the main reason is 700 the interactions between HPKP and manual certificate management which 701 is needed to implement HPKP for enterprise servers. The penalty for 702 making mistakes (e.g. being too early or too late to deploy new pins) 703 is having the server become unusable for some of the clients. 705 To demonstrate this point, we present a list of the steps involved in 706 deploying HPKP on a security-sensitive Web server. 708 1. Generate two public/private key-pairs on a computer that is not 709 the Live server. The second one is the "backup1" key-pair. 711 "openssl genrsa -out "example.com.key" 2048;" 713 "openssl genrsa -out "example.com.backup1.key" 2048;" 715 2. Generate hashes for both of the public keys. These will be used 716 in the HPKP header: 718 "openssl rsa -in "example.com.key" -outform der -pubout | 719 openssl dgst -sha256 -binary | openssl enc -base64" 721 "openssl rsa -in "example.com.backup1.key" -outform der 722 -pubout | openssl dgst -sha256 -binary | openssl enc -base64" 724 3. Generate a single CSR (Certificate Signing Request) for the 725 first key-pair, where you include the domain name in the CN 726 (Common Name) field: 728 "openssl req -new -subj "/C=GB/ST=Area/L=Town/O=Company/ 729 CN=example.com" -key "example.com.key" -out "example.com.csr";" 731 4. Send this CSR to the CA (Certificate Authority), and go though 732 the dance to prove you own the domain. The CA will give you 733 back a single certificate that will typically expire within a 734 year or two. 736 5. On the Live server, upload and setup the first key-pair (and its 737 certificate). At this point you can add the "Public-Key-Pins" 738 header, using the two hashes you created in step 2. 740 Note that only the first key-pair has been uploaded to the 741 server so far. 743 6. Store the second (backup1) key-pair somewhere safe, probably 744 somewhere encrypted like a password manager. It won't expire, 745 as it's just a key-pair, it just needs to be ready for when you 746 need to get your next certificate. 748 7. Time passes... probably just under a year (if waiting for a 749 certificate to expire), or maybe sooner if you find that your 750 server has been compromised and you need to replace the key-pair 751 and certificate. 753 8. Create a new CSR (Certificate Signing Request) using the 754 "backup1" key-pair, and get a new certificate from your CA. 756 9. Generate a new backup key-pair (backup2), get its hash, and 757 store it in a safe place (again, not on the Live server). 759 10. Replace your old certificate and old key-pair, and update the 760 "Public-Key-Pins" header to remove the old hash, and add the new 761 "backup2" key-pair. 763 Note that in the above steps, both the certificate issuance as well 764 as the storage of the backup key pair involve manual steps. Even 765 with an automated CA that runs the ACME protocol, key backup would be 766 a challenge to automate. 768 6.2. Comparison: TACK 770 Compared with HPKP, TACK [I-D.perrin-tls-tack] is a lot more similar 771 to the current draft. It can even be argued that this document is a 772 symmetric-cryptography variant of TACK. That said, there are still a 773 few significant differences: 775 - Probably the most important difference is that with TACK, 776 validation of the server certificate is no longer required, and in 777 fact TACK specifies it as a "MAY" requirement (Sec. 5.3). With 778 ticket pinning, certificate validation by the client remains a 779 MUST requirement, and the ticket acts only as a second factor. If 780 the pinning secret is compromised, the server's security is not 781 immediately at risk. 783 - Both TACK and the current draft are mostly orthogonal to the 784 server certificate as far as their life cycle, and so both can be 785 deployed with no manual steps. 787 - TACK uses ECDSA to sign the server's public key. This allows 788 cooperating clients to share server assertions between themselves. 789 This is an optional TACK feature, and one that cannot be done with 790 pinning tickets. 792 - TACK allows multiple servers to share its public keys. Such 793 sharing is disallowed by the current document. 795 - TACK does not allow the server to track a particular client, and 796 so has better privacy properties than the current draft. 798 - TACK has an interesting way to determine the pin's lifetime, 799 setting it to the time period since the pin was first observed, 800 with a hard upper bound of 30 days. The current draft makes the 801 lifetime explicit, which may be more flexible to deploy. For 802 example, Web sites which are only visited rarely by users may opt 803 for a longer period than other sites that expect users to visit on 804 a daily basis. 806 7. Implementation Status 808 Note to RFC Editor: please remove this section before publication, 809 including the reference to [RFC7942]. 811 This section records the status of known implementations of the 812 protocol defined by this specification at the time of posting of this 813 Internet-Draft, and is based on a proposal described in [RFC7942]. 814 The description of implementations in this section is intended to 815 assist the IETF in its decision processes in progressing drafts to 816 RFCs. Please note that the listing of any individual implementation 817 here does not imply endorsement by the IETF. Furthermore, no effort 818 has been spent to verify the information presented here that was 819 supplied by IETF contributors. This is not intended as, and must not 820 be construed to be, a catalog of available implementations or their 821 features. Readers are advised to note that other implementations may 822 exist. 824 According to RFC 7942, "this will allow reviewers and working groups 825 to assign due consideration to documents that have the benefit of 826 running code, which may serve as evidence of valuable experimentation 827 and feedback that have made the implemented protocols more mature. 828 It is up to the individual working groups to use this information as 829 they see fit". 831 7.1. Mint Fork 833 7.1.1. Overview 835 A fork of the Mint TLS 1.3 implementation, developed by Yaron Sheffer 836 and available at https://github.com/yaronf/mint. 838 7.1.2. Description 840 This is a fork of the TLS 1.3 implementation, and includes client and 841 server code. In addition to the actual protocol, several utilities 842 are provided allowing to manage pinning protection keys on the server 843 side, and pinning tickets on the client side. 845 7.1.3. Level of Maturity 847 This is a prototype. 849 7.1.4. Coverage 851 The entire protocol is implemented. 853 7.1.5. Version Compatibility 855 The implementation is compatible with draft-sheffer-tls-pinning- 856 ticket-02. 858 7.1.6. Licensing 860 Mint itself and this fork are available under an MIT license. 862 7.1.7. Contact Information 864 See author details below. 866 8. Security Considerations 868 This section reviews several security aspects related to the proposed 869 extension. 871 8.1. Trust on First Use (TOFU) and MITM Attacks 873 This protocol is a "trust on first use" protocol. If a client 874 initially connects to the "right" server, it will be protected 875 against MITM attackers for the lifetime of each received ticket. If 876 it connects regularly (depending of course on the server-selected 877 lifetime), it will stay constantly protected against fake 878 certificates. 880 However if it initially connects to an attacker, subsequent 881 connections to the "right" server will fail. Server operators might 882 want to advise clients on how to remove corrupted pins, once such 883 large scale attacks are detected and remediated. 885 The protocol is designed so that it is not vulnerable to an active 886 MITM attacker who has real-time access to the original server. The 887 pinning proof includes a hash of the server's public key, to ensure 888 the client that the proof was in fact generated by the server with 889 which it is initiating the connection. 891 8.2. Pervasive Monitoring 893 Some organizations, and even some countries perform pervasive 894 monitoring on their constituents [RFC7258]. This often takes the 895 form of always-active SSL proxies. Because of the TOFU property, 896 this protocol does not provide any security in such cases. 898 8.3. Server-Side Error Detection 900 Uniquely, this protocol allows the server to detect clients that 901 present incorrect tickets and therefore can be assumed to be victims 902 of a MITM attack. Server operators can use such cases as indications 903 of ongoing attacks, similarly to fake certificate attacks that took 904 place in a few countries in the past. 906 8.4. Client Policy and SSL Proxies 908 Like it or not, some clients are normally deployed behind an SSL 909 proxy. Similarly to [RFC7469], it is acceptable to allow pinning to 910 be disabled for some hosts according to local policy. For example, a 911 UA MAY disable pinning for hosts whose validated certificate chain 912 terminates at a user-defined trust anchor, rather than a trust anchor 913 built-in to the UA (or underlying platform). Moreover, a client MAY 914 accept an empty PinningTicket extension from such hosts as a valid 915 response. 917 8.5. Client-Side Error Behavior 919 When a client receives a malformed or empty PinningTicket extension 920 from a pinned server, it MUST abort the handshake and MUST NOT retry 921 with no PinningTicket in the request. Doing otherwise would expose 922 the client to trivial fallback attacks, similar to those described in 923 [RFC7507]. 925 This rule can however have negative affects on clients that move from 926 behind SSL proxies into the open Internet and vice versa, if the 927 advice in Section 8.4 is not followed. Therefore, we RECOMMEND that 928 browser and library vendors provide a documented way to remove stored 929 pins. 931 8.6. Stolen and Forged Tickets 933 Stealing pinning tickets even in conjunction with other pinning 934 parameters, such as the associated pinning secret, provides no 935 benefit to the attacker since pinning tickets are used to secure the 936 client rather than the server. Similarly, it is useless to forge a 937 ticket for a particular sever. 939 8.7. Client Privacy 941 This protocol is designed so that an external attacker cannot 942 correlate between different requests of a single client, provided the 943 client requests and receives a fresh ticket upon each connection. 945 On the other hand, the server to which the client is connecting can 946 easily track the client. This may be an issue when the client 947 expects to connect to the server (e.g., a mail server) with multiple 948 identities. Implementations SHOULD allow the user to opt out of 949 pinning, either in general or for particular servers. 951 8.8. Ticket Protection Key Management 953 While the ticket format is not mandated by this document, we 954 RECOMMEND using authenticated encryption to protect it. Some of the 955 algorithms commonly used for authenticated encryption, e.g. GCM, are 956 highly vulnerable to nonce reuse, and this problem is magnified in a 957 cluster setting. Therefore implementations that choose AES-128-GCM 958 MUST adopt one of these two alternatives: 960 - Partition the nonce namespace between cluster members and use 961 monotonic counters on each member, e.g. by setting the nonce to 962 the concatenation of the cluster member ID and an incremental 963 counter. 965 - Generate random nonces but avoid the so-called birthday bound, 966 i.e. never generate more than 2**64 encrypted tickets for the same 967 ticket pinning protection Key. 969 An alternative design which has been attributed to Karthik Bhargavan 970 is as follows. Start with a 128-bit master key "K_master" and then 971 for each encryption, generate a 256-bit random nonce and compute: 973 K = HKDF(K_master, Nonce || "key") 974 N = HKDF(K_master, Nonce || "nonce") 976 And use these values to encrypt the ticket, AES-GCM(K, N, ). 978 9. IANA Considerations 980 IANA is requested to allocate a TicketPinning extension value in the 981 TLS ExtensionType Registry. 983 [RFC8447] defines the procedure and requirements and the necessary 984 information for the IANA to update the "TLS ExtensionType Values" 985 registry [TLS-EXT]. 987 According to [RFC8447] the update of the "TLS ExtensionType Values" 988 registry is "Specification Required" [RFC8126] which is fulfilled by 989 the current document, when it is published as an RFC. 991 The TicketPinning Extension is not limited to Private use and as such 992 the TicketPinning Extension Value is expected to have its first byte 993 in the range 0-254. A value of 26 would address this requirement. 995 The TicketPinning Extension Name is expected to be ticket_pinning. 997 The TicketPinning Extension Recommended value should be set to "No" 998 with the publication of the current document as "Experimental". 1000 The TicketPinning Extension TLS.13 column should be set to CH, SH to 1001 indicate that the TicketPinning Extension is present in ClientHello 1002 and ServerHello messages. 1004 10. Acknowledgements 1006 The original idea behind this proposal was published in [Oreo] by 1007 Moty Yung, Benny Pinkas and Omer Berkman. The current protocol is 1008 but a distant relative of the original Oreo protocol, and any errors 1009 are the draft authors' alone. 1011 We would like to thank Dave Garrett, Daniel Kahn Gillmor, Eric 1012 Rescorla and Yoav Nir for their comments on this draft. Special 1013 thanks to Craig Francis for contributing the HPKP deployment script, 1014 and to Ralph Holz for several fruitful discussions. 1016 11. References 1018 11.1. Normative References 1020 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1021 Requirement Levels", BCP 14, RFC 2119, 1022 DOI 10.17487/RFC2119, March 1997, 1023 . 1025 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1026 "Transport Layer Security (TLS) Session Resumption without 1027 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1028 January 2008, . 1030 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 1031 Writing an IANA Considerations Section in RFCs", BCP 26, 1032 RFC 8126, DOI 10.17487/RFC8126, June 2017, 1033 . 1035 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1036 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1037 . 1039 [RFC8447] Salowey, J. and S. Turner, "IANA Registry Updates for TLS 1040 and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, 1041 . 1043 11.2. Informative References 1045 [I-D.perrin-tls-tack] 1046 Marlinspike, M., "Trust Assertions for Certificate Keys", 1047 draft-perrin-tls-tack-02 (work in progress), January 2013. 1049 [Netcraft] 1050 Mutton, P., "HTTP Public Key Pinning: You're doing it 1051 wrong!", March 2016, 1052 . 1055 [Oreo] Berkman, O., Pinkas, B., and M. Yung, "Firm Grip 1056 Handshakes: A Tool for Bidirectional Vouching", Cryptology 1057 and Network Security, pp. 142-157 , 2012. 1059 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 1060 Hashing for Message Authentication", RFC 2104, 1061 DOI 10.17487/RFC2104, February 1997, 1062 . 1064 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 1065 DOI 10.17487/RFC6454, December 2011, 1066 . 1068 [RFC6962] Laurie, B., Langley, A., and E. Kasper, "Certificate 1069 Transparency", RFC 6962, DOI 10.17487/RFC6962, June 2013, 1070 . 1072 [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an 1073 Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May 1074 2014, . 1076 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 1077 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 1078 2015, . 1080 [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 1081 Suite Value (SCSV) for Preventing Protocol Downgrade 1082 Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, 1083 . 1085 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1086 Code: The Implementation Status Section", BCP 205, 1087 RFC 7942, DOI 10.17487/RFC7942, July 2016, 1088 . 1090 [TLS-EXT] IANA, ., "TLS Extension Type Value", 2018, 1091 . 1095 Appendix A. Document History 1097 A.1. draft-sheffer-tls-pinning-ticket-07 1099 - Refer to published RFCs. 1101 A.2. draft-sheffer-tls-pinning-ticket-06 1103 - IANA Considerations in preparation for Experimental publication. 1105 A.3. draft-sheffer-tls-pinning-ticket-05 1107 - Multiple comments from Eric Rescorla. 1109 A.4. draft-sheffer-tls-pinning-ticket-04 1111 - Editorial changes. 1113 - Two-phase rotation of protection key. 1115 A.5. draft-sheffer-tls-pinning-ticket-03 1117 - Deleted redundant length fields in the extension's formal 1118 definition. 1120 - Modified cryptographic operations to align with the current state 1121 of TLS 1.3. 1123 - Numerous textual improvements. 1125 A.6. draft-sheffer-tls-pinning-ticket-02 1127 - Added an Implementation Status section. 1129 - Added lengths into the extension structure. 1131 - Changed the computation of the pinning proof to be more robust. 1133 - Clarified requirements on the length of the pinning_secret. 1135 - Revamped the HPKP section to be more in line with current 1136 practices, and added recent statistics on HPKP deployment. 1138 A.7. draft-sheffer-tls-pinning-ticket-01 1140 - Corrected the notation for variable-sized vectors. 1142 - Added a section on disaster recovery and backup. 1144 - Added a section on privacy. 1146 - Clarified the assumptions behind the HPKP procedure in the 1147 comparison section. 1149 - Added a definition of pin indexing (origin). 1151 - Adjusted to the latest TLS 1.3 notation. 1153 A.8. draft-sheffer-tls-pinning-ticket-00 1155 Initial version. 1157 Authors' Addresses 1159 Yaron Sheffer 1160 Intuit 1162 EMail: yaronf.ietf@gmail.com 1164 Daniel Migault 1165 Ericsson 1167 EMail: daniel.migault@ericsson.com