<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
  <!ENTITY RFC5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
  <!ENTITY RFC6347 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6347.xml">
  <!ENTITY RFC7301 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7301.xml">
  <!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
  <!ENTITY RFC8446 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8446.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc category="info" docName="draft-ietf-tls-grease-04" ipr="trust200902">
 <front>
   <title>Applying GREASE to TLS Extensibility</title>

   <author fullname="David Benjamin" initials="D." surname="Benjamin">
     <organization>Google LLC</organization>
     <address>
       <email>davidben@google.com</email>
     </address>
   </author>

   <date year="2019" />
   <area>General</area>

   <abstract>
     <t>This document describes GREASE (Generate Random Extensions And Sustain
     Extensibility), a mechanism to prevent extensibility failures in the TLS
     ecosystem. It reserves a set of TLS protocol values that may be advertised
     to ensure peers correctly handle unknown values.</t>
   </abstract>
 </front>

 <middle>
   <section title="Introduction">
<t>The TLS protocol <xref target="RFC8446" /> includes several points of
extensibility, including the list of cipher suites and several lists of extensions.
The values transmitted in these lists identify implementation capabilities. TLS follows
a model where one side, usually the client, advertises capabilities and the
peer, usually the server, selects them. The responding side must ignore unknown
values so that new capabilities may be introduced to the ecosystem while
maintaining interoperability.</t>

<t>However, bugs may cause an implementation to reject unknown values. It will
interoperate with existing peers, so the mistake may spread through the
ecosystem unnoticed. Later, when new values are defined, updated peers will
discover that the metaphorical joint in the protocol has rusted shut and that
the new values cannot be deployed without interoperability failures.</t>

<t>To avoid this problem, this document reserves some currently unused values for
TLS implementations to advertise at random. Correctly implemented peers will ignore
these values and interoperate. Peers that do not tolerate unknown values will
fail to interoperate, revealing the mistake before it is
widespread.</t>

<t>In keeping with the rusted joint metaphor, this technique is named GREASE
(Generate Random Extensions And Sustain Extensibility).</t>

     <section title="Requirements Language">
       <t>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 <xref target="RFC2119">RFC 2119</xref>[RFC2119] <xref
       target="RFC8174">RFC 8174</xref> when, and only when, they appear
       in all capitals, as shown here.</t>
     </section>
   </section>

   <section title="GREASE Values">
     <t>This document reserves a number of TLS protocol values, referred to as
     GREASE values. These values were allocated sparsely to discourage server
     implementations from conditioning on them. For convenience, they were also
     chosen so all types share a number scheme with a consistent pattern while
     avoiding collisions with any existing applicable registries in TLS.</t>

     <t>RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH. The values prefaced
      with {TBD} are suggested values and subject to change prior to final
      allocation by IANA.</t>

     <t>The following values are reserved as GREASE values for cipher suites
     and ALPN <xref target="RFC7301" /> identifiers:</t>

     <?rfc subcompact="yes" ?>
     <t><list>
         <t>{TBD} {0x0A,0x0A}</t>
         <t>{TBD} {0x1A,0x1A}</t>
         <t>{TBD} {0x2A,0x2A}</t>
         <t>{TBD} {0x3A,0x3A}</t>
         <t>{TBD} {0x4A,0x4A}</t>
         <t>{TBD} {0x5A,0x5A}</t>
         <t>{TBD} {0x6A,0x6A}</t>
         <t>{TBD} {0x7A,0x7A}</t>
         <t>{TBD} {0x8A,0x8A}</t>
         <t>{TBD} {0x9A,0x9A}</t>
         <t>{TBD} {0xAA,0xAA}</t>
         <t>{TBD} {0xBA,0xBA}</t>
         <t>{TBD} {0xCA,0xCA}</t>
         <t>{TBD} {0xDA,0xDA}</t>
         <t>{TBD} {0xEA,0xEA}</t>
         <t>{TBD} {0xFA,0xFA}</t>
       </list></t>
     <?rfc subcompact="no" ?>

     <t>The following values are reserved as GREASE values for extensions,
        named groups, signature algorithms, and versions:</t>

     <?rfc subcompact="yes" ?>
     <t><list>
         <t>{TBD} 0x0A0A</t>
         <t>{TBD} 0x1A1A</t>
         <t>{TBD} 0x2A2A</t>
         <t>{TBD} 0x3A3A</t>
         <t>{TBD} 0x4A4A</t>
         <t>{TBD} 0x5A5A</t>
         <t>{TBD} 0x6A6A</t>
         <t>{TBD} 0x7A7A</t>
         <t>{TBD} 0x8A8A</t>
         <t>{TBD} 0x9A9A</t>
         <t>{TBD} 0xAAAA</t>
         <t>{TBD} 0xBABA</t>
         <t>{TBD} 0xCACA</t>
         <t>{TBD} 0xDADA</t>
         <t>{TBD} 0xEAEA</t>
         <t>{TBD} 0xFAFA</t>
       </list></t>
     <?rfc subcompact="no" ?>

     <t>The values allocated above are thus no longer available for use as TLS or
        DTLS <xref target="RFC6347" /> version numbers.</t>

     <t>The following values are reserved as GREASE values for PskKeyExchangeModes.</t>

     <?rfc subcompact="yes" ?>
     <t><list>
         <t>{TBD} 0x0B</t>
         <t>{TBD} 0x2A</t>
         <t>{TBD} 0x49</t>
         <t>{TBD} 0x68</t>
         <t>{TBD} 0x87</t>
         <t>{TBD} 0xA6</t>
         <t>{TBD} 0xC5</t>
         <t>{TBD} 0xE4</t>
       </list></t>
     <?rfc subcompact="no" ?>
   </section>

<section title="Client-Initiated Extension Points">
   <t>Most extension points in TLS are offered by the client and selected by
the server. This section details client and server behavior around
GREASE values for these.</t>

   <section title="Client Behavior">

     <t>When sending a ClientHello, a client MAY behave as follows:</t>

     <t><list style="symbols">
         <t>A client MAY select one or more GREASE cipher suite values and advertise them in the "cipher_suites" field.</t>
         <t>A client MAY select one or more GREASE extension values and advertise them as extensions with varying length and contents.</t>
         <t>A client MAY select one or more GREASE named group values and advertise them in the "supported_groups" extension, if sent. It MAY also send KeyShareEntry values for a subset of those selected in the "key_share" extension. For each of these, the "key_exchange" field MAY be any value.</t>
         <t>A client MAY select one or more GREASE signature algorithm values and advertise them in the "signature_algorithms" or "signature_algorithms_cert" extensions, if sent.</t>
         <t>A client MAY select one or more GREASE version values and advertise them in the "supported_versions" extension, if sent.</t>
         <t>A client MAY select one or more GREASE PskKeyExchangeMode values and advertise them in the "psk_key_exchange_modes" extension, if sent.</t>
         <t>A client MAY select one or more GREASE ALPN identifiers and advertise them in the "application_layer_protocol_negotiation" extension, if sent.</t>
       </list></t>

     <t>Clients MUST reject GREASE values when negotiated by the server.
In particular, the client MUST fail the connection if a GREASE value appears any
in the following:</t>

     <t><list style="symbols">
         <t>The "version" value in a ServerHello or HelloRetryRequest</t>
         <t>The "cipher_suite" value in a ServerHello</t>
         <t>Any ServerHello extension</t>
         <t>Any HelloRetryRequest, EncryptedExtensions, or Certificate extension in TLS 1.3</t>
         <t>The "namedcurve" value in a ServerKeyExchange for an ECDHE cipher in TLS 1.2 <xref target="RFC5246" /> or earlier</t>
         <t>The signature algorithm in a ServerKeyExchange signature in TLS 1.2 or earlier</t>
         <t>The signature algorithm in a server CertificateVerify signature in TLS 1.3</t>
       </list></t>

     <t>Note that this can be implemented without special processing on the client. The client
     is already required to reject unknown server-selected values, so it
     may leave GREASE values as unknown and reuse the existing logic.</t>
   </section>

   <section title="Server Behavior">
     <t>
When processing a ClientHello, servers MUST NOT treat GREASE values differently from any unknown value.
Servers MUST NOT negotiate any GREASE value when offered in a ClientHello.
Servers MUST correctly ignore unknown values in a ClientHello and attempt to negotiate with one of the remaining parameters.
(There may not be any known parameters remaining, in which case parameter negotiation will fail.)
     </t>

     <t>Note that these requirements are restatements or corollaries of
     existing server requirements in TLS.</t>
   </section>

</section>

<section title="Server-Initiated Extension Points">
   <t>Some extension points are offered by the server and selected by the
client. This section details client and server behavior around GREASE
values for these.</t>

   <section title="Server Behavior">
     <t>When sending a CertificateRequest in TLS 1.3, a server MAY behave as follows:</t>

     <t><list style="symbols">
         <t>A server MAY select one or more GREASE extension values and advertise them as extensions with varying length and contents.</t>
         <t>A server MAY select one or more GREASE signature algorithm values and advertise them in the "signature_algorithms" or "signature_algorithms_cert" extensions, if present.</t>
     </list></t>

     <t>When sending a NewSessionTicket message in TLS 1.3, a server MAY select one or more GREASE extension values and advertise them as extensions with varying length and contents.</t>

     <t>Servers MUST reject GREASE values when negotiated by the client.
In particular, the server MUST fail the connection if a GREASE value appears any
in the following:</t>

     <t><list style="symbols">
         <t>Any Certificate extension in TLS 1.3</t>
         <t>The signature algorithm in a client CertificateVerify signature</t>
       </list></t>

     <t>Note that this can be implemented without special processing on the server. The server
     is already required to reject unknown client-selected values, so it
     may leave GREASE values as unknown and reuse the existing logic.</t>
   </section>

   <section title="Client Behavior">
     <t>
When processing a CertificateRequest or NewSessionTicket, clients MUST NOT treat GREASE values differently from any unknown value.
Clients MUST NOT negotiate any GREASE value when offered by the server.
Clients MUST correctly ignore unknown values offered by the server and attempt to negotiate with one of the remaining parameters.
(There may not be any known parameters remaining, in which case parameter negotiation will fail.)
     </t>

     <t>Note that these requirements are restatements or corollaries of
     existing client requirements in TLS.</t>
   </section>
</section>

<section title="Sending GREASE Values">
  <t>Implementations advertising GREASE values SHOULD select them at random.
This is intended to encourage implementations to ignore all unknown values
rather than any individual value. Implementations MUST honor protocol
specifications when sending GREASE values. For instance, section 4.2 of
<xref target="RFC8446" /> forbids duplicate extension types within a single
extension block. Implementations sending multiple GREASE extensions in a single
block thus must ensure the same value is not selected twice.</t>

  <t>Implementations SHOULD balance diversity in GREASE advertisements with determinism.
  For example, a client which randomly varies GREASE value positions for each
  connection may only fail against a broken server with some probability. This
  risks the failure being masked by automatic retries. A client which positions
  GREASE values deterministically over a period of time (such as a single
  software release) stresses fewer cases but is more likely to detect bugs from
  those cases.</t>
</section>

   <section anchor="IANA" title="IANA Considerations">
     <t>This document updates the TLS Cipher Suite Registry, available from
     <eref target="https://www.iana.org/assignments/tls-parameters"/>:</t>

     <texttable title="Additions to the TLS Cipher Suite Registry">
       <ttcol align='center'>Value</ttcol>
       <ttcol align='center'>Description</ttcol>
       <ttcol align='center'>DTLS-OK</ttcol>
       <ttcol align='center'>Recommended</ttcol>
       <ttcol align='center'>Reference</ttcol>
       <c>{TBD} {0x0A,0x0A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x1A,0x1A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x2A,0x2A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x3A,0x3A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x4A,0x4A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x5A,0x5A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x6A,0x6A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x7A,0x7A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x8A,0x8A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0x9A,0x9A}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0xAA,0xAA}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0xBA,0xBA}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0xCA,0xCA}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0xDA,0xDA}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0xEA,0xEA}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} {0xFA,0xFA}</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
     </texttable>

     <t>RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH. The cipher suite numbers listed in the first column are numbers used for interoperability testing and it's suggested that IANA use these values for assignment.</t>

     <t>This document updates the Supported Groups Registry, available from
<eref target="https://www.iana.org/assignments/tls-parameters"/>:</t>

     <texttable title="Additions to the Supported Groups Registry">
       <ttcol align='center'>Value</ttcol>
       <ttcol align='center'>Description</ttcol>
       <ttcol align='center'>DTLS-OK</ttcol>
       <ttcol align='center'>Recommended</ttcol>
       <ttcol align='center'>Reference</ttcol>
       <c>{TBD} 2570</c>  <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 6682</c>  <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 10794</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 14906</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 19018</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 23130</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 27242</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 31354</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 35466</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 39578</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 43690</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 47802</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 51914</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 56026</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 60138</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 64250</c> <c>Reserved</c> <c>Y</c> <c>N</c> <c>(this document)</c>
     </texttable>

     <t>RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH. The named group numbers listed in the first column are numbers used for interoperability testing and it's suggested that IANA use these values for assignment.</t>

     <t>This document updates the ExtensionType Values registry, available from
<eref target="https://www.iana.org/assignments/tls-extensiontype-values"/>:</t>

     <texttable title="Additions to the ExtensionType Values registry">
       <ttcol align='center'>Value</ttcol>
       <ttcol align='center'>Extension name</ttcol>
       <ttcol align='center'>TLS 1.3</ttcol>
       <ttcol align='center'>Recommended</ttcol>
       <ttcol align='center'>Reference</ttcol>
       <c>{TBD} 2570</c>  <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 6682</c>  <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 10794</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 14906</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 19018</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 23130</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 27242</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 31354</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 35466</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 39578</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 43690</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 47802</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 51914</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 56026</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 60138</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
       <c>{TBD} 64250</c> <c>Reserved</c> <c>CH, CR, NST</c> <c>N</c> <c>(this document)</c>
     </texttable>

     <t>RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH. The extension numbers listed in the first column are numbers used for interoperability testing and it's suggested that IANA use these values for assignment.</t>

     <t>This document updates the TLS Application-Layer Protocol Negotiation
       (ALPN) Protocol IDs registry, available from
       <eref target="https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values"/>:</t>

     <texttable title="Additions to the ALPN Protocol IDs registry">
       <ttcol align='center'>Protocol</ttcol>
       <ttcol align='center'>Identification Sequence</ttcol>
       <ttcol align='center'>Reference</ttcol>
       <c>Reserved</c> <c>{TBD} 0x0A 0x0A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x1A 0x1A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x2A 0x2A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x3A 0x3A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x4A 0x4A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x5A 0x5A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x6A 0x6A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x7A 0x7A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x8A 0x8A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0x9A 0x9A</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0xAA 0xAA</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0xBA 0xBA</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0xCA 0xCA</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0xDA 0xDA</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0xEA 0xEA</c> <c>(this document)</c>
       <c>Reserved</c> <c>{TBD} 0xFA 0xFA</c> <c>(this document)</c>
     </texttable>
   </section>

   <section anchor="Security" title="Security Considerations">
     <t>GREASE values cannot be negotiated, so they do not directly impact the
     security of TLS connections.</t>

     <t>Historically, when interoperability problems arise in deploying new TLS
     features, implementations have used a fallback retry on error with the
     feature disabled. This allows an active attacker to silently disable the
     new feature. By preventing a class of such interoperability problems,
     GREASE reduces the need for this kind of fallback. Implementations SHOULD
     NOT retry with GREASE disabled on connection failure. While allowing an
     attacker to disable GREASE is unlikely to have immediate security
     consequences, such a fallback would prevent GREASE from defending against
     extensibility failures.</t>
     
     <t>If an implementation does not select GREASE values at random it is 
     possible it will allow for fingerprinting of the implementation or 
     perhaps even of individual users. This can result in a negative impact to
     a user's privacy.</t>
   </section>

   <section anchor="Acknowledgments" title="Acknowledgments">
<t>
The author would like to thank Adam Langley, Nick Harper, and Steven Valdez for
their feedback and suggestions. In addition, the rusted joint metaphor is
originally due to Adam Langley.
</t>
   </section>
 </middle>

 <back>
   <references title="Normative References">
     &RFC2119;
     &RFC5246;
     &RFC6347;
     &RFC7301;
     &RFC8174;
     &RFC8446;
   </references>
 </back>
</rfc>
