Movatterモバイル変換


[0]ホーム

URL:


RFC 8672Pinning with TicketsOctober 2019
Sheffer & MigaultExperimental[Page]
Stream:
Independent Submission
RFC:
8672
Category:
Experimental
Published:
ISSN:
2070-1721
Authors:
Y. Sheffer
Intuit
D. Migault
Ericsson

RFC 8672

TLS Server Identity Pinning with Tickets

Abstract

Misissued public-key certificates can prevent TLS clients from appropriatelyauthenticating the TLS server. Several alternativeshave been proposed to detect this situation and prevent a client from establishinga TLS session with a TLS end point authenticated with an illegitimatepublic-key certificate. These mechanisms are either notwidely deployed or limited to public web browsing.

This document proposes experimental extensions to TLS with opaquepinning tickets as a way to pin the server's identity.During an initial TLS session,the server provides an original encrypted pinning ticket.In subsequent TLS session establishment, upon receipt of the pinning ticket,the server proves its ability to decrypt the pinning ticketand thus the ownership of the pinning protection key.The client can now safely conclude that the TLS session is establishedwith the same TLS server as the original TLS session.One of the important properties of this proposal is thatno manual management actions are required.

Status of This Memo

This document is not an Internet Standards Track specification; it is published for examination, experimental implementation, and evaluation.

This document defines an Experimental Protocol for the Internet community. This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not candidates for any level of Internet Standard; see Section 2 of RFC 7841.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc8672.

Copyright Notice

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.

Table of Contents

1.Introduction

Misissued public-key certificates can prevent TLS[RFC8446] clients fromappropriately authenticating the TLS server. This is a significantrisk in the context of the global public key infrastructure (PKI),and similarly for large-scaledeployments of certificates within enterprises.

This document proposes experimental extensions to TLS with opaquepinning tickets as a way to pin the server's identity. The approachis intended to be easy to implement and deploy, and reuses some ofthe ideas behind TLS session resumption[RFC5077].

Ticket pinning is a second-factor server authentication method and isnot proposed as a substitute for the authentication method provided inthe TLS key exchange. More specifically, the client only uses thepinning identity method after the TLS key exchange is successfullycompleted. In other words, the pinning identity method is onlyperformed over an authenticated TLS session. Note that ticket pinningdoes not pin certificate information and therefore is truly anindependent second-factor authentication.

Ticket pinning is a trust-on-first-use (TOFU) mechanism, in that thefirst server authentication is only based on PKI certificate validation,but for any follow-on sessions, the client is further ensuring theserver's identity based on the server's ability to decrypt the ticket,in addition to normal PKI certificate authentication.

During initial TLS session establishment, the client requests a pinningticket from the server. Upon receiving the request the server generatesa pinning secret that is expected to be unpredictable for peers otherthan the client or the server. In our case, the pinning secret isgenerated from parameters exchanged during the TLS key exchange, soclient and server can generate it locally and independently. The serverconstructs the pinning ticket with the necessary information to retrievethe pinning secret. The server then encrypts the ticket and returns thepinning ticket to the client with an associated pinning lifetime.

The pinning lifetime value indicates for how long the server promises toretain the server-side ticket-encryption key, which allows it tocomplete the protocol exchange correctly and prove its identity. Theserver commitment (and ticket lifetime) is typically on the order ofweeks.

Once the key exchange is completed, and the server is deemedauthenticated, the client generates locally the pinning secret andcaches the server's identifiers to index the pinning secret as well asthe pinning ticket and its associated lifetime.

When the client reestablishes a new TLS session with the server, itsends the pinning ticket to the server. Upon receiving it, the serverreturns a proof of knowledge of the pinning secret. Once the keyexchange is completed, and the server has been authenticated, the clientchecks the pinning proof returned by the server using the client'sstored pinning secret. If the proof matches, the client can concludethat the server to which it is currently connecting is, in fact, the correctserver.

This document only applies to TLS 1.3.We believe that theidea can also be retrofitted into earlier versions of the protocol, butthis would require significant changes.One example is that TLS 1.2[RFC5246] andearlier versions do not provide a generic facility of encryptedhandshake extensions, such as is used here to transport the ticket.

The main advantages of this protocol over earlier pinning solutions are the following:

A note on terminology: unlike other solutions in this space, we do notdo "certificate pinning" (or "public key pinning"), since the protocolis oblivious to the server's certificate. We prefer the term "serveridentity pinning" for this new solution. In our solution, the serverproves its identity by generating a proof that it can read and decryptan encrypted ticket. As a result, the identity proof relies on proof ofownership of the pinning protection key. However, this key is neverexchanged with the client or known by it, and so cannot itself bepinned.

1.1.Conventions Used in This Document

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14[RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.

1.2.Scope of Experimentation

This document describes an experimental extension to the TLS protocol.This section defines constraints on this experiment and how it can yield useful information, potentially resulting in a standard.

The protocol is designed so that if the server does not support it, the client and server fall back to a normal TLS exchange,with the exception of a single PinningTicket extension being initially sent by the client.In addition, the protocol is designed only to strengthen the validation of the server's identity ("second factor").As a result, implementation or even protocol errors should not result inweakened security compared to the normal TLS exchange.Given these two points, experimentation can be run on the open Internet between consenting client and server implementations.

The goal of the experiment is to prove that:

  • Non-supporting clients and servers are unaffected.
  • Connectivity between supporting clients and servers is retained under normal circumstances,whether the client connects to the server frequently (relative to the ticket's lifetime) or very rarely.
  • Enterprise middleboxes do not interrupt such connectivity.
  • Misissued certificates and rogue TLS-aware middleboxes do result in broken connectivity,and these cases are detected on the client and/or server side. Clients and servers can be recoveredeven after such events and the normal connectivity restored.

Following two years of successful deployment, the authors will publish a document that summarizesthe experiment's findings and will resubmit the protocol forconsideration as a Proposed Standard.

2.Protocol Overview

The protocol consists of two phases: the first time a particular clientconnects to a server, and subsequent connections.

This protocol supports full TLS handshakes, as well as 0-RTT handshakes.Below we present it in the context of a full handshake, but behavior in0-RTT handshakes should be identical.

The document presents some similarities with the ticket resumptionmechanism described in[RFC5077]. However the scope of this documentdiffers from session resumption mechanisms implemented with[RFC5077]or with other mechanisms. Specifically, the pinning ticket does notcarry any state associated with a TLS session and thus cannot be usedfor session resumption or client authentication. Instead, thepinning ticket only contains the encrypted pinning secret.The pinning ticket is used by the server to proveits ability to decrypt it, which implies ownership of the pinningprotection key.

[RFC5077] has been obsoleted by[RFC8446], and ticket resumption isnow defined bySection 2.2 of [RFC8446]. This document references[RFC5077] as an informational document since it contains a morethorough discussion of stateless ticket resumption, and becauseticket resumption benefitsfrom significant operational experience with TLS 1.2 that is stillwidely deployed at the time of writing. This experience,as well as deployment experience, can easily be re-used for identity pinning.

With TLS 1.3, session resumption is based on a Pre-Shared Key (PSK).This is orthogonal to this protocol. With TLS 1.3, a TLS session can beestablished using PKI and a pinning ticket, and later resumed with PSK.

However, the protocol described in this document addresses the problemof misissued certificates. Thus, it is not expected to be used outside acertificate-based TLS key exchange, such as in PSK. As a result, PSKhandshakesMUST NOT include the extension defined here.

2.1.Initial Connection

When a client first connects to a server, it requests a pinning ticketby sending an empty PinningTicket extension, and receives it as part ofthe server's first response, in the returned PinningTicket extension.

 Client                                               Server ClientHello   + key_share   + signature_algorithms   + PinningTicket         -------->                                                 ServerHello                                                 + key_share                                       {EncryptedExtensions                                            + PinningTicket}                                       {CertificateRequest*}                                              {Certificate*}                                        {CertificateVerify*}                           <--------              {Finished} {Certificate*} {CertificateVerify*} {Finished}                --------> [Application Data]        <------->      [Application Data]        *  Indicates optional or situation-dependent           messages that are not always sent.        {} Indicates messages protected using keys           derived from the ephemeral secret.        [] Indicates messages protected using keys           derived from the master secret.

If a client supports the PinningTicket extension and does not have anypinning ticket associated with the server, the exchange is considered asan initial connection. Other reasons the client may not have a pinningticket include the client having flushed its pinning ticket store, orthe committed lifetime of the pinning ticket having expired.

Upon receipt of the PinningTicket extension, the server computes apinning secret (Section 4.1) and sends the pinning ticket(Section 4.2) encrypted with the pinning protection key(Section 4.3). The pinning ticket is associated with alifetime value by which the server assumes the responsibility ofretaining the pinning protection key and being able to decrypt incomingpinning tickets during the period indicated by the committed lifetime.

Once the pinning ticket has been generated, the server returns thepinning ticket and the committed lifetime in a PinningTicket extensionembedded in the EncryptedExtensions message. We note that aPinningTicket extensionMUST NOT be sent as part of a HelloRetryRequest.

Upon receiving the pinning ticket, the clientMUST NOT accept it untilthe key exchange is completed and the server authenticated. If the keyexchange is not completed successfully, the clientMUST ignore thereceived pinning ticket. Otherwise, the client computes the pinningsecret andSHOULD cache the pinning secret and the pinning ticket forthe duration indicated by the pinning ticket lifetime. The clientSHOULDclean up the cached values at the end of the indicated lifetime.

2.2.Subsequent Connections

When the client initiates a connection to a server it has previouslyseen (seeSection 2.3 on identifying servers), itSHOULD send thepinning ticket for that server. The pinning ticket, pinning secret, andpinning ticket lifetime computed during the establishment of theprevious TLS session are designated in this document as the "original"ones, to distinguish them from a new ticket that may be generated duringthe current session.

The serverMUST extract the original pinning_secret value from theticket andMUST respond with a PinningTicket extension, which includes:

  • A proof that the server can understand the ticket that was sent by theclient; this proof also binds the pinning ticket to the server's(current) public key, as well as the ongoing TLS session. The proof ismandatory andMUST be included if a pinning ticket was sent by the client.
  • A fresh pinning ticket. The main reason for refreshing the ticket oneach connection is privacy: to avoid the ticket serving as a fixedclient identifier. While a fresh pinning ticket might be of zero length,it isRECOMMENDED to include a fresh ticket with a nonzero length with eachresponse.

If the server cannot validate the received ticket, that might indicatean earlier MITM attack on this client. The serverMUST then abort theconnection with a handshake_failure alert andSHOULD log this failure.

The clientMUST verify the proof, and if it fails to do so, the clientMUST issue ahandshake_failure alert and abort the connection (see alsoSection 6.5). It is important that the client does not attempt to"fall back" by omitting the PinningTicket extension.

When the connection is successfully set up, i.e., after the Finishedmessage is verified, the clientSHOULD store the new ticket along withthe corresponding pinning_secret, replacing the original ticket.

Although this is an extension, if the client already has a ticket for aserver, the clientMUST interpret a missing PinningTicket extension inthe server's response as an attack, because of the server's priorcommitment to respect the ticket. The clientMUST abort the connectionin this case. See alsoSection 5.5 on ramping down support for thisextension.

2.3.Indexing the Pins

Each pin is associated with a set of identifiers that include, amongothers, hostname, protocol (TLS or DTLS), and portnumber. In other words, the pin for port TCP/443 may be different fromthat for DTLS, or from the pin for port TCP/8443. These identifiers areexpected to be relevant to characterize the identity of the server aswell as the establishing TLS session. When a hostname is used, itMUST bethe value sent inside the Server Name Indication (SNI) extension. Thisdefinition is similar to the concept of a Web Origin[RFC6454], but does not assumethe existence of a URL.

The purpose of ticket pinning is to pin the server identity. As aresult, any information orthogonal to the server's identityMUST NOT beconsidered in indexing. More particularly, IP addresses are ephemeraland forbidden in SNI, and therefore pinsMUST NOT be associated with IPaddresses. Similarly, CA names or public keys associated with serverMUST NOT be used for indexing as they may change over time.

3.Message Definitions

This section defines the format of the PinningTicket extension.We follow the message notation of[RFC8446].

 opaque pinning_ticket<0..2^16-1>; opaque pinning_proof<0..2^8-1>; struct {   select (Role) {     case client:       pinning_ticket ticket<0..2^16-1>; //omitted on 1st connection     case server:       pinning_proof proof<0..2^8-1>; //no proof on 1st connection       pinning_ticket ticket<0..2^16-1>; //omitted on ramp down       uint32 lifetime;   }} PinningTicketExtension;
ticket
a pinning ticket sent by the client or returned by the server. Theticket is opaque to the client. The extensionMUST contain exactly 0 or1 tickets.
proof
a demonstration by the server that it understands the received ticketand therefore that it is in possession of the secret that was used togenerate it originally. The extensionMUST contain exactly 0 or 1proofs.
lifetime
the duration (in seconds) that the server commits to accept offeredtickets in the future.

4.Cryptographic Operations

This section provides details on the cryptographic operations performedby the protocol peers.

4.1.Pinning Secret

The pinning secret is generated locally by the client and the server,which means they must use the same inputs to generate it. This valuemust be generated before the ServerHello message is sent, as the serverincludes the corresponding pinning ticket in the same flight as theServerHello message. In addition, the pinning secret must beunpredictable to any party other than the client and the server.

The pinning secret is derived using the Derive-Secret function providedby TLS 1.3, described inSection 7.1 of [RFC8446].

pinning secret = Derive-Secret(Handshake Secret, "pinning secret",         ClientHello...ServerHello)

4.2.Pinning Ticket

The pinning ticket contains the pinning secret. The pinning ticket isprovided by the client to the server, which decrypts it in order toextract the pinning secret and responds with a pinning proof. As aresult, the characteristics of the pinning ticket are:

  • Pinning ticketsMUST be encrypted and integrity-protected using strongcryptographic algorithms.
  • Pinning ticketsMUST be protected with a long-term pinning protectionkey.
  • Pinning ticketsMUST include a pinning protection key ID or serialnumber as to enable the pinning protection key to be refreshed.
  • The pinning ticketMAY include other information, in addition to thepinning secret. When additional information is included, a carefulreview needs to be performed to evaluate its impact on privacy.

The pinning ticket's format is not specified by this document, buta format similar to the one proposed by[RFC5077]isRECOMMENDED.

4.3.Pinning Protection Key

The pinning protection key is used only by the server and so remainsserver implementation specific.[RFC5077] recommends the use of twokeys, but when using Authenticated Encryption with Associated Data (AEAD) algorithms, only a single key is required.

When a single server terminates TLS for multiple virtual servers usingthe SNI mechanism, it is stronglyRECOMMENDED that the server usea separate protection key for each one of them, in order to allowmigrating virtual servers between different servers while keepingpinning active.

As noted inSection 5.1, if the server is actually a cluster ofmachines, the protection keyMUST be synchronized between all the nodesthat accept TLS connections to the same server name. When[RFC5077]is deployed, an easy way to do it is to derive the protection key fromthe session-ticket protection key, which is already synchronized. Forexample:

pinning_protection_key = HKDF-Expand(resumption_protection_key,                              "pinning protection", L)

Where resumption_protection_key is the ticket protection key defined in[RFC5077]. Both resumption_protection_key and pinning_protection_keyare only used by the server.

The above solution attempts to minimize code changes related to management of the resumption_protection_key.The drawback is that this key would be used both to directly encrypt session tickets and to derivethe pinning_protection_key, and such mixed usage of a single key is not in line with cryptographic best practices.Where possible, it isRECOMMENDED that the resumption_protection_key be unrelated to the pinning_protection_key and that they are separately shared among the relevant servers.

4.4.Pinning Proof

The pinning proof is sent by the server to demonstrate that it has beenable to decrypt the pinning ticket and to retrieve the pinning secret. Theproof must be unpredictable and must not be replayed. Similarly to thepinning ticket, the pinning proof is sent by the server in theServerHello message. In addition, it must not be possible for a MITMserver with a fake certificate to obtain a pinning proof from theoriginal server.

In order to address these requirements, the pinning proof is bound tothe TLS session as well as the public key of the server:

pinning_proof_secret=Derive-Secret(Handshake Secret,              "pinning proof 1", ClientHello...ServerHello)proof = HMAC(original_pinning_secret, "pinning proof 2" +             pinning_proof_secret + Hash(server_public_key))

where HMAC[RFC2104] uses the Hash algorithm that was negotiated inthe handshake, and the same hash is also used over the server's publickey. The original_pinning_secret value refers to the secret valueextracted from the ticket sent by the client, to distinguish it from anew pinning secret value that is possibly computed in the currentexchange. The server_public_key value is the DER representation ofthe public key, specifically the SubjectPublicKeyInfo structure as-is.

5.Operational Considerations

The main motivation behind the current protocol is to enable identitypinning without the need for manual operations. Manual operations aresusceptible to human error, and in the case of public key pinning, caneasily result in "server bricking": the server becoming inaccessible tosome or all of its users. To achieve this goal, operations described inidentity pinning are only performed within the current TLS session, andthere is no dependence on any TLS configuration parameters such as CAidentity or public keys. As a result, configuration changes areunlikely to lead to desynchronized state between the client and theserver.

5.1.Protection Key Synchronization

The only operational requirement when deploying this protocol is that, ifthe server is part of a cluster, protection keys (the keys used toencrypt tickets)MUST be synchronized between all cluster members. Theprotocol is designed so that if resumption ticket protection keys[RFC5077] are already synchronized between cluster members, nothingmore needs to be done.

Moreover, synchronization does not need to be instantaneous, e.g.,protection keys can be distributed a few minutes or hours in advance oftheir rollover. In such scenarios, each cluster memberMUST be able toaccept tickets protected with a new version of the protection key, evenwhile it is still using an old version to generate keys. This ensuresthat, when a client receives a "new" ticket, it does not next hit a clustermember that still rejects this ticket.

Misconfiguration can lead to the server's clock being off by a largeamount of time. Consider a case where a server's clock is misconfigured,for example, to be 1 year inthe future, and the system is allowed to delete expired keys automatically.The server will then delete many outstanding keys because they are nowlong expired and will end up rejecting valid tickets that are storedby clients. Such a scenario could make the serverinaccessible to a large number of clients.

The decision to delete a key should at least considerthe largest value of the ticket lifetime as well as the expected timedesynchronization between the servers of the cluster and the timedifference for distributing the new key among the different servers inthe cluster.

5.2.Ticket Lifetime

The lifetime of the ticket is a commitment by the server to retain theticket's corresponding protection key for this duration, so that theserver can prove to the client that it knows the secret embedded in theticket. For production systems, the lifetimeSHOULD be between 7 and 31days.

5.3.Certificate Renewal

The protocol ensures that the client will continue speaking to thecorrect server even when the server's certificate is renewed. In thissense, pinning is not associated with certificates, which is the reason wedesignate the protocol described in this document as "server identitypinning".

Note that this property is not impacted by the use of the server'spublic key in the pinning proof because the scope of the public keyused is only the current TLS session.

5.4.Certificate Revocation

The protocol is orthogonal to certificate validation in the sense that,if the server's certificate has been revoked or is invalid for someother reason, the clientMUST refuse to connect to it regardless of anyticket-related behavior.

5.5.Disabling Pinning

A server implementing this protocolMUST have a "ramp down" mode ofoperation where:

  • The server continues to accept valid pinning tickets and responds correctly with a proof.
  • The server does not send back a new pinning ticket.

After a while, no clients will hold valid tickets, and thefeature may be disabled. Note that clients that do not receive a newpinning ticket do not necessarily need to remove the original ticket.Instead, the client may keep using the ticket until its lifetimeexpires. However, as detailed inSection 6.7, re-use of aticket by the client may result in privacy concerns as the ticket valuemay be used to correlate TLS sessions.

Issuing a new pinning ticket with a shorter lifetime would only delaythe ramp down process, as the shorter lifetime can only affect clientsthat actually initiated a new connection. Other clients would still seethe original lifetime for their pinning tickets.

5.6.Server Compromise

If a server compromise is detected, the pinning protection keyMUST berotated immediately, but the serverMUST still accept valid tickets thatuse the old, compromised key. Clients that still hold old pinningtickets will remain vulnerable to MITM attacks, but those that connectto the correct server will immediately receive new tickets protectedwith the newly generated pinning protection key.

The same procedure applies if the pinning protection key is compromiseddirectly, e.g., if a backup copy is inadvertently made public.

5.7.Disaster Recovery

All web servers in production need to be backed up, so that they can berecovered if a disaster (including a malicious activity) ever wipes themout. Backup often includes the certificate and its private key, whichmust be backed up securely. The pinning secret, including earlierversions that are still being accepted, must be backed up regularly.However since it is only used as an authentication second factor, itdoes not require the same level of confidentiality as the server'sprivate key.

Readers should note that[RFC5077] session resumption keys are moresecurity sensitive and should normally not be backed up, but rathertreated as ephemeral keys. Even when servers derive pinning secrets fromresumption keys (Section 4.1), theyMUST NOT back up resumptionkeys.

6.Security Considerations

This section reviews several security aspects related to the proposedextension.

6.1.Trust-on-First-Use (TOFU) and MITM Attacks

This protocol is a trust-on-first-use protocol. If a client initiallyconnects to the "right" server, it will be protected against MITMattackers for the lifetime of each received ticket. If it connectsregularly (depending, of course, on the server-selected lifetime), it willstay constantly protected against fake certificates.

However if it initially connects to an attacker, subsequent connectionsto the "right" server will fail. Server operators might want to adviseclients on how to remove corrupted pins, once such large-scale attacksare detected and remediated.

The protocol is designed so that it is not vulnerable to an active MITMattacker who has real-time access to the original server. The pinningproof includes a hash of the server's public key to ensure the clientthat the proof was in fact generated by the server with which it isinitiating the connection.

6.2.Pervasive Monitoring

Some organizations, and even some countries, perform pervasive monitoringon their constituents[RFC7258]. This often takes the form ofalways-active SSL proxies. Because of the TOFU property, this protocoldoes not provide any security in such cases.

Pervasive monitoring may also result in privacy concerns detailed inSection 6.7.

6.3.Server-Side Error Detection

Uniquely, this protocol allows the server to detect clients that presentincorrect tickets and therefore can be assumed to be victims of a MITMattack. Server operators can use such cases as indications of ongoingattacks, similarly to fake certificate attacks that took place in a fewcountries in the past.

6.4.Client Policy and SSL Proxies

Like it or not, some clients are normally deployed behind an SSL proxy.Similar to[RFC7469], it is acceptable to allow pinning to bedisabled for some hosts according to local policy. For example,a User Agent (UA)MAYdisable pinning for hosts whose validated certificate chain terminatesat a user-defined trust anchor, rather than a trust anchor built intothe UA (or underlying platform). Moreover, a clientMAY accept an emptyPinningTicket extension from such hosts as a valid response.

6.5.Client-Side Error Behavior

When a client receives a malformed or empty PinningTicket extension froma pinned server, itMUST abort the handshake. If the clientretries the request, itMUST NOT omit thePinningTicket in the retry message. Doing otherwise would expose the client totrivial fallback attacks, similar to those described in[RFC7507].

However, this rule can negatively impact clients that move frombehind SSL proxies into the open Internet, and vice versa, if the adviceinSection 6.4 is not followed. Therefore, it isRECOMMENDED thatbrowser and library vendors provide a documented way to remove storedpins.

6.6.Stolen and Forged Tickets

An attacker gains no benefit from stealing pinning tickets, even in conjunction with other pinningparameters such as the associated pinning secret, since pinning tickets are used to secure the clientrather than the server. Similarly, it is useless to forge a ticket fora particular server.

6.7.Client Privacy

This protocol is designed so that an external attacker cannot link different requests to a single client, provided the clientrequests and receives a fresh ticket upon each connection. This may beof concern particularly during ramp down, if the server does not providea new ticket, and the client reuses the same ticket. To reduce or avoid suchprivacy concerns, it isRECOMMENDED for the server to issue a fresh ticket with areduced lifetime. This would at least reduce the time period in whichthe TLS sessions of the client can be linked. The serverMAY alsoissue tickets with a zero-second lifetime until it is confident alltickets are expired.

On the other hand, the server to which the client is connecting caneasily track the client. This may be an issue when the client expectsto connect to the server (e.g., a mail server) with multiple identities.ImplementationsSHOULD allow the user to opt out of pinning, either ingeneral or for particular servers.

This document does not define the exact content of tickets.Including client-specific information in tickets would raise privacy concernsand isNOT RECOMMENDED.

6.8.Ticket Protection Key Management

While the ticket format is not mandated by this document, protecting the ticket using authenticated encryption isRECOMMENDED. Some of the algorithmscommonly used for authenticated encryption, e.g., Galois/Counter Mode (GCM), are highlyvulnerable to nonce reuse, and this problem is magnified in a clustersetting. Therefore, implementations that choose AES-GCM or any AEADequivalentMUST adoptone of these three alternatives:

  • Partition the nonce namespace between cluster members and use monotoniccounters on each member, e.g., by setting the nonce to the concatenationof the cluster member ID and an incremental counter.
  • Generate random nonces but avoid the so-called birthday bound, i.e.,never generate more than the maximum allowed number of encryptedtickets (2**64 for AES-128-GCM) for the same ticketpinning protection key.
  • An alternative design that has been attributed to Karthik Bhargavan isas follows. Start with a 128-bit master key K_master and then foreach encryption, generate a 256-bit random nonce and compute: K =HKDF(K_master, Nonce || "key"), then N = HKDF(K_master, Nonce ||"nonce"). Use these values to encrypt the ticket, AES-GCM(K, N,data). This nonce should then be stored and transmitted with theticket.

7.IANA Considerations

The IANA has allocated a TicketPinning extension value in the "TLSExtensionType Values" registry.

[RFC8447] defines the procedure, requirements, and the necessaryinformation for the IANA to update the "TLS ExtensionType Values"registry[TLS-EXT]. The registration procedure is "Specification Required"[RFC8126].

The TicketPinning extension is registered as follows. (The extension is not limited to Private Use, and as such has its first byte in the range 0-254.)

Value:
32
Name:
ticket_pinning
Recommended:
No
TLS 1.3:
CH, EE (to indicate that the extension is present in ClientHello and EncryptedExtensions messages)

8.References

8.1.Normative References

[RFC2119]
Bradner, S.,"Key words for use in RFCs to Indicate Requirement Levels",BCP 14,RFC 2119,DOI 10.17487/RFC2119,,<https://www.rfc-editor.org/info/rfc2119>.
[RFC8126]
Cotton, M., Leiba, B., and T. Narten,"Guidelines for Writing an IANA Considerations Section in RFCs",BCP 26,RFC 8126,DOI 10.17487/RFC8126,,<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174]
Leiba, B.,"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words",BCP 14,RFC 8174,DOI 10.17487/RFC8174,,<https://www.rfc-editor.org/info/rfc8174>.
[RFC8446]
Rescorla, E.,"The Transport Layer Security (TLS) Protocol Version 1.3",RFC 8446,DOI 10.17487/RFC8446,,<https://www.rfc-editor.org/info/rfc8446>.
[RFC8447]
Salowey, J. and S. Turner,"IANA Registry Updates for TLS and DTLS",RFC 8447,DOI 10.17487/RFC8447,,<https://www.rfc-editor.org/info/rfc8447>.

8.2.Informative References

[Netcraft]
Mutton, P.,"HTTP Public Key Pinning: You're doing it wrong!",,<https://news.netcraft.com/archives/2016/03/30/http-public-key-pinning-youre-doing-it-wrong.html>.
[Oreo]
Berkman, O., Pinkas, B., and M. Yung,"Firm Grip Handshakes: A Tool for Bidirectional Vouching",Cryptology and Network Security pp. 142-157,.
[RFC2104]
Krawczyk, H., Bellare, M., and R. Canetti,"HMAC: Keyed-Hashing for Message Authentication",RFC 2104,DOI 10.17487/RFC2104,,<https://www.rfc-editor.org/info/rfc2104>.
[RFC5077]
Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig,"Transport Layer Security (TLS) Session Resumption without Server-Side State",RFC 5077,DOI 10.17487/RFC5077,,<https://www.rfc-editor.org/info/rfc5077>.
[RFC5246]
Dierks, T. and E. Rescorla,"The Transport Layer Security (TLS) Protocol Version 1.2",RFC 5246,DOI 10.17487/RFC5246,,<https://www.rfc-editor.org/info/rfc5246>.
[RFC6454]
Barth, A.,"The Web Origin Concept",RFC 6454,DOI 10.17487/RFC6454,,<https://www.rfc-editor.org/info/rfc6454>.
[RFC6962]
Laurie, B., Langley, A., and E. Kasper,"Certificate Transparency",RFC 6962,DOI 10.17487/RFC6962,,<https://www.rfc-editor.org/info/rfc6962>.
[RFC7258]
Farrell, S. and H. Tschofenig,"Pervasive Monitoring Is an Attack",BCP 188,RFC 7258,DOI 10.17487/RFC7258,,<https://www.rfc-editor.org/info/rfc7258>.
[RFC7469]
Evans, C., Palmer, C., and R. Sleevi,"Public Key Pinning Extension for HTTP",RFC 7469,DOI 10.17487/RFC7469,,<https://www.rfc-editor.org/info/rfc7469>.
[RFC7507]
Moeller, B. and A. Langley,"TLS Fallback Signaling Cipher Suite Value (SCSV) for Preventing Protocol Downgrade Attacks",RFC 7507,DOI 10.17487/RFC7507,,<https://www.rfc-editor.org/info/rfc7507>.
[RFC8555]
Barnes, R., Hoffman-Andrews, J., McCarney, D., and J. Kasten,"Automatic Certificate Management Environment (ACME)",RFC 8555,DOI 10.17487/RFC8555,,<https://www.rfc-editor.org/info/rfc8555>.
[TLS-EXT]
IANA,"TLS Extension Type Value",<https://www.iana.org/assignments/tls-extensiontype-values/>.
[TLS-TACK]
Marlinspike, M.,"Trust Assertions for Certificate Keys",Work in Progress,Internet-Draft, draft-perrin-tls-tack-02,,<https://tools.ietf.org/html/draft-perrin-tls-tack-02>.

Appendix A.Previous Work

The global PKI system relies on the trust of a CA issuing certificates.As a result, a corrupted trusted CA may issue a certificate for anyorganization without the organization's approval (a misissued or "fake"certificate), and use the certificate to impersonate the organization.There are many attempts to resolve these weaknesses, including theCertificate Transparency (CT) protocol[RFC6962], HTTP Public Key Pinning (HPKP)[RFC7469], and Trust Assertions for Certificate Keys (TACK)[TLS-TACK].

CT requirescooperation of a large portion of the hundreds of extant certificateauthorities (CAs) before it can be used "for real", in enforcing mode.It is noted that the relevant industry forum (CA/Browser Forum) isindeed pushing for such extensive adoption. However the public nature of CToften makes it inappropriate for enterprise use because many organizationsare not willing to expose their internal infrastructure publicly.

TACK has some similaritiesto the current proposal, but work on it seems to have stalled.Appendix A.2compares our proposal to TACK.

HPKP is an IETF standard, but so far has proven hard to deploy. HPKPpins (fixes) a public key, one of the public keys listed in thecertificate chain. As a result, HPKP needs to be coordinated with thecertificate management process. Certificate management impacts HPKP andthus increases the probability of HPKP failures. This risk is made evenhigher given the fact that, even though work has been done in the Automated Certificate Management Environment (ACME)working group to automate certificate management, in many or even most cases,certificates are still managed manually. As a result, HPKP cannot becompletely automated, resulting in error-prone manual configuration. Sucherrors could prevent the web server from being accessed by some clients.In addition, HPKP uses an HTTP header, which makes this solution HTTPSspecific and not generic to TLS. On the other hand, the current documentprovides a solution that is independent of the server's certificatemanagement, and that can be entirely and easily automated.Appendix A.1compares HPKP to the current document in more detail.

The ticket pinning proposal augments these mechanisms with a much easierto implement and deploy solution for server identity pinning, by reusingsome of the ideas behind TLS session resumption.

This section compares ticket pinning to two earlier proposals, HPKP and TACK.

A.1.Comparison: HPKP

The current IETF standard for pinning the identity of web servers is HPKP[RFC7469].

The main differences between HPKP and the current document are thefollowing:

  • HPKP limits its scope to HTTPS, while the current document considers allapplication above TLS.
  • HPKP pins the public key of the server (or another public key along thecertificate chain), and as such, is highly dependent on the management ofcertificates. Such dependency increases the potential error surface,especially as certificate management is not yet largely automated. Thecurrent proposal, on the other hand, is independent of certificatemanagement.
  • HPKP pins public keys that are public and used for the standard TLSauthentication. Identity pinning relies on the ownership of the pinningkey, which is not disclosed to the public and not involved in thestandard TLS authentication. As a result, identity pinning is acompletely independent, second-factor authentication mechanism.
  • HPKP relies on a backup key to recover the misissuance of a key. Webelieve such backup mechanisms add excessive complexity and cost.Reliability of the current mechanism is primarily based on its beinghighly automated.
  • HPKP relies on the client to report errors to the report-uri. Thecurrent document does not need any out-of-band mechanism, and the server isinformed automatically. This provides an easier and more reliable healthmonitoring.

On the other hand, HPKP shares the following aspects with identity pinning:

  • Both mechanisms provide hard failure. With HPKP, only the client isaware of the failure, while with the current proposal both client andserver are informed of the failure. This provides room for furthermechanisms to automatically recover from such failures.
  • Both mechanisms are subject to a server compromise in which users areprovided with an invalid ticket (e.g., a random one) or HTTP header witha very long lifetime. For identity pinning, this lifetimeSHOULD NOT belonger than 31 days. In both cases, clients will not be able toreconnect the server during this lifetime. With the current proposal,an attacker needs to compromise the TLS layer, while with HPKP, theattacker needs to compromise the HTTP server. Arguably, the TLS-levelcompromise is typically more difficult for the attacker.

Unfortunately HPKP has not seen wide deployment yet. As of March 2016,the number of servers using HPKP was less than 3000[Netcraft]. Thismay simply be due to inertia, but we believe the main reason is theinteractions between HPKP and manual certificate management that isneeded to implement HPKP for enterprise servers. The penalty for makingmistakes (e.g., being too early or too late to deploy new pins) is thatthe server becomes unusable for some of the clients.

To demonstrate this point, we present a list of the steps involved indeploying HPKP on a security-sensitive web server.

  1. Generate two public/private key pairs on a computer that is not thelive server. The second one is the "backup1" key pair.

    openssl genrsa -out "example.com.key" 2048;openssl genrsa -out "example.com.backup1.key" 2048;
  2. Generate hashes for both of the public keys. These will be used inthe HPKP header:

    openssl rsa -in "example.com.key" -outform der -pubout | \openssl dgst -sha256 -binary | openssl enc -base64  openssl rsa -in "example.com.backup1.key" -outform der \-pubout | openssl dgst -sha256 -binary | openssl enc -base64
  3. Generate a single CSR (Certificate Signing Request) for the firstkey pair, where you include the domain name in the CN (Common Name)field:

    openssl req -new -subj "/C=GB/ST=Area/L=Town/O=Org/ \CN=example.com" -key "example.com.key" -out "example.com.csr";
  4. Send this CSR to the CA and go though thedance to prove you own the domain. The CA will give you a singlecertificate that will typically expire within a year or two.
  5. On the live server, upload and set up the first key pair and itscertificate. At this point, you can add the "Public-Key-Pins" header,using the two hashes you created in step 2.

    Note that only the first key pair has been uploaded to the server so far.

  6. Store the second (backup1) key pair somewhere safe, probablysomewhere encrypted like a password manager. It won't expire, as it'sjust a key pair; it just needs to be ready for when you need to get yournext certificate.
  7. Time passes -- probably just under a year (if waiting for acertificate to expire), or maybe sooner if you find that your server hasbeen compromised, and you need to replace the key pair and certificate.
  8. Create a new CSR using the "backup1"key pair, and get a new certificate from your CA.
  9. Generate a new backup key pair (backup2), get its hash, and store itin a safe place (again, not on the live server).
  10. Replace your old certificate and old key pair, update the"Public-Key-Pins" header to remove the old hash, and add the new"backup2" key pair.

Note that in the above steps, both the certificate issuance as well asthe storage of the backup key pair involve manual steps. Even with anautomated CA that runs the ACME protocol[RFC8555], key backup would be achallenge to automate.

A.2.Comparison: TACK

Compared with HPKP, TACK[TLS-TACK] is more similarto the current document. It can even be argued that this document is asymmetric-cryptography variant of TACK. That said, there are still afew significant differences:

  • Probably the most important difference is that with TACK, validation ofthe server certificate is no longer required, and in fact TACK specifiesit as a "MAY" requirement ([TLS-TACK],Section 5.3). With ticket pinning, certificatevalidation by the client remains aMUST requirement, and the ticket actsonly as a second factor. If the pinning secret is compromised, theserver's security is not immediately at risk.
  • Both TACK and the current document are mostly orthogonal to the servercertificate as far as their life cycle, and so both can be deployed withno manual steps.
  • TACK uses Elliptic Curve Digital Signature Algorithm (ECDSA) to sign the server's public key. This allowscooperating clients to share server assertions between themselves. Thisis an optional TACK feature, and one that cannot be done with pinningtickets.
  • TACK allows multiple servers to share its public keys. Such sharing isdisallowed by the current document.
  • TACK does not allow the server to track a particular client, and sohas better privacy properties than the current document.
  • TACK has an interesting way to determine the pin's lifetime, settingit to the time period since the pin was first observed, with a hardupper bound of 30 days. The current document makes the lifetime explicit,which may be more flexible to deploy. For example, web sites that areonly visited rarely by users may opt for a longer period than othersites that expect users to visit on a daily basis.

Acknowledgments

The original idea behind this proposal was published in[Oreo] byMoti Yung, Benny Pinkas, and Omer Berkman. The current protocol isbut a distant relative of the original Oreo protocol, and any errorsare the responsibility of the authors of this document alone.

We would like to thank Adrian Farrel, Dave Garrett,Daniel Kahn Gillmor,Alexey Melnikov,Yoav Nir,Eric Rescorla, Benjamin Kaduk, and Rich Salz for their comments on this document.Special thanks to Craig Francis for contributing the HPKP deploymentscript, and to Ralph Holz for several fruitful discussions.

Authors' Addresses

Yaron Sheffer
Intuit
Email:yaronf.ietf@gmail.com
Daniel Migault
Ericsson
Email:daniel.migault@ericsson.com

[8]ページ先頭

©2009-2025 Movatter.jp