Internet-Draft | CWT Chains | July 2024 |
Tschofenig & Moran | Expires 9 January 2025 | [Page] |
The CBOR Object Signing and Encryption (COSE) message structure uses references to keys and defines header parameters to carry chains of X.509 certificates.¶
This specification extends this functionality to CBOR Web Tokens (CWTs).¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 9 January 2025.¶
Copyright (c) 2024 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. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The CBOR Object Signing and Encryption (COSE) message structure utilizes references to keys and defines header parameters for carrying chains of X.509 certificates. The header parameters for conveying X.509 certificate chains in a COSE payload are defined in [RFC9360].¶
Inspired by RFC 9360, this document defines header parameters to convey chains of CBOR Web Tokens (CWTs) [RFC8392]. Utilizing chains of CWTs allows a trust infrastructure established by CWTs to be used with COSE. The Concise Binary Object Representation (CBOR) key structures [RFC8949] defined in COSE support the use of X.509 certificates and this specification applies these well-established concepts to CWTs. Chains of CWTs enable path validation similar to what is provided by a X.509 certificate-based Public Key Infrastructure (PKI). Since [RFC8747] does not define the semantics of path validation for CWTs, new terminology is introduced.¶
This document is structured as follows: After introducing key terms, we describe path validation for CWTs. We then define new header parameters.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].¶
The following terms are useful for readers of this document:¶
End Entity: User of CWT and/or end-user system that is the subject of a CWT.¶
CA: Certification Authority; RFC 8747 calls this entity the "issuer" and describes it as "the party that creates the CWT and binds the claims about the subject to the proof-of-possession key". In an OAuth-based system, this entity often corresponds to an authorization server.¶
CA CWT: A CWT that is self-issued, whereby the same name appears in the subject and issuer claims.¶
RA: Registration Authority, i.e., an optional system to which a CA delegates certain management functions. While often used in PKI deployments, it is a role that has not found usage in systems using CWTs.¶
CRL Issuer: A system that generates and signs Certificate Revocation Lists (CRLs). The term CRL is used generically to also refer to status lists [I-D.ietf-oauth-status-list].¶
Repository: A system or collection of distributed systems that stores CWTs and CRLs and serves as a means of distributing these CWTs and CRLs to end entities. These repositories may be append-only databases, in the style of [I-D.ietf-keytrans-architecture].¶
Trust Anchor: As defined in [RFC6024] and [RFC9019], a Trust Anchor "represents an authoritative entity via a public key and associated data. The public key is used to verify digital signatures, and the associated data is used to constrain the types of information for which the trust anchor is authoritative." The trust anchor may be a CWT, a raw public key, or another structure, as appropriate.¶
Subject Public Key Info: The "confirmation" claim, defined in [RFC8747], used to carry the public key and the algorithm with which the key is used.¶
The goal of path validation is to verify the binding between a subject name and the public key, as represented in the target CWT, based on the public key of the trust anchor. In most cases, the target CWT will be an end entity CWT. Verifying the binding between the name and subject public key requires obtaining a sequence of certificates that support that binding. For path validation to work, CWTs must contain at least the following claims:¶
Valid paths begin with CWTs issued by a trust anchor and the trust anchor is an input to the algorithm. The algorithm in Section 6 of [RFC5280] requires the public key of the CA, the CA's name, and any constraints upon the set of paths that may be validated using this key.¶
The path validation algorithm verifies that a prospective certification path (a sequence of n CWTs) satisfies the following conditions:¶
(a) for all x in {1, ..., n-1}, the subject of CWT x is the issuer of CWT x+1;¶
(b) CWT 1 is issued by the trust anchor;¶
(c) CWT n is the CWT to be validated (i.e., the target CWT); and¶
Note: When the trust anchor is provided in the form of a self-signed CWT, this self-signed CWT is not included as part of the prospective certification path.¶
As a variation to the algorithm presented in Section 6 of [RFC5280], there is no strict requirement for a CWT being valid in terms of its lifetime (as indicated by the "Expiration Time" and the "Not Before" claims) since CWTs may not necessarily carry these claims and validity may be determined via different means, which are outside the scope of this algorithm.¶
Path validation is an important part of establishing trust in a CWT. When applying path validation, as defined in Section 6 of[RFC5280], to CWTs, the reader needs to treat them as certificates. It is important to keep in mind that many of the advanced features available with an X.509 certificate-based PKI are, at the time of writing, not available with CWTs. The authors do, however, believe that these differences will decrease over time as CWT-based deployments scale.¶
Parties that intend to rely on the assertions made by CWTs obtained from any of these methods still need to validate them. This validation can be done according to the PKIX rules specified in [RFC5280] or by using a different trust structure, such as a trusted distributor for self-signed CWTs. The PKIX validation includes matching against the trust anchors configured for the application. These rules apply when the validation succeeds in a single step as well as when CWT chains need to be built. If the application cannot establish trust in the CWT, the public key contained in the CWT cannot be used for cryptographic operations.¶
The header parameters defined in this document are as follows:¶
cwt-bag: This header parameter contains a bag of CWTs, which is unordered and may contain self-signed CWTs. Note that there could be duplicate CWTs. The CWT bag can contain CWTs that are completely extraneous to the message. (An example of this would be where a signed message is being used to transport a CWT containing a key agreement key.) As the CWTs are unordered, the party evaluating the signature will need to be capable of building the CWT path as necessary. That party will also have to take into account that the bag may not contain the full set of CWTs needed to build any particular chain.¶
The trust mechanism MUST process any CWT in this parameter as untrusted input. The presence of a self-signed CWT in the parameter MUST NOT cause the update of the set of trust anchors without some out-of-band confirmation. As the contents of this header parameter are untrusted input, the header parameter can be in either the protected or unprotected header bucket. Sending the header parameter in the unprotected header bucket allows an intermediary to remove or add CWT. The end entity CWT MUST be integrity protected by COSE. This can, for example, be done by sending the header parameter in the protected header, sending an 'cwt-bag' in the unprotected header combined with an 'cwt-t' in the protected header, or including the end entity CWT in the external_aad. This header parameter allows for a single CWT or a bag of CWTs to be carried in the message. * If a single CWT is conveyed, it is placed in a CBOR byte string. * If multiple CWTs are conveyed, a CBOR array of byte strings is used, with each CWT being in its own byte string.¶
cwt-chain: This header parameter contains an ordered array of CWTs. The CWTs are to be ordered starting with the CWT containing the end entity key followed by the CWT that signed it, and so on. There is no requirement for the entire chain to be present in the element if there is reason to believe that the relying party already has, or can locate, the missing CWTs. This means that the relying party is still required to do path building but that a candidate path is proposed in this header parameter.¶
The trust mechanism MUST process any CWT in this parameter as untrusted input. The presence of a self-signed CWT in the parameter MUST NOT cause the update of the set of trust anchors without some out-of-band confirmation. As the contents of this header parameter are untrusted input, the header parameter can be in either the protected or unprotected header bucket. Sending the header parameter in the unprotected header bucket allows an intermediary to remove or add CWTs. The end entity CWT MUST be integrity protected by COSE. This can, for example, be done by sending the header parameter in the protected header, sending a 'cwt-chain' in the unprotected header combined with an 'cwt-t' in the protected header, or including the end entity CWT in the external_aad. This header parameter allows for a single CWT or a chain of CWTs to be carried in the message. * If a single CWT is conveyed, it is placed in a CBOR byte string. * If multiple CWTs are conveyed, a CBOR array of byte strings is used, with each CWT being in its own byte string.¶
cwt-t: This header parameter identifies the end entity CWT by a hash value (a thumbprint). The 'cwt-t' header parameter is represented as an array of two elements. The first element is an algorithm identifier that is an integer or a string containing the hash algorithm identifier corresponding to the Value column (integer or text string) of the algorithm registered in the "COSE Algorithms" registry (see [COSE-IANA]). The second element is a binary string containing the hash value computed over the CWT.¶
As this header parameter does not provide any trust, the header parameter can be in either a protected or unprotected header bucket. The identification of the end entity CWT MUST be integrity protected by COSE. This can be done by sending the header parameter in the protected header or including the end entity CWT in the external_aad. The 'cwt-t' header parameter can be used alone or together with the 'cwt-bag', 'cwt-chain', or 'cwt-u' header parameters to provide integrity protection of the end entity CWT. For interoperability, applications that use this header parameter MUST support the hash algorithm 'SHA-256' but can use other hash algorithms. This requirement allows for different implementations to be configured to use an interoperable algorithm, but does not preclude the use (by prior agreement) of other algorithms. Note: For conveying the thumbprint of a public key alone, see {{I-D.ietf-cose-key-thumbprint}}.¶
cwt-u: This header parameter provides the ability to identify a CWT by a URI [RFC3986]. It contains a CBOR text string. The referenced resource can be any of the following media types:¶
* application/cwt {{RFC8392}} * application/cwt usage=chain (see {{chain}}) When the application/cwt media type is used, the data is a encoded according to RFC 8392. If the parameter "usage" is set to "chain", this sequence indicates a CWT chain. The end entity CWT MUST be integrity protected by COSE. This can, for example, be done by sending the 'cwt-u' in the unprotected or protected header combined with an 'cwt-t' in the protected header, or including the end entity CWT in the external_aad. As the end entity CWT is integrity protected by COSE, the URI does not need to provide any protection. If a retrieved CWT does not chain to an existing trust anchor, that CWT MUST NOT be trusted unless the URI provides integrity protection and server authentication and the server is configured as trusted to provide new trust anchors or if an out-of-band confirmation can be received for trusting the retrieved CWT. If an HTTP or Constrained Application Protocol (CoAP) GET request is used to retrieve a CWT, a standardized security protocol should be used. Examples of such security protocols include TLS {{RFC8446}}, DTLS {{RFC9147}}, or Object Security for Constrained RESTful Environments (OSCORE) {{RFC8613}} should be used.¶
The header parameters are used in the following locations:¶
COSE_Signature and COSE_Sign1 objects: In these objects, the parameters identify the CWT to be used for validating the signature.¶
COSE_recipient objects: In this location, the parameters identify the CWT for the recipient of the message.¶
The labels assigned to each header parameter can be found in Figure 1.¶
Below is an equivalent Concise Data Definition Language (CDDL) description (see [RFC8610]) of the text above.¶
COSE_CWT = CWT-Messages / [ 2*CWT-Messages ] COSE_CWTHash = [ hashAlg: (int / tstr), hashValue: bstr ]¶
The contents of "bstr" are the bytes of a CWT.¶
This section defines the algorithm-specific parameters that are used for identifying or transporting the sender's key for static-static key agreement algorithms.¶
These attributes are defined analogously to those in the previous section. There is no definition for the CWT bag, as the same parameter would be used for both the sender and recipient.¶
cwt-chain-sender: This header parameter contains the chain of CWT starting with the sender's key exchange CWT. The structure is the same as 'cwt-chain'.¶
cwt-t-sender: This header parameter contains the hash value for the sender's key exchange CWT. The structure is the same as 'cwt-t'.¶
cwt-u-sender: This header parameter contains a URI for the sender's key exchange CWT. The structure and processing are the same as 'cwt-u'.¶
Establishing trust in a CWT is a vital part of processing. A major component of establishing trust is determining what the set of trust anchors are for the process. A new self-signed CWT appearing on the client cannot be a trigger to modify the set of trust anchors, because a well-defined trust-establishment process is required. One common way for a new trust anchor to be added to (or removed from) a device is by doing a new firmware upgrade.¶
In constrained systems, there is a trade-off between the order of checking the signature and checking the CWT for validity. Validating CWTs may require that network resources be accessed in order to get status information or retrieve CWTs during path building. The resulting network access can consume power and network bandwidth. On the other hand, if the CWT is validated after the signature is validated, an oracle can potentially be built based on detecting the network resources, which is only done if the signature validation passes. In any event, both the signature validation and the CWT validation MUST be completed successfully before acting on any requests.¶
The end entity CWT MUST be integrity protected by COSE. Without proof of possession, an attacker can trick the CA into issuing an identity-misbinding CWT with someone else's "borrowed" public key but with a different subject. An on-path attacker can then perform an identity-misbinding attack by replacing the real end entity CWT in COSE with such an identity- misbinding CWT.¶
End entity CWTs contain identities that a passive on-path attacker eavesdropping on the conversation can use to identify and track the subject. The 'cwt-t' and 'cwt-u' header parameters are just alternative permanent identifiers and can also be used to track the subject. To provide identity protection, COSE can be sent inside another security protocol providing confidentiality. Additionally, the encryption capabilities of COSE itself can be used to protect the CWT content.¶
When processing the 'cwt-u' header parameter, the security considerations of [RFC3986], and specifically those defined in Section 7.1 of [RFC3986], also apply.¶
Protecting the integrity of the 'cwt-bag', 'cwt-chain', and 'cwt-t' contents by placing them in the protected header bucket can help mitigate some risks of a misbehaving CA (cf. Section 5.1 of [RFC2634]).¶
The security of the algorithm used for 'cwt-t' does not affect the security of the system, as this header parameter selects which CWT that is already present on the system should be used, but it does not provide any trust.¶
IANA has registered the new COSE Header parameters in Figure 1 in the "COSE Header Parameters" registry. The "Value Registry" field is empty for all of the items. For each item, the "Reference" field points to this document.¶
IANA has registered the new COSE Header Algorithm parameters in Figure 2 in the "COSE Header Algorithm Parameters" registry. For each item, the "Reference" field points to this document.¶
When the application/cwt media type is used, the data is a CBOR sequence of single-entry COSE_CWT structures (encoding "bstr"). If the parameter "usage" is set to "chain", this sequence indicates a CWT chain.¶
The application/cwt media type is already registered by [RFC8392] and this document updates the IANA entry of this media type [RFC6838]:¶
Type name: application¶
Subtype name: cwt¶
Required parameters: N/A¶
Optional parameters: usage¶
Encoding considerations: binary¶
Security considerations: See the Security Considerations section of RFC 8392 and [TBD: This RFC].¶
Interoperability considerations: N/A¶
Published specification: RFC 8392 and [TBD: This RFC]¶
Applications that use this media type: Applications that employ COSE and use CWTs, including IoT applications and digital credentials in general.¶
Fragment identifier considerations: N/A¶
Additional information:¶
Person & email address to contact for further information: [email protected]¶
Intended usage: COMMON¶
Restrictions on usage: N/A¶
Author: COSE WG¶
Change controller: IESG¶
Provisional registration? No¶
We would like to thank Ken Takayama for his work on the IETF SUIT trust domains draft, which created the idea for writing this specification. Ken provided valuable review feedback.¶
Add your name here.¶