<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.27 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-tls-subcerts-15" number="9345" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.0 -->
  <front>
    <title>Delegated Credentials for TLS and DTLS</title>
    <seriesInfo name="RFC" value="9345"/>
    <author initials="R." surname="Barnes" fullname="Richard Barnes">
      <organization>Cisco</organization>
      <address>
        <email>rlb@ipv.sx</email>
      </address>
    </author>
    <author initials="S." surname="Iyengar" fullname="Subodh Iyengar">
      <organization>Facebook</organization>
      <address>
        <email>subodh@fb.com</email>
      </address>
    </author>
    <author initials="N." surname="Sullivan" fullname="Nick Sullivan">
      <organization>Cloudflare</organization>
      <address>
        <email>nick@cloudflare.com</email>
      </address>
    </author>
    <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
      <organization>Windy Hill Systems, LLC</organization>
      <address>
        <email>ekr@rtfm.com</email>
      </address>
    </author>
    <date year="2023" month="July"/>
    <area>Security</area>
    <workgroup>tls</workgroup>
<keyword>certificate</keyword>
<keyword>authentication</keyword>
<keyword>TLS 1.3</keyword>
<keyword>signature scheme</keyword>
    <abstract>
      <t>The organizational separation between operators of TLS and DTLS
endpoints and the certification authority can create limitations.  For
example, the lifetime of certificates, how they may be used, and the
algorithms they support are ultimately determined by the
Certification Authority (CA).  This document describes a mechanism
to overcome some of these limitations by enabling operators to
delegate their own credentials for use in TLS and DTLS without breaking
compatibility with peers that do not support this specification.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>Server operators often deploy (D)TLS termination to act as the server for
inbound TLS connections.  These termination services can be in locations such
as remote data centers or Content Delivery Networks (CDNs) where it may
be difficult to detect compromises of private key material corresponding
to TLS certificates.  Short-lived certificates may be
used to limit the exposure of keys in these cases.</t>
      <t>However, short-lived certificates need to be renewed more frequently than
long-lived certificates.  If an external Certification Authority (CA) is unable to issue a certificate in
time to replace a deployed certificate, the server would no longer be able to
present a valid certificate to clients.  With short-lived certificates, there is
a smaller window of time to renew a certificate and therefore a higher risk that
an outage at a CA will negatively affect the uptime of the TLS-fronted service.</t>
      <t>Typically, a (D)TLS server uses a certificate provided by some entity other than
the operator of the server (a CA) <xref target="RFC8446"/>
        <xref target="RFC5280"/>.  This organizational separation makes the (D)TLS server operator
dependent on the CA for some aspects of its operations. For example:</t>
      <ul spacing="normal">
        <li>Whenever the server operator wants to deploy a new certificate, it has to
interact with the CA.</li>
        <li>The CA might only issue credentials containing certain types of public keys,
which can limit the set of (D)TLS signature schemes usable by the server
operator.</li>
      </ul>
      <t>To reduce the dependency on external CAs, this document specifies a limited delegation
mechanism that allows a (D)TLS peer to issue its own credentials within
the scope of a certificate issued by an external CA.  These credentials only enable the
recipient of the delegation to terminate connections for names that the CA has authorized.  Furthermore,
this mechanism allows the server to use modern signature algorithms such as
Ed25519 <xref target="RFC8032"/> even if their CA does not support them.</t>
      <t>This document refers to the certificate issued by the CA as a "certificate",
or "delegation certificate", and the one issued by the operator as a "delegated
credential" or "DC".</t>
    </section>
    <section anchor="conventions-and-terminology">
      <name>Conventions and Terminology</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
    </section>
    <section anchor="solution-overview">
      <name>Solution Overview</name>
      <t>A delegated credential (DC) is a digitally signed data structure with two semantic
fields: a validity interval and a public key (along with its associated
signature algorithm).  The signature on the delegated credential indicates a delegation
from the certificate that is issued to the peer.  The private key
used to sign a credential corresponds to the public key of the peer's
X.509 end-entity certificate <xref target="RFC5280"/>. <xref target="fig1"/> shows the intended deployment architecture.</t>
 <figure anchor="fig1" title="Delegated Credentials Deployment Architecture">
      <artwork><![CDATA[
Client            Front-End            Back-End
  |                   |<--DC distribution->|
  |----ClientHello--->|                    |
  |<---ServerHello----|                    |
  |<---Certificate----|                    |
  |<---CertVerify-----|                    |
  |        ...        |                    |

Legend:
Client: (D)TLS client
Front-End: (D)TLS server (could be a TLS-termination service like a CDN)
Back-End: Service with access to a private key
]]></artwork></figure>
      <t>A (D)TLS handshake that uses delegated credentials differs from a standard handshake
in a few important ways:</t>
      <ul spacing="normal">
        <li>The initiating peer provides an extension in its ClientHello or CertificateRequest
that indicates support for this mechanism.</li>
        <li>The peer sending the Certificate message provides both the certificate
chain terminating in its certificate and the delegated credential.</li>
        <li>The initiator uses information from the peer's certificate
to verify the delegated credential and that the peer is asserting an
expected identity, determining an authentication result for the peer.</li>
        <li>Peers accepting the delegated credential use it as the certificate
key for the (D)TLS handshake.</li>
      </ul>
      <t>As detailed in <xref target="delegated-credentials"/>, the delegated credential is
cryptographically bound to the end-entity certificate with which the
credential may be used.  This document specifies the use of delegated
credentials in (D)TLS 1.3 or later; their use in prior versions of the
protocol is not allowed.</t>
      <t>Delegated credentials allow a peer to terminate (D)TLS connections on behalf of
the certificate owner.  If a credential is stolen, there is no mechanism for
revoking it without revoking the certificate itself.  To limit exposure in case
of the compromise of a delegated credential's private key, delegated credentials
have a maximum validity period.  In the absence of an application profile standard
specifying otherwise, the maximum validity period is set to 7 days.  Peers <bcp14>MUST NOT</bcp14> issue credentials with a validity period longer than the maximum validity period or that extends beyond the validity period of the delegation certificate.
This mechanism is described in detail in <xref target="client-and-server-behavior"/>.</t>
      <t>It was noted in <xref target="XPROT"/> that certificates in use by servers that
support outdated protocols such as SSLv2 can be used to forge
signatures for certificates that contain the keyEncipherment KeyUsage
(<xref section="4.2.1.3" sectionFormat="comma" target="RFC5280"/>).  In order to reduce the risk of cross-
protocol attacks on certificates that are not intended to be used
with DC-capable TLS stacks, we define a new DelegationUsage
extension to X.509 that permits use of delegated credentials.  (See <xref target="certificate-requirements"/>.)</t>
      <section anchor="rationale">
        <name>Rationale</name>
        <t>Delegated credentials present a better alternative than other delegation
mechanisms like proxy certificates <xref target="RFC3820"/> for several reasons:</t>
        <ul spacing="normal">
          <li>There is no change needed to certificate validation at the PKI layer.</li>
          <li>X.509 semantics are very rich.  This can cause unintended
consequences if a service owner creates a proxy certificate where
the properties differ from the leaf certificate.  Proxy certificates can
be useful in controlled environments, but remain a risk in scenarios
where the additional flexibility they provide is not necessary.  For
this reason,  delegated credentials have very restricted semantics
that should not conflict with X.509 semantics.</li>
          <li>Proxy certificates rely on the certificate path building process to establish
a binding between the proxy certificate and the end-entity certificate.  Since
the certificate path building process is not cryptographically protected, it is
possible that a proxy certificate could be bound to another certificate with
the same public key, with different X.509 parameters.  Delegated credentials,
which rely on a cryptographic binding between the entire certificate and the
delegated credential, cannot.</li>
          <li>Each delegated credential is bound to a specific signature algorithm for use
in the (D)TLS handshake (<xref section="4.2.3" sectionFormat="comma" target="RFC8446"/>).  This prevents
them from being used with other, perhaps unintended, signature algorithms.
The signature algorithm bound to the delegated credential can be chosen
independently of the set of signature algorithms supported by the end-entity
certificate.</li>
        </ul>
      </section>
      <section anchor="related-work">
        <name>Related Work</name>
        <t>Many of the use cases for delegated credentials can also be addressed using
purely server-side mechanisms that do not require changes to client behavior
(e.g., a PKCS#11 interface or a remote signing mechanism, <xref target="KEYLESS"/> being one
example).  These
mechanisms, however, incur per-transaction latency, since the front-end
server has to interact with a back-end server that holds a private key.  The
mechanism proposed in this document allows the delegation to be done
offline, with no per-transaction latency.  The figure below compares the
message flows for these two mechanisms
with (D)TLS 1.3 <xref target="RFC8446"/> <xref target="RFC9147"/>.</t>
        <artwork><![CDATA[
Remote key signing:

Client            Front-End            Back-End
  |----ClientHello--->|                    |
  |<---ServerHello----|                    |
  |<---Certificate----|                    |
  |                   |<---remote sign---->|
  |<---CertVerify-----|                    |
  |        ...        |                    |


Delegated Credential:

Client            Front-End            Back-End
  |                   |<--DC distribution->|
  |----ClientHello--->|                    |
  |<---ServerHello----|                    |
  |<---Certificate----|                    |
  |<---CertVerify-----|                    |
  |        ...        |                    |

Legend:
Client: (D)TLS client
Front-End: (D)TLS server (could be a TLS-termination service like a CDN)
Back-End: Service with access to a private key
]]></artwork>
        <t>These two mechanisms can be complementary.  A server could use
delegated credentials for clients that support them, while using a
server-side mechanism to support legacy clients.  Both mechanisms
require a trusted relationship between the front-end and back-end --
the delegated credential can be used in place of a certificate
private key.</t>
        <t>The use of short-lived certificates with automated certificate issuance,
e.g., with the Automated Certificate Management Environment (ACME) <xref target="RFC8555"/>,
reduces the risk of key compromise but has several limitations.
Specifically, it introduces an operationally critical dependency on an
external party (the CA).  It also
limits the types of algorithms supported for (D)TLS authentication to those
the CA is willing to issue a certificate for.  Nonetheless, existing
automated issuance APIs like ACME may be useful for provisioning delegated credentials.</t>
      </section>
    </section>
    <section anchor="delegated-credentials">
      <name>Delegated Credentials</name>
      <t>While X.509 forbids end-entity certificates from being used as issuers for
other certificates, it is valid to use them to issue other signed
objects as long as the certificate contains the digitalSignature KeyUsage
(<xref section="4.2.1.3" sectionFormat="comma" target="RFC5280"/>).  (All certificates compatible with TLS 1.3 are
required to contain the digitalSignature KeyUsage.)  This document defines a new signed
object format that encodes only the semantics that are needed for this
application.  The Credential has the following structure:</t>
      <artwork><![CDATA[
   struct {
     uint32 valid_time;
     SignatureScheme dc_cert_verify_algorithm;
     opaque ASN1_subjectPublicKeyInfo<1..2^24-1>;
   } Credential;
]]></artwork>
      <dl>
        <dt>valid_time:</dt>
        <dd>
          <t>Time, in seconds relative to the delegation certificate's
notBefore value, after which the delegated credential is no longer valid.
By default, unless set to an alternative value by an application profile (see
<xref target="solution-overview"/>), endpoints will reject delegated credentials that expire more than 7
days from the current time (as described in <xref target="validating-a-delegated-credential"/>).</t>
        </dd>
        <dt>dc_cert_verify_algorithm:</dt>
        <dd>
          <t>The signature algorithm of the Credential key pair, where the type
SignatureScheme is as defined in <xref target="RFC8446"/>. This is expected to be
the same as the sender's CertificateVerify.algorithm (as described in <xref target="validating-a-delegated-credential"/>).<br/>
When
using RSA, the public key <bcp14>MUST NOT</bcp14> use the rsaEncryption OID.  As a result,
the following algorithms are not allowed for use with delegated credentials:
rsa_pss_rsae_sha256, rsa_pss_rsae_sha384, and rsa_pss_rsae_sha512.</t>
        </dd>
        <dt>ASN1_subjectPublicKeyInfo:</dt>
        <dd>
          <t>The Credential's public key, a DER-encoded <xref target="X.690"/> SubjectPublicKeyInfo as defined in
<xref target="RFC5280"/>.</t>
        </dd>
      </dl>
      <t>The DelegatedCredential has the following structure:</t>
      <artwork><![CDATA[
   struct {
     Credential cred;
     SignatureScheme algorithm;
     opaque signature<1..2^16-1>;
   } DelegatedCredential;
]]></artwork>
      <dl>
        <dt>cred:</dt>
        <dd>
          <t>The Credential structure as previously defined.</t>
        </dd>
        <dt>algorithm:</dt>
        <dd>
          <t>The signature algorithm used to create DelegatedCredential.signature.</t>
        </dd>
        <dt>signature:</dt>
        <dd>
          <t>The delegation, a signature that binds the credential to the end-entity
certificate's public key as specified below. The signature scheme is specified
by DelegatedCredential.algorithm.</t>
        </dd>
      </dl>
      <t>The signature of the DelegatedCredential is computed over the concatenation of:</t>
      <ol spacing="normal" type="1"><li>An octet stream that consists of octet 32 (0x20) repeated 64 times.</li>
        <li>The non-null terminated context string "TLS, server delegated credentials" for server authentication and "TLS, client delegated credentials" for client authentication.</li>
        <li>A single octet 0x00, which serves as the separator.</li>
        <li>The DER-encoded X.509 end-entity certificate used to sign the
DelegatedCredential.</li>
        <li>DelegatedCredential.cred.</li>
        <li>DelegatedCredential.algorithm.</li>
      </ol>
      <t>The signature is computed by using the private key of the peer's end-entity
certificate, with the algorithm indicated by DelegatedCredential.algorithm.</t>
      <t>The signature effectively binds the credential to the parameters of the
handshake in which it is used.  In particular, it ensures that credentials are
only used with the certificate and signature algorithm chosen by the
delegator.</t>
      <t>The code changes required in order to create and verify delegated credentials,
and the implementation complexity this entails, are localized to the (D)TLS
stack.  This has the advantage of avoiding changes to the often-delicate
security-critical PKI code.</t>
      <section anchor="client-and-server-behavior">
        <name>Client and Server Behavior</name>
        <t>This document defines the following (D)TLS extension code point.</t>
        <artwork><![CDATA[
   enum {
     ...
     delegated_credential(34),
     (65535)
   } ExtensionType;
]]></artwork>
        <section anchor="server-authentication">
          <name>Server Authentication</name>
          <t>A client that is willing to use delegated credentials in a connection <bcp14>SHALL</bcp14> send a
"delegated_credential" extension in its ClientHello. The body of the extension
consists of a SignatureSchemeList (defined in <xref target="RFC8446"/>):</t>
          <artwork><![CDATA[
   struct {
     SignatureScheme supported_signature_algorithms<2..2^16-2>;
   } SignatureSchemeList;
]]></artwork>
          <t>If the client receives a delegated credential without having indicated support
in its ClientHello,
then the client <bcp14>MUST</bcp14> abort the handshake with an "unexpected_message" alert.</t>
          <t>If the extension is present, the server <bcp14>MAY</bcp14> send a delegated credential; if the
extension is not present, the server <bcp14>MUST NOT</bcp14> send a delegated credential.
When a (D)TLS version negotiated is less than 1.3, the server <bcp14>MUST</bcp14> ignore this extension.
An example of when a server could choose not to send a delegated
credential is when the SignatureSchemes listed only contain signature schemes
for which a corresponding delegated credential does not exist or are
otherwise unsuitable for the connection.</t>
          <t>The server <bcp14>MUST</bcp14> send the delegated credential as an extension in the
CertificateEntry of its end-entity certificate; the client <bcp14>MUST NOT</bcp14> use
delegated credentials sent as extensions to any other certificate, and <bcp14>SHOULD</bcp14> ignore them, but <bcp14>MAY</bcp14> abort the handshake with
an "illegal_parameter" alert.  If the server sends multiple delegated
credentials extensions in a single CertificateEntry, the client <bcp14>MUST</bcp14>
abort the handshake with an "illegal_parameter" alert.</t>
          <t>The algorithm field <bcp14>MUST</bcp14> be of a type advertised by the client in the
"signature_algorithms" extension of the ClientHello message, and
the dc_cert_verify_algorithm field <bcp14>MUST</bcp14> be of a
type advertised by the client in the SignatureSchemeList; otherwise, the credential is
considered not valid.  Clients that receive non-valid delegated
credentials <bcp14>MUST</bcp14> terminate the connection with an "illegal_parameter"
alert.</t>
        </section>
        <section anchor="client-authentication">
          <name>Client Authentication</name>
          <t>A server that supports this specification <bcp14>SHALL</bcp14> send a
"delegated_credential" extension in the CertificateRequest message
when requesting client authentication. The body of the
extension consists of a SignatureSchemeList. If the server receives a
delegated credential without having indicated support in its
CertificateRequest, then the server <bcp14>MUST</bcp14> abort with an
"unexpected_message" alert.</t>
          <t>If the extension is present, the client <bcp14>MAY</bcp14> send a delegated credential; if the
extension is not present, the client <bcp14>MUST NOT</bcp14> send a delegated credential.
When a (D)TLS version negotiated is less than 1.3, the client <bcp14>MUST</bcp14> ignore this extension.</t>
          <t>The client <bcp14>MUST</bcp14> send the delegated credential as an extension in the CertificateEntry of its end-entity certificate; the server
<bcp14>MUST NOT</bcp14> use delegated credentials sent as extensions to any other certificate, and <bcp14>SHOULD</bcp14> ignore them, but <bcp14>MAY</bcp14> abort the handshake with an "illegal_parameter" alert.  If the client sends multiple delegated credentials extensions in a single CertificateEntry, the server <bcp14>MUST</bcp14> abort the handshake with an "illegal_parameter" alert.</t>
          <t>The algorithm field <bcp14>MUST</bcp14> be of a type advertised by the server
in the "signature_algorithms" extension of the CertificateRequest message,
and the dc_cert_verify_algorithm field <bcp14>MUST</bcp14> be of a type
advertised by the server in the SignatureSchemeList; otherwise, the credential is
considered not valid. Servers that receive non-valid
delegated credentials <bcp14>MUST</bcp14> terminate the connection with an
"illegal_parameter" alert.</t>
        </section>
        <section anchor="validating-a-delegated-credential">
          <name>Validating a Delegated Credential</name>
          <t>On receiving a delegated credential and certificate chain, the peer validates
the certificate chain and matches the end-entity certificate to the peer's
expected identity in the same way that it is done when delegated credentials are
not in use. It then performs the following checks with expiry time set to the
delegation certificate's notBefore value plus DelegatedCredential.cred.valid_time:</t>
          <ol spacing="normal" type="1"><li>Verify that the current time is within the validity interval of the
credential. This is done by asserting that the current time does not exceed
the expiry time.  (The start time of the credential is implicitly validated
as part of certificate validation.)</li>
            <li>Verify that the delegated credential's remaining validity period is no more
than the maximum validity period. This is done by asserting that the expiry
time does not exceed the current time plus the maximum validity period (7
days by default) and that the expiry time is less than the certificate's expiry_time.</li>
            <li>Verify that dc_cert_verify_algorithm matches
the scheme indicated in the peer's CertificateVerify message and that the
algorithm is allowed for use with delegated credentials.</li>
            <li>Verify that the end-entity certificate satisfies the conditions described in
<xref target="certificate-requirements"/>.</li>
            <li>Use the public key in the peer's end-entity certificate to verify the
signature of the credential using the algorithm indicated by
DelegatedCredential.algorithm.</li>
          </ol>
          <t>If one or more of these checks fail, then the delegated credential is deemed
not valid.  Clients and servers that receive non-valid delegated credentials <bcp14>MUST</bcp14> terminate the
connection with an "illegal_parameter" alert.</t>
          <t>If successful, the participant receiving the Certificate message uses the public
key in DelegatedCredential.cred to verify the signature in the peer's
CertificateVerify message.</t>
        </section>
      </section>
      <section anchor="certificate-requirements">
        <name>Certificate Requirements</name>
        <t>This document defines a new X.509 extension, DelegationUsage, to be used in the certificate
when the certificate permits the usage of delegated credentials.  What follows
is the ASN.1 <xref target="X.680"/> for the DelegationUsage certificate extension.</t>
        <artwork><![CDATA[
    ext-delegationUsage EXTENSION  ::= {
        SYNTAX DelegationUsage IDENTIFIED BY id-pe-delegationUsage
    }

    DelegationUsage ::= NULL

    id-pe-delegationUsage OBJECT IDENTIFIER ::=
        { iso(1) identified-organization(3) dod(6) internet(1)
          private(4) enterprise(1) id-cloudflare(44363) 44 }
]]></artwork>
        <t>The extension <bcp14>MUST</bcp14> be marked non-critical.  (See <xref section="4.2" sectionFormat="of" target="RFC5280"/>.)
An endpoint <bcp14>MUST NOT</bcp14> accept a delegated credential unless the peer's end-entity
certificate satisfies the following criteria:</t>
        <ul spacing="normal">
          <li>It has the DelegationUsage extension.</li>
          <li>It has the digitalSignature KeyUsage (see the KeyUsage extension defined in
<xref target="RFC5280"/>).</li>
        </ul>
        <t>A new extension was chosen instead of adding a new Extended Key Usage
(EKU) to be compatible with deployed (D)TLS and PKI software stacks
without requiring CAs to issue new intermediate certificates.</t>
      </section>
    </section>
    <section anchor="operational-considerations">
      <name>Operational Considerations</name>
      <t>The operational considerations documented in this section should be
taken into consideration when using delegated credentials.</t>
      <section anchor="client-clock-skew">
        <name>Client Clock Skew</name>
        <t>One of the risks of deploying a short-lived credential system based
on absolute time is client clock skew.  If a client's clock is sufficiently
ahead of or behind the server's clock, then clients will reject delegated credentials
that are valid from the server's perspective.  Clock
skew also affects the validity of the original certificates.  The lifetime
of the delegated credential should be set taking clock skew into account.
Clock skew may affect a delegated credential at the beginning and end of
its validity periods, which should also be taken into account.</t>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document registers the "delegated_credential" extension in the
"TLS ExtensionType Values" registry.  The "delegated_credential"
extension has been assigned the ExtensionType value 34.  The IANA registry
lists this extension as "Recommended" (i.e., "Y") and indicates that
it may appear in the ClientHello (CH), CertificateRequest (CR),
or Certificate (CT) messages in (D)TLS 1.3 <xref target="RFC8446"/> <xref target="RFC9147"/>.
Additionally, the "DTLS-Only" column is assigned the value "N".</t>
      <t>This document also defines an ASN.1 module for the DelegationUsage
certificate extension in <xref target="module"/>.  IANA has registered value 95 for
"id-mod-delegated-credential-extn" in the "SMI Security for PKIX Module
Identifier" (1.3.6.1.5.5.7.0) registry.  An OID for the DelegationUsage certificate extension
is not needed, as it is already assigned to the extension from
Cloudflare's IANA Private Enterprise Number (PEN) arc.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>The security considerations documented in this section should be
taken into consideration when using delegated credentials.</t>
      <section anchor="security-of-delegated-credentials-private-key">
        <name>Security of Delegated Credential's Private Key</name>
        <t>Delegated credentials limit the exposure of the private key used in
a (D)TLS connection by limiting its validity period.  An attacker who
compromises the private key of a delegated credential
cannot create new delegated credentials, but they can
impersonate the compromised party in new TLS connections until the
delegated credential expires.</t>
        <t>Thus, delegated credentials should not be used to send a delegation to an untrusted party. Rather, they
are meant to be used between parties that have some trust relationship with each
other.  The secrecy of the delegated credential's private key is thus important, and
access control mechanisms <bcp14>SHOULD</bcp14> be used to protect it, including file system
controls, physical security, or hardware security modules.</t>
      </section>
      <section anchor="re-use-of-delegated-credentials-in-multiple-contexts">
        <name>Re-use of Delegated Credentials in Multiple Contexts</name>
        <t>It is not possible to use the same delegated credential for both client and server
authentication because issuing parties compute the corresponding signature using a context string unique to the intended role (client or server).</t>
      </section>
      <section anchor="revocation-of-delegated-credentials">
        <name>Revocation of Delegated Credentials</name>
        <t>Delegated credentials do not provide any additional form of early revocation.
Since it is short-lived, the expiry of the delegated credential revokes
the credential.  Revocation of the long-term private key that signs the
delegated credential (from the end-entity certificate) also implicitly revokes
the delegated credential.</t>
      </section>
      <section anchor="interactions-with-session-resumption">
        <name>Interactions with Session Resumption</name>
        <t>If a peer decides to cache the certificate chain and re-validate it
when resuming a connection, they <bcp14>SHOULD</bcp14> also cache the
associated delegated credential and re-validate it.  Failing to do so
may result in resuming connections for which the delegated credential has expired.</t>
      </section>
      <section anchor="privacy-considerations">
        <name>Privacy Considerations</name>
        <t>Delegated credentials can be valid for 7 days (by default), and it is much easier for a service to create delegated credentials than a certificate signed by a CA. A service could determine the client time and clock skew by creating several delegated credentials with different expiry timestamps and observing which credentials the client accepts. Since client time can be unique to a particular client, privacy-sensitive clients who do not trust the service, such as browsers in incognito mode, might not want to advertise support for delegated credentials, or might limit the number of probes that a server can perform.</t>
      </section>
      <section anchor="the-impact-of-signature-forgery-attacks">
        <name>The Impact of Signature Forgery Attacks</name>
        <t>Delegated credentials are only used in (D)TLS 1.3 connections. However, the certificate
that signs a delegated credential may be used in other contexts such as (D)TLS 1.2.
Using a certificate in multiple contexts opens up a potential cross-protocol
attack against delegated credentials in (D)TLS 1.3.</t>
        <t>When (D)TLS 1.2 servers support RSA key exchange, they may be vulnerable to attacks
that allow forging an RSA signature over an arbitrary message <xref target="BLEI"/>.
The TLS 1.2 specification describes a strategy for preventing these attacks
 that requires careful implementation of timing-resistant countermeasures.
(See <xref section="7.4.7.1" sectionFormat="of" target="RFC5246"/>.)</t>
        <t>Experience shows that, in practice, server implementations may fail to fully
stop these attacks due to the complexity of this mitigation <xref target="ROBOT"/>.
For (D)TLS 1.2 servers that support RSA key exchange using a DC-enabled end-entity
certificate, a hypothetical signature forgery attack would allow forging a
signature over a delegated credential.
The forged delegated credential could then be used by the attacker as the equivalent of an
on-path attacker, valid for a maximum of 7 days (if the default
valid_time is used).</t>
        <t>Server operators should therefore minimize the risk of using DC-enabled
end-entity certificates where a signature forgery oracle may be present.
If possible, server operators may choose to use DC-enabled certificates only for signing
credentials and not for serving non-DC (D)TLS traffic.
Furthermore, server operators may use elliptic curve certificates for DC-enabled
traffic, while using RSA certificates without the DelegationUsage certificate
extension for non-DC traffic; this completely prevents such attacks.</t>
        <t>Note that if a signature can be forged over an arbitrary credential, the
attacker can choose any value for the valid_time field.  Repeated signature
forgeries therefore allow the attacker to create multiple delegated
credentials that can cover the entire validity period of the
certificate.  Temporary exposure of the key or a signing oracle may
allow the attacker to impersonate a server for the lifetime of the certificate.</t>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="X.680" target="https://www.itu.int/rec/T-REC-X.680">
          <front>
            <title>Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation</title>
            <author>
              <organization>ITU-T</organization>
            </author>
            <date year="2021" month="February"/>
          </front>
          <seriesInfo name="ISO/IEC" value="8824-1:2021"/>
        </reference>
        <reference anchor="X.690" target="https://www.itu.int/rec/T-REC-X.690">
          <front>
            <title>Information technology - ASN.1 encoding Rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)</title>
            <author>
              <organization>ITU-T</organization>
            </author>
            <date year="2021" month="February"/>
          </front>
          <seriesInfo name="ISO/IEC" value="8825-1:2021"/>
        </reference>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9147.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="XPROT" target="https://dl.acm.org/doi/10.1145/2810103.2813657">
          <front>
            <title>On the Security of TLS 1.3 and QUIC Against Weaknesses in PKCS#1 v1.5 Encryption</title>
            <author initials="T." surname="Jager">
              <organization/>
            </author>
            <author initials="J." surname="Schwenk">
              <organization/>
            </author>
            <author initials="J." surname="Somorovsky">
              <organization/>
            </author>
            <date year="2015"/>
          </front>
          <refcontent>Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security</refcontent>
        </reference>
        <reference anchor="KEYLESS" target="https://ieeexplore.ieee.org/document/7345293">
          <front>
            <title>An Analysis of TLS Handshake Proxying</title>
            <author initials="D." surname="Stebila">
              <organization/>
            </author>
            <author initials="N." surname="Sullivan">
              <organization/>
            </author>
            <date year="2015"/>
          </front>
          <refcontent>IEEE Trustcom/BigDataSE/ISPA 2015</refcontent>
        </reference>
        <reference anchor="BLEI" target="https://link.springer.com/chapter/10.1007/BFb0055716">
          <front>
            <title>Chosen Ciphertext Attacks against Protocols Based on RSA Encryption Standard PKCS #1</title>
            <author initials="D." surname="Bleichenbacher">
              <organization/>
            </author>
            <date year="1998"/>
          </front>
          <refcontent>Advances in Cryptology -- CRYPTO'98, LNCS vol. 1462, pages: 1-12</refcontent>
        </reference>
        <reference anchor="ROBOT" target="https://www.usenix.org/conference/usenixsecurity18/presentation/bock">
          <front>
            <title>Return Of Bleichenbacher's Oracle Threat (ROBOT)</title>
            <author initials="H." surname="Boeck">
              <organization/>
            </author>
            <author initials="J." surname="Somorovsky">
              <organization/>
            </author>
            <author initials="C." surname="Young">
              <organization/>
            </author>
            <date year="2018"/>
          </front>
          <refcontent>27th USENIX Security Symposium</refcontent>
        </reference>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8032.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3820.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8555.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5912.xml"/>
      </references>
    </references>
    <section anchor="module">
      <name>ASN.1 Module</name>
      <t>The following ASN.1 module provides the complete definition of the
DelegationUsage certificate extension.  The ASN.1 module makes imports
from <xref target="RFC5912"/>.</t>
      <artwork><![CDATA[
DelegatedCredentialExtn
  { iso(1) identified-organization(3) dod(6) internet(1)
    security(5) mechanisms(5) pkix(7) id-mod(0)
    id-mod-delegated-credential-extn(95) }

DEFINITIONS IMPLICIT TAGS ::=
BEGIN

-- EXPORT ALL

IMPORTS

EXTENSION
  FROM PKIX-CommonTypes-2009 -- From RFC 5912
  { iso(1) identified-organization(3) dod(6) internet(1)
    security(5) mechanisms(5) pkix(7) id-mod(0)
    id-mod-pkixCommon-02(57) } ;

-- OID

id-cloudflare OBJECT IDENTIFIER ::=
  { iso(1) identified-organization(3) dod(6) internet(1) private(4)
    enterprise(1) 44363 }

-- EXTENSION

ext-delegationUsage EXTENSION ::=
  { SYNTAX DelegationUsage
    IDENTIFIED BY id-pe-delegationUsage }

id-pe-delegationUsage OBJECT IDENTIFIER ::= { id-cloudflare 44 }

DelegationUsage ::= NULL

END
]]></artwork>
    </section>
    <section anchor="example-certificate">
      <name>Example Certificate</name>
      <t>The following is an example of a delegation certificate that satisfies the
requirements described in <xref target="certificate-requirements"/> (i.e., uses the DelegationUsage extension
and has the digitalSignature KeyUsage).</t>
      <artwork><![CDATA[
-----BEGIN CERTIFICATE-----
MIIFRjCCBMugAwIBAgIQDGevB+lY0o/OecHFSJ6YnTAKBggqhkjOPQQDAzBMMQsw
CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSYwJAYDVQQDEx1EaWdp
Q2VydCBFQ0MgU2VjdXJlIFNlcnZlciBDQTAeFw0xOTAzMjYwMDAwMDBaFw0yMTAz
MzAxMjAwMDBaMGoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYw
FAYDVQQHEw1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBDbG91ZGZsYXJlLCBJbmMu
MRMwEQYDVQQDEwprYzJrZG0uY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
d4azI83Bw0fcPgfoeiZpZZnwGuxjBjv++wzE0zAj8vNiUkKxOWSQiGNLn+xlWUpL
lw9djRN1rLmVmn2gb9GgdKOCA28wggNrMB8GA1UdIwQYMBaAFKOd5h/52jlPwG7o
kcuVpdox4gqfMB0GA1UdDgQWBBSfcb7fS3fUFAyB91fRcwoDPtgtJjAjBgNVHREE
HDAaggprYzJrZG0uY29tggwqLmtjMmtkbS5jb20wDgYDVR0PAQH/BAQDAgeAMB0G
A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBpBgNVHR8EYjBgMC6gLKAqhiho
dHRwOi8vY3JsMy5kaWdpY2VydC5jb20vc3NjYS1lY2MtZzEuY3JsMC6gLKAqhiho
dHRwOi8vY3JsNC5kaWdpY2VydC5jb20vc3NjYS1lY2MtZzEuY3JsMEwGA1UdIARF
MEMwNwYJYIZIAYb9bAEBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vd3d3LmRpZ2lj
ZXJ0LmNvbS9DUFMwCAYGZ4EMAQICMHsGCCsGAQUFBwEBBG8wbTAkBggrBgEFBQcw
AYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEUGCCsGAQUFBzAChjlodHRwOi8v
Y2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRFQ0NTZWN1cmVTZXJ2ZXJDQS5j
cnQwDAYDVR0TAQH/BAIwADAPBgkrBgEEAYLaSywEAgUAMIIBfgYKKwYBBAHWeQIE
AgSCAW4EggFqAWgAdgC72d+8H4pxtZOUI5eqkntHOFeVCqtS6BqQlmQ2jh7RhQAA
AWm5hYJ5AAAEAwBHMEUCICiGfq+hSThRL2m8H0awoDR8OpnEHNkF0nI6nL5yYL/j
AiEAxwebGs/T6Es0YarPzoQJrVZqk+sHH/t+jrSrKd5TDjcAdgCHdb/nWXz4jEOZ
X73zbv9WjUdWNv9KtWDBtOr/XqCDDwAAAWm5hYNgAAAEAwBHMEUCIQD9OWA8KGL6
bxDKfgIleHJWB0iWieRs88VgJyfAg/aFDgIgQ/OsdSF9XOy1foqge0DTDM2FExuw
0JR0AGZWXoNtJzMAdgBElGUusO7Or8RAB9io/ijA2uaCvtjLMbU/0zOWtbaBqAAA
AWm5hYHgAAAEAwBHMEUCIQC4vua1n3BqthEqpA/VBTcsNwMtAwpCuac2IhJ9wx6X
/AIgb+o00k28JQo9TMpP4vzJ3BD3HXWSNc2Zizbq7mkUQYMwCgYIKoZIzj0EAwMD
aQAwZgIxAJsX7d0SuA8ddf/m7IWfNfs3MQfJyGkEezMJX1t6sRso5z50SS12LpXe
muGa1FE2ZgIxAL+CDUF5pz7mhrAEIjQ1MqlpF9tH40dJGvYZZQ3W23cMzSkDfvlt
y5S4RfWHIIPjbw==
-----END CERTIFICATE-----
]]></artwork>
    </section>
    <section anchor="acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>Thanks to David Benjamin, Christopher Patton, Kyle Nekritz, Anirudh Ramachandran, Benjamin
Kaduk, 奥 一穂 (Kazuho Oku), Daniel Kahn Gillmor, Watson Ladd, Robert Merget, Juraj
Somorovsky, and Nimrod Aviram for their discussions, ideas,
and bugs they have found.</t>
    </section>
  </back>
</rfc>
