idnits 2.17.1 draft-ietf-core-oscore-groupcomm-13.txt: -(3447): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == There are 5 instances of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (25 October 2021) is 906 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-10) exists of draft-ietf-core-groupcomm-bis-05 == Outdated reference: A later version (-10) exists of draft-ietf-cose-countersign-05 -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-cose-countersign' ** Downref: Normative reference to an Informational draft: draft-ietf-cose-rfc8152bis-algs (ref. 'I-D.ietf-cose-rfc8152bis-algs') -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-cose-rfc8152bis-struct' -- Possible downref: Non-RFC (?) normative reference: ref. 'NIST-800-56A' ** Downref: Normative reference to an Informational RFC: RFC 7748 ** Downref: Normative reference to an Informational RFC: RFC 8032 == Outdated reference: A later version (-08) exists of draft-amsuess-core-cachable-oscore-02 == Outdated reference: A later version (-18) exists of draft-ietf-ace-key-groupcomm-14 == Outdated reference: A later version (-16) exists of draft-ietf-ace-key-groupcomm-oscore-12 == Outdated reference: A later version (-46) exists of draft-ietf-ace-oauth-authz-45 == Outdated reference: A later version (-08) exists of draft-ietf-core-observe-multicast-notifications-02 == Outdated reference: A later version (-09) exists of draft-ietf-cose-cbor-encoded-cert-02 == Outdated reference: A later version (-23) exists of draft-ietf-lwig-curve-representations-21 == Outdated reference: A later version (-07) exists of draft-ietf-lwig-security-protocol-comparison-05 == Outdated reference: A later version (-04) exists of draft-mattsson-cfrg-det-sigs-with-noise-02 -- Obsolete informational reference (is this intentional?): RFC 6347 (Obsoleted by RFC 9147) Summary: 3 errors (**), 0 flaws (~~), 13 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CoRE Working Group M. Tiloca 3 Internet-Draft RISE AB 4 Intended status: Standards Track G. Selander 5 Expires: 28 April 2022 F. Palombini 6 J. Mattsson 7 Ericsson AB 8 J. Park 9 Universitaet Duisburg-Essen 10 25 October 2021 12 Group OSCORE - Secure Group Communication for CoAP 13 draft-ietf-core-oscore-groupcomm-13 15 Abstract 17 This document defines Group Object Security for Constrained RESTful 18 Environments (Group OSCORE), providing end-to-end security of CoAP 19 messages exchanged between members of a group, e.g., sent over IP 20 multicast. In particular, the described approach defines how OSCORE 21 is used in a group communication setting to provide source 22 authentication for CoAP group requests, sent by a client to multiple 23 servers, and for protection of the corresponding CoAP responses. 24 Group OSCORE also defines a pairwise mode where each member of the 25 group can efficiently derive a symmetric pairwise key with any other 26 member of the group for pairwise OSCORE communication. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on 28 April 2022. 45 Copyright Notice 47 Copyright (c) 2021 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 52 license-info) in effect on the date of publication of this document. 53 Please review these documents carefully, as they describe your rights 54 and restrictions with respect to this document. Code Components 55 extracted from this document must include Simplified BSD License text 56 as described in Section 4.e of the Trust Legal Provisions and are 57 provided without warranty as described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 62 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 63 2. Security Context . . . . . . . . . . . . . . . . . . . . . . 8 64 2.1. Common Context . . . . . . . . . . . . . . . . . . . . . 10 65 2.1.1. AEAD Algorithm . . . . . . . . . . . . . . . . . . . 10 66 2.1.2. ID Context . . . . . . . . . . . . . . . . . . . . . 10 67 2.1.3. Group Manager Public Key . . . . . . . . . . . . . . 10 68 2.1.4. Signature Encryption Algorithm . . . . . . . . . . . 11 69 2.1.5. Signature Algorithm . . . . . . . . . . . . . . . . . 11 70 2.1.6. Group Encryption Key . . . . . . . . . . . . . . . . 11 71 2.1.7. Pairwise Key Agreement Algorithm . . . . . . . . . . 12 72 2.2. Sender Context and Recipient Context . . . . . . . . . . 12 73 2.3. Format of Public Keys . . . . . . . . . . . . . . . . . . 13 74 2.4. Pairwise Keys . . . . . . . . . . . . . . . . . . . . . . 14 75 2.4.1. Derivation of Pairwise Keys . . . . . . . . . . . . . 14 76 2.4.2. ECDH with Montgomery Coordinates . . . . . . . . . . 16 77 2.4.3. Usage of Sequence Numbers . . . . . . . . . . . . . . 17 78 2.4.4. Security Context for Pairwise Mode . . . . . . . . . 17 79 2.5. Update of Security Context . . . . . . . . . . . . . . . 18 80 2.5.1. Loss of Mutable Security Context . . . . . . . . . . 18 81 2.5.2. Exhaustion of Sender Sequence Number . . . . . . . . 19 82 2.5.3. Retrieving New Security Context Parameters . . . . . 20 83 3. The Group Manager . . . . . . . . . . . . . . . . . . . . . . 22 84 3.1. Support for Additional Principals . . . . . . . . . . . . 24 85 3.2. Management of Group Keying Material . . . . . . . . . . . 24 86 3.2.1. Recycling of Identifiers . . . . . . . . . . . . . . 27 87 3.3. Responsibilities of the Group Manager . . . . . . . . . . 28 88 4. The COSE Object . . . . . . . . . . . . . . . . . . . . . . . 30 89 4.1. Countersignature . . . . . . . . . . . . . . . . . . . . 30 90 4.1.1. Keystream Derivation . . . . . . . . . . . . . . . . 30 91 4.1.2. Clarifications on Using a Countersignature . . . . . 32 92 4.2. The 'kid' and 'kid context' parameters . . . . . . . . . 32 93 4.3. external_aad . . . . . . . . . . . . . . . . . . . . . . 32 94 5. OSCORE Header Compression . . . . . . . . . . . . . . . . . . 35 95 5.1. Examples of Compressed COSE Objects . . . . . . . . . . . 36 96 5.1.1. Examples in Group Mode . . . . . . . . . . . . . . . 36 97 5.1.2. Examples in Pairwise Mode . . . . . . . . . . . . . . 37 99 6. Message Binding, Sequence Numbers, Freshness and Replay 100 Protection . . . . . . . . . . . . . . . . . . . . . . . 38 101 6.1. Supporting Observe . . . . . . . . . . . . . . . . . . . 38 102 6.2. Update of Replay Window . . . . . . . . . . . . . . . . . 38 103 6.3. Message Freshness . . . . . . . . . . . . . . . . . . . . 39 104 7. Message Reception . . . . . . . . . . . . . . . . . . . . . . 39 105 8. Message Processing in Group Mode . . . . . . . . . . . . . . 40 106 8.1. Protecting the Request . . . . . . . . . . . . . . . . . 41 107 8.1.1. Supporting Observe . . . . . . . . . . . . . . . . . 42 108 8.2. Verifying the Request . . . . . . . . . . . . . . . . . . 43 109 8.2.1. Supporting Observe . . . . . . . . . . . . . . . . . 44 110 8.3. Protecting the Response . . . . . . . . . . . . . . . . . 45 111 8.3.1. Supporting Observe . . . . . . . . . . . . . . . . . 46 112 8.4. Verifying the Response . . . . . . . . . . . . . . . . . 46 113 8.4.1. Supporting Observe . . . . . . . . . . . . . . . . . 48 114 8.5. External Signature Checkers . . . . . . . . . . . . . . . 50 115 9. Message Processing in Pairwise Mode . . . . . . . . . . . . . 51 116 9.1. Pre-Conditions . . . . . . . . . . . . . . . . . . . . . 52 117 9.2. Main Differences from OSCORE . . . . . . . . . . . . . . 52 118 9.3. Protecting the Request . . . . . . . . . . . . . . . . . 52 119 9.4. Verifying the Request . . . . . . . . . . . . . . . . . . 53 120 9.5. Protecting the Response . . . . . . . . . . . . . . . . . 53 121 9.6. Verifying the Response . . . . . . . . . . . . . . . . . 54 122 10. Mandatory-to-Implement Compliance Requirements . . . . . . . 55 123 11. Security Considerations . . . . . . . . . . . . . . . . . . . 56 124 11.1. Security of the Group Mode . . . . . . . . . . . . . . . 57 125 11.2. Security of the Pairwise Mode . . . . . . . . . . . . . 59 126 11.3. Uniqueness of (key, nonce) . . . . . . . . . . . . . . . 59 127 11.4. Management of Group Keying Material . . . . . . . . . . 60 128 11.5. Update of Security Context and Key Rotation . . . . . . 60 129 11.5.1. Late Update on the Sender . . . . . . . . . . . . . 61 130 11.5.2. Late Update on the Recipient . . . . . . . . . . . . 62 131 11.6. Collision of Group Identifiers . . . . . . . . . . . . . 62 132 11.7. Cross-group Message Injection . . . . . . . . . . . . . 62 133 11.7.1. Attack Description . . . . . . . . . . . . . . . . . 63 134 11.7.2. Attack Prevention in Group Mode . . . . . . . . . . 64 135 11.8. Prevention of Group Cloning Attack . . . . . . . . . . . 65 136 11.9. Group OSCORE for Unicast Requests . . . . . . . . . . . 65 137 11.10. End-to-end Protection . . . . . . . . . . . . . . . . . 66 138 11.11. Master Secret . . . . . . . . . . . . . . . . . . . . . 67 139 11.12. Replay Protection . . . . . . . . . . . . . . . . . . . 67 140 11.13. Message Freshness . . . . . . . . . . . . . . . . . . . 68 141 11.14. Client Aliveness . . . . . . . . . . . . . . . . . . . . 68 142 11.15. Cryptographic Considerations . . . . . . . . . . . . . . 68 143 11.16. Message Segmentation . . . . . . . . . . . . . . . . . . 70 144 11.17. Privacy Considerations . . . . . . . . . . . . . . . . . 70 145 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 71 146 12.1. OSCORE Flag Bits Registry . . . . . . . . . . . . . . . 71 148 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 71 149 13.1. Normative References . . . . . . . . . . . . . . . . . . 72 150 13.2. Informative References . . . . . . . . . . . . . . . . . 73 151 Appendix A. Assumptions and Security Objectives . . . . . . . . 76 152 A.1. Assumptions . . . . . . . . . . . . . . . . . . . . . . . 77 153 A.2. Security Objectives . . . . . . . . . . . . . . . . . . . 79 154 Appendix B. List of Use Cases . . . . . . . . . . . . . . . . . 80 155 Appendix C. Example of Group Identifier Format . . . . . . . . . 83 156 Appendix D. Set-up of New Endpoints . . . . . . . . . . . . . . 84 157 Appendix E. Challenge-Response Synchronization . . . . . . . . . 84 158 Appendix F. Document Updates . . . . . . . . . . . . . . . . . . 88 159 F.1. Version -12 to -13 . . . . . . . . . . . . . . . . . . . 88 160 F.2. Version -11 to -12 . . . . . . . . . . . . . . . . . . . 88 161 F.3. Version -10 to -11 . . . . . . . . . . . . . . . . . . . 89 162 F.4. Version -09 to -10 . . . . . . . . . . . . . . . . . . . 90 163 F.5. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 90 164 F.6. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 91 165 F.7. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 93 166 F.8. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 93 167 F.9. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 94 168 F.10. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 94 169 F.11. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 95 170 F.12. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 96 171 F.13. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 97 172 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 97 173 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 98 175 1. Introduction 177 The Constrained Application Protocol (CoAP) [RFC7252] is a web 178 transfer protocol specifically designed for constrained devices and 179 networks [RFC7228]. Group communication for CoAP 180 [I-D.ietf-core-groupcomm-bis] addresses use cases where deployed 181 devices benefit from a group communication model, for example to 182 reduce latencies, improve performance, and reduce bandwidth 183 utilization. Use cases include lighting control, integrated building 184 control, software and firmware updates, parameter and configuration 185 updates, commissioning of constrained networks, and emergency 186 multicast (see Appendix B). Group communication for CoAP 187 [I-D.ietf-core-groupcomm-bis] mainly uses UDP/IP multicast as the 188 underlying data transport. 190 Object Security for Constrained RESTful Environments (OSCORE) 191 [RFC8613] describes a security protocol based on the exchange of 192 protected CoAP messages. OSCORE builds on CBOR Object Signing and 193 Encryption (COSE) 194 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and 195 provides end-to-end encryption, integrity, replay protection and 196 binding of response to request between a sender and a recipient, 197 independent of the transport layer also in the presence of 198 intermediaries. To this end, a CoAP message is protected by 199 including its payload (if any), certain options, and header fields in 200 a COSE object, which replaces the authenticated and encrypted fields 201 in the protected message. 203 This document defines Group OSCORE, a security protocol for Group 204 communication for CoAP [I-D.ietf-core-groupcomm-bis], providing the 205 same end-to-end security properties as OSCORE in the case where CoAP 206 requests have multiple recipients. In particular, the described 207 approach defines how OSCORE is used in a group communication setting 208 to provide source authentication for CoAP group requests, sent by a 209 client to multiple servers, and for protection of the corresponding 210 CoAP responses. Group OSCORE also defines a pairwise mode where each 211 member of the group can efficiently derive a symmetric pairwise key 212 with any other member of the group for pairwise OSCORE communication. 213 Just like OSCORE, Group OSCORE is independent of the transport layer 214 and works wherever CoAP does. 216 As with OSCORE, it is possible to combine Group OSCORE with 217 communication security on other layers. One example is the use of 218 transport layer security, such as DTLS 219 [RFC6347][I-D.ietf-tls-dtls13], between one client and one proxy (and 220 vice versa), or between one proxy and one server (and vice versa), in 221 order to protect the routing information of packets from observers. 222 Note that DTLS does not define how to secure messages sent over IP 223 multicast. 225 Group OSCORE defines two modes of operation, that can be used 226 independently or together: 228 * In the group mode, Group OSCORE requests and responses are 229 digitally signed with the private key of the sender and the 230 signature is embedded in the protected CoAP message. The group 231 mode supports all COSE signature algorithms as well as signature 232 verification by intermediaries. This mode is defined in 233 Section 8. 235 * In the pairwise mode, two group members exchange OSCORE requests 236 and responses (typically) over unicast, and the messages are 237 protected with symmetric keys. These symmetric keys are derived 238 from Diffie-Hellman shared secrets, calculated with the asymmetric 239 keys of the sender and recipient, allowing for shorter integrity 240 tags and therefore lower message overhead. This mode is defined 241 in Section 9. 243 Both modes provide source authentication of CoAP messages. The 244 application decides what mode to use, potentially on a per-message 245 basis. Such decisions can be based, for instance, on pre-configured 246 policies or dynamic assessing of the target recipient and/or 247 resource, among other things. One important case is when requests 248 are protected with the group mode, and responses with the pairwise 249 mode. Since such responses convey shorter integrity tags instead of 250 bigger, full-fledged signatures, this significantly reduces the 251 message overhead in case of many responses to one request. 253 A special deployment of Group OSCORE is to use pairwise mode only. 254 For example, consider the case of a constrained-node network 255 [RFC7228] with a large number of CoAP endpoints and the objective to 256 establish secure communication between any pair of endpoints with a 257 small provisioning effort and message overhead. Since the total 258 number of security associations that needs to be established grows 259 with the square of the number of nodes, it is desirable to restrict 260 the provisioned keying material. Moreover, a key establishment 261 protocol would need to be executed for each security association. 262 One solution to this is to deploy Group OSCORE, with the endpoints 263 being part of a group, and use the pairwise mode. This solution 264 assumes a trusted third party called Group Manager (see Section 3), 265 but has the benefit of restricting the symmetric keying material 266 while distributing only the public key of each group member. After 267 that, a CoAP endpoint can locally derive the OSCORE Security Context 268 for the other endpoint in the group, and protect CoAP communications 269 with very low overhead [I-D.ietf-lwig-security-protocol-comparison]. 271 1.1. Terminology 273 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 274 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 275 "OPTIONAL" in this document are to be interpreted as described in BCP 276 14 [RFC2119] [RFC8174] when, and only when, they appear in all 277 capitals, as shown here. 279 Readers are expected to be familiar with the terms and concepts 280 described in CoAP [RFC7252] including "endpoint", "client", "server", 281 "sender" and "recipient"; group communication for CoAP 282 [I-D.ietf-core-groupcomm-bis]; CBOR [RFC8949]; COSE 283 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and 284 related countersignatures [I-D.ietf-cose-countersign]. 286 Readers are also expected to be familiar with the terms and concepts 287 for protection and processing of CoAP messages through OSCORE, such 288 as "Security Context" and "Master Secret", defined in [RFC8613]. 290 Terminology for constrained environments, such as "constrained 291 device" and "constrained-node network", is defined in [RFC7228]. 293 This document refers also to the following terminology. 295 * Keying material: data that is necessary to establish and maintain 296 secure communication among endpoints. This includes, for 297 instance, keys and IVs [RFC4949]. 299 * Group: a set of endpoints that share group keying material and 300 security parameters (Common Context, see Section 2). That is, 301 unless otherwise specified, the term group used in this document 302 refers to a "security group" (see Section 2.1 of 303 [I-D.ietf-core-groupcomm-bis]), not to be confused with "CoAP 304 group" or "application group". 306 * Group Manager: entity responsible for a group. Each endpoint in a 307 group communicates securely with the respective Group Manager, 308 which is neither required to be an actual group member nor to take 309 part in the group communication. The full list of 310 responsibilities of the Group Manager is provided in Section 3.3. 312 * Silent server: member of a group that never sends protected 313 responses in reply to requests. For CoAP group communications, 314 requests are normally sent without necessarily expecting a 315 response. A silent server may send unprotected responses, as 316 error responses reporting an OSCORE error. Note that an endpoint 317 can implement both a silent server and a client, i.e., the two 318 roles are independent. An endpoint acting only as a silent server 319 performs only Group OSCORE processing on incoming requests. 320 Silent servers maintain less keying material and in particular do 321 not have a Sender Context for the group. Since silent servers do 322 not have a Sender ID, they cannot support the pairwise mode. 324 * Group Identifier (Gid): identifier assigned to the group, unique 325 within the set of groups of a given Group Manager. 327 * Birth Gid: with respect to a group member, the Gid obtained by 328 that group member upon (re-)joining the group. 330 * Group request: CoAP request message sent by a client in the group 331 to all servers in that group. 333 * Key Generation Number: an integer value identifying the current 334 version of the keying material used in a group. 336 * Source authentication: evidence that a received message in the 337 group originated from a specific identified group member. This 338 also provides assurance that the message was not tampered with by 339 anyone, be it a different legitimate group member or an endpoint 340 which is not a group member. 342 2. Security Context 344 This document refers to a group as a set of endpoints sharing keying 345 material and security parameters for executing the Group OSCORE 346 protocol (see Section 1.1). Regardless of what it actually supports, 347 each endpoint of a group is aware of whether the group uses the group 348 mode, or the pairwise mode, or both. 350 All members of a group maintain a Security Context as defined in 351 Section 3 of [RFC8613] and extended as defined in this section. How 352 the Security Context is established by the group members is out of 353 scope for this document, but if there is more than one Security 354 Context applicable to a message, then the endpoints MUST be able to 355 tell which Security Context was latest established. 357 The default setting for how to manage information about the group, 358 including the Security Context, is described in terms of a Group 359 Manager (see Section 3). In particular, the Group Manager indicates 360 whether the group uses the group mode, the pairwise mode, or both of 361 them, as part of the group data provided to candidate group members 362 when joining the group. 364 The remainder of this section provides further details about the 365 Security Context of Group OSCORE. In particular, each endpoint which 366 is member of a group maintains a Security Context as defined in 367 Section 3 of [RFC8613], extended as follows (see Figure 1). 369 * One Common Context, shared by all the endpoints in the group. 370 Several new parameters are included in the Common Context. 372 If a Group Manager is used for maintaining the group, the Common 373 Context is extended with the public key of the Group Manager. 374 When processing a message, the public key of the Group Manager is 375 included in the external additional authenticated data. 377 If the group uses the group mode, the Common context is extended 378 with the following new parameters. 380 - Signature Encryption Algorithm and Signature Algorithm. These 381 relate to the encryption/decryption operations and to the 382 computation/verification of countersignatures, respectively, 383 when a message is protected with the group mode (see 384 Section 8). 386 - Group Encryption Key, used to perform encryption/decryption of 387 countersignatures, when a message is protected with the group 388 mode (see Section 8). 390 If the group uses the pairwise mode, the Common Context is 391 extended with a Pairwise Key Agreement Algorithm used for 392 agreement on a static-static Diffie-Hellman shared secret, from 393 which pairwise keys are derived (see Section 2.4.1) to protect 394 messages with the pairwise mode (see Section 9). 396 * One Sender Context, extended with the endpoint's public and 397 private key pair. The private key is used to sign messages in 398 group mode, or for deriving pairwise keys in pairwise mode (see 399 Section 2.4). When processing a message, the public key is 400 included in the external additional authenticated data. 402 If the endpoint supports the pairwise mode, the Sender Context is 403 also extended with the Pairwise Sender Keys associated to the 404 other endpoints (see Section 2.4). 406 The Sender Context is omitted if the endpoint is configured 407 exclusively as silent server. 409 * One Recipient Context for each endpoint from which messages are 410 received. It is not necessary to maintain Recipient Contexts 411 associated to endpoints from which messages are not (expected to 412 be) received. The Recipient Context is extended with the public 413 key of the associated endpoint, used to verify the signature in 414 group mode and for deriving the pairwise keys in pairwise mode 415 (see Section 2.4). If the endpoint supports the pairwise mode, 416 then the Recipient Context is also extended with the Pairwise 417 Recipient Key associated to the other endpoint (see Section 2.4). 419 +-------------------+------------------------------------------------+ 420 | Context Component | New Information Elements | 421 +-------------------+------------------------------------------------+ 422 | Common Context | Group Manager Public Key | 423 | | * Signature Encryption Algorithm | 424 | | * Signature Algorithm | 425 | | * Group Encryption Key | 426 | | ^ Pairwise Key Agreement Algorithm | 427 +-------------------+------------------------------------------------+ 428 | Sender Context | Endpoint's own public and private key pair | 429 | | ^ Pairwise Sender Keys for the other endpoints | 430 +-------------------+------------------------------------------------+ 431 | Each | Public key of the other endpoint | 432 | Recipient Context | ^ Pairwise Recipient Key of the other endpoint | 433 +-------------------+------------------------------------------------+ 435 Figure 1: Additions to the OSCORE Security Context. The optional 436 elements labeled with * (with ^) are present only if the group 437 uses the group mode (the pairwise mode). 439 2.1. Common Context 441 The Common Context may be acquired from the Group Manager (see 442 Section 3). The following sections define how the Common Context is 443 extended, compared to [RFC8613]. 445 2.1.1. AEAD Algorithm 447 AEAD Algorithm identifies the COSE AEAD algorithm to use for 448 encryption, when messages are protected using the pairwise mode (see 449 Section 9). This algorithm MUST provide integrity protection. This 450 parameter is immutable once the Common Context is established, and it 451 is not relevant if the group uses only the group mode. 453 2.1.2. ID Context 455 The ID Context parameter (see Sections 3.1 and 3.3 of [RFC8613]) in 456 the Common Context SHALL contain the Group Identifier (Gid) of the 457 group. The choice of the Gid format is application specific. An 458 example of specific formatting of the Gid is given in Appendix C. 459 The application needs to specify how to handle potential collisions 460 between Gids (see Section 11.6). 462 2.1.3. Group Manager Public Key 464 Group Manager Public Key specifies the public key of the Group 465 Manager. This is included in the external additional authenticated 466 data (see Section 4.3). 468 Each group member MUST obtain the public key of the Group Manager 469 with a valid proof-of-possession of the corresponding private key, 470 for instance from the Group Manager itself when joining the group. 471 Further details on the provisioning of the Group Manager's public key 472 to the group members are out of the scope of this document. 474 2.1.4. Signature Encryption Algorithm 476 Signature Encryption Algorithm identifies the algorithm to use for 477 enryption, when messages are protected using the group mode (see 478 Section 8). This algorithm MAY provide integrity protection. This 479 parameter is immutable once the Common Context is established. 481 2.1.5. Signature Algorithm 483 Signature Algorithm identifies the digital signature algorithm used 484 to compute a countersignature on the COSE object (see Sections 3.2 485 and 3.3 of [I-D.ietf-cose-countersign]), when messages are protected 486 using the group mode (see Section 8). This parameter is immutable 487 once the Common Context is established. 489 2.1.6. Group Encryption Key 491 Group Encryption Key specifies the encryption key for deriving a 492 keystream to encrypt/decrypt a countersignature, when a message is 493 protected with the group mode (see Section 8). 495 The Group Encryption Key is derived as defined for Sender/Recipient 496 Keys in Section 3.2.1 of [RFC8613], with the following differences. 498 * The 'id' element of the 'info' array is the empty byte string. 500 * The 'alg_aead' element of the 'info' array takes the value of 501 Signature Encryption Algorithm from the Common Context (see 502 Section 2.1.5). 504 * The 'type' element of the 'info' array is "Group Encryption Key". 505 The label is an ASCII string and does not include a trailing NUL 506 byte. 508 * L and the 'L' element of the 'info' array are the size of the key 509 for the Signature Encryption Algorithm from the Common Context 510 (see Section 2.1.5), in bytes. 512 2.1.7. Pairwise Key Agreement Algorithm 514 Pairwise Key Agreement Algorithm identifies the elliptic curve 515 Diffie-Hellman algorithm used to derive a static-static Diffie- 516 Hellman shared secret, from which pairwise keys are derived (see 517 Section 2.4.1) to protect messages with the pairwise mode (see 518 Section 9). This parameter is immutable once the Common Context is 519 established. 521 2.2. Sender Context and Recipient Context 523 OSCORE specifies the derivation of Sender Context and Recipient 524 Context, specifically of Sender/Recipient Keys and Common IV, from a 525 set of input parameters (see Section 3.2 of [RFC8613]). 527 The derivation of Sender/Recipient Keys and Common IV defined in 528 OSCORE applies also to Group OSCORE, with the following extensions 529 compared to Section 3.2.1 of [RFC8613]. 531 * If the group uses (also) the group mode, the 'alg_aead' element of 532 the 'info' array takes the value of Signature Encryption Algorithm 533 from the Common Context (see Section 2.1.5). 535 * If the group uses only the pairwise mode, the 'alg_aead' element 536 of the 'info' array takes the value of AEAD Algorithm from the 537 Common Context (see Section 2.1.1). 539 The Sender ID SHALL be unique for each endpoint in a group with a 540 certain tuple (Master Secret, Master Salt, Group Identifier), see 541 Section 3.3 of [RFC8613]. 543 For Group OSCORE, the Sender Context and Recipient Context 544 additionally contain asymmetric keys, as described previously in 545 Section 2. The private/public key pair of the sender can, for 546 example, be generated by the endpoint or provisioned during 547 manufacturing. 549 With the exception of the public key of the sender endpoint and the 550 possibly associated pairwise keys, a receiver endpoint can derive a 551 complete Security Context from a received Group OSCORE message and 552 the Common Context. The public keys in the Recipient Contexts can be 553 retrieved from the Group Manager (see Section 3) upon joining the 554 group. A public key can alternatively be acquired from the Group 555 Manager at a later time, for example the first time a message is 556 received from a particular endpoint in the group (see Section 8.2 and 557 Section 8.4). 559 For severely constrained devices, it may be not feasible to 560 simultaneously handle the ongoing processing of a recently received 561 message in parallel with the retrieval of the sender endpoint's 562 public key. Such devices can be configured to drop a received 563 message for which there is no (complete) Recipient Context, and 564 retrieve the sender endpoint's public key in order to have it 565 available to verify subsequent messages from that endpoint. 567 An endpoint admits a maximum amount of Recipient Contexts for a same 568 Security Context, e.g., due to memory limitations. After reaching 569 that limit, the creation of a new Recipient Context results in an 570 overflow. When this happens, the endpoint has to delete a current 571 Recipient Context to install the new one. It is up to the 572 application to define policies for selecting the current Recipient 573 Context to delete. A newly installed Recipient Context that has 574 required to delete another Recipient Context is initialized with an 575 invalid Replay Window, and accordingly requires the endpoint to take 576 appropriate actions (see Section 2.5.1.2). 578 2.3. Format of Public Keys 580 In a group, the following MUST hold for the public key of each 581 endpoint as well as for the public key of the Group Manager. 583 * All public keys MUST be encoded according to the same format used 584 in the group. The format MUST provide the full set of information 585 related to the public key algorithm, including, e.g., the used 586 elliptic curve (when applicable). 588 * All public keys MUST be for the public key algorithm used in the 589 group and aligned with the possible associated parameters used in 590 the group, e.g., the used elliptic curve (when applicable). 592 If the group uses (also) the group mode, the public key algorithm is 593 the Signature Algorithm used in the group. If the group uses only 594 the pairwise mode, the public key algorithm is the Pairwise Key 595 Agreement Algorithm used in the group. 597 If CBOR Web Tokens (CWTs) or CWT Claims Sets (CCSs) [RFC8392] are 598 used as public key format, the public key algorithm is fully 599 described by a COSE key type and its "kty" and "crv" parameters. 601 If X.509 certificates [RFC7925] or C509 certificates 602 [I-D.ietf-cose-cbor-encoded-cert] are used as public key format, the 603 public key algorithm is fully described by the "algorithm" field of 604 the "SubjectPublicKeyInfo" structure, and by the 605 "subjectPublicKeyAlgorithm" element, respectively. 607 Public keys are also used to derive pairwise keys (see Section 2.4.1) 608 and are included in the external additional authenticated data (see 609 Section 4.3). In both of these cases, an endpoint in a group MUST 610 treat public keys as opaque data, i.e., by considering the same 611 binary representation made available to other endpoints in the group, 612 possibly through a designated trusted source (e.g., the Group 613 Manager). 615 For example, an X.509 certificate is provided as its direct binary 616 serialization. If C509 certificates or CWTs are used as credential 617 format, they are provided as the binary serialization of a (possibly 618 tagged) CBOR array. If a CWT claim set is used as credential format, 619 it is provided as the binary serialization of a CBOR map. 621 2.4. Pairwise Keys 623 Certain signature schemes, such as EdDSA and ECDSA, support a secure 624 combined signature and encryption scheme. This section specifies the 625 derivation of "pairwise keys", for use in the pairwise mode defined 626 in Section 9. Group OSCORE keys used for both signature and 627 encryption MUST NOT be used for any other purposes than Group OSCORE. 629 2.4.1. Derivation of Pairwise Keys 631 Using the Group OSCORE Security Context (see Section 2), a group 632 member can derive AEAD keys, to protect point-to-point communication 633 between itself and any other endpoint in the group by means of the 634 AEAD Algorithm from the Common Context (see Section 2.1.1). The key 635 derivation of these so-called pairwise keys follows the same 636 construction as in Section 3.2.1 of [RFC8613]: 638 Pairwise Sender Key = HKDF(Sender Key, IKM-Sender, info, L) 639 Pairwise Recipient Key = HKDF(Recipient Key, IKM-Recipient, info, L) 641 with 643 IKM-Sender = Sender Pub Key | Recipient Pub Key | Shared Secret 644 IKM-Recipient = Recipient Pub Key | Sender Pub Key | Shared Secret 646 where: 648 * The Pairwise Sender Key is the AEAD key for processing outgoing 649 messages addressed to endpoint X. 651 * The Pairwise Recipient Key is the AEAD key for processing incoming 652 messages from endpoint X. 654 * HKDF is the OSCORE HKDF algorithm [RFC8613] from the Common 655 Context. 657 * The Sender Key from the Sender Context is used as salt in the 658 HKDF, when deriving the Pairwise Sender Key. 660 * The Recipient Key from the Recipient Context associated to 661 endpoint X is used as salt in the HKDF, when deriving the Pairwise 662 Recipient Key. 664 * IKM-Sender is the Input Keying Material (IKM) used in the HKDF for 665 the derivation of the Pairwise Sender Key. IKM-Sender is the byte 666 string concatenation of the endpoint's own (signature) public key, 667 the endpoint X's (signature) public key from the Recipient 668 Context, and the Shared Secret. The two (signature) public keys 669 are binary encoded as defined in Section 2.3. 671 * IKM-Recipient is the Input Keying Material (IKM) used in the HKDF 672 for the derivation of the Recipient Sender Key. IKM-Recipient is 673 the byte string concatenation of the endpoint X's (signature) 674 public key from the Recipient Context, the endpoint's own 675 (signature) public key, and the Shared Secret. The two 676 (signature) public keys are binary encoded as defined in 677 Section 2.3. 679 * The Shared Secret is computed as a cofactor Diffie-Hellman shared 680 secret, see Section 5.7.1.2 of [NIST-800-56A], using the Pairwise 681 Key Agreement Algorithm. The endpoint uses its private key from 682 the Sender Context and the public key of the other endpoint X from 683 the associated Recipient Context. Note the requirement of 684 validation of public keys in Section 11.15. For X25519 and X448, 685 the procedure is described in Section 5 of [RFC7748] using public 686 keys mapped to Montgomery coordinates, see Section 2.4.2. 688 * info and L are as defined in Section 3.2.1 of [RFC8613]. That is: 690 - The 'alg_aead' element of the 'info' array takes the value of 691 AEAD Algorithm from the Common Context (see Section 2.1.1). 693 - L and the 'L' element of the 'info' array are the size of the 694 key for the AEAD Algorithm from the Common Context (see 695 Section 2.1.1), in bytes. 697 If EdDSA asymmetric keys are used, the Edward coordinates are mapped 698 to Montgomery coordinates using the maps defined in Sections 4.1 and 699 4.2 of [RFC7748], before using the X25519 and X448 functions defined 700 in Section 5 of [RFC7748]. For further details, see Section 2.4.2. 701 ECC asymmetric keys in Montgomery or Weirstrass form are used 702 directly in the key agreement algorithm without coordinate mapping. 704 After establishing a partially or completely new Security Context 705 (see Section 2.5 and Section 3.2), the old pairwise keys MUST be 706 deleted. Since new Sender/Recipient Keys are derived from the new 707 group keying material (see Section 2.2), every group member MUST use 708 the new Sender/Recipient Keys when deriving new pairwise keys. 710 As long as any two group members preserve the same asymmetric keys, 711 their Diffie-Hellman shared secret does not change across updates of 712 the group keying material. 714 2.4.2. ECDH with Montgomery Coordinates 716 2.4.2.1. Curve25519 718 The y-coordinate of the other endpoint's Ed25519 public key is 719 decoded as specified in Section 5.1.3 of [RFC8032]. The Curve25519 720 u-coordinate is recovered as u = (1 + y) / (1 - y) (mod p) following 721 the map in Section 4.1 of [RFC7748]. Note that the mapping is not 722 defined for y = 1, and that y = -1 maps to u = 0 which corresponds to 723 the neutral group element and thus will result in a degenerate shared 724 secret. Therefore implementations MUST abort if the y-coordinate of 725 the other endpoint's Ed25519 public key is 1 or -1 (mod p). 727 The private signing key byte strings (= the lower 32 bytes used for 728 generating the public key, see step 1 of Section 5.1.5 of [RFC8032]) 729 are decoded the same way for signing in Ed25519 and scalar 730 multiplication in X25519. Hence, to compute the shared secret the 731 endpoint applies the X25519 function to the Ed25519 private signing 732 key byte string and the encoded u-coordinate byte string as specified 733 in Section 5 of [RFC7748]. 735 2.4.2.2. Curve448 737 The y-coordinate of the other endpoint's Ed448 public key is decoded 738 as specified in Section 5.2.3. of [RFC8032]. The Curve448 739 u-coordinate is recovered as u = y^2 * (d * y^2 - 1) / (y^2 - 1) (mod 740 p) following the map from "edwards448" in Section 4.2 of [RFC7748], 741 and also using the relation x^2 = (y^2 - 1)/(d * y^2 - 1) from the 742 curve equation. Note that the mapping is not defined for y = 1 or 743 -1. Therefore implementations MUST abort if the y-coordinate of the 744 peer endpoint's Ed448 public key is 1 or -1 (mod p). 746 The private signing key byte strings (= the lower 57 bytes used for 747 generating the public key, see step 1 of Section 5.2.5 of [RFC8032]) 748 are decoded the same way for signing in Ed448 and scalar 749 multiplication in X448. Hence, to compute the shared secret the 750 endpoint applies the X448 function to the Ed448 private signing key 751 byte string and the encoded u-coordinate byte string as specified in 752 Section 5 of [RFC7748]. 754 2.4.3. Usage of Sequence Numbers 756 When using any of its Pairwise Sender Keys, a sender endpoint 757 including the 'Partial IV' parameter in the protected message MUST 758 use the current fresh value of the Sender Sequence Number from its 759 Sender Context (see Section 2.2). That is, the same Sender Sequence 760 Number space is used for all outgoing messages protected with Group 761 OSCORE, thus limiting both storage and complexity. 763 On the other hand, when combining group and pairwise communication 764 modes, this may result in the Partial IV values moving forward more 765 often. This can happen when a client engages in frequent or long 766 sequences of one-to-one exchanges with servers in the group, by 767 sending requests over unicast. 769 2.4.4. Security Context for Pairwise Mode 771 If the pairwise mode is supported, the Security Context additionally 772 includes Pairwise Key Agreement Algorithm and the pairwise keys, as 773 described at the beginning of Section 2. 775 The pairwise keys as well as the shared secrets used in their 776 derivation (see Section 2.4.1) may be stored in memory or recomputed 777 every time they are needed. The shared secret changes only when a 778 public/private key pair used for its derivation changes, which 779 results in the pairwise keys also changing. Additionally, the 780 pairwise keys change if the Sender ID changes or if a new Security 781 Context is established for the group (see Section 2.5.3). In order 782 to optimize protocol performance, an endpoint may store the derived 783 pairwise keys for easy retrieval. 785 In the pairwise mode, the Sender Context includes the Pairwise Sender 786 Keys to use with the other endpoints (see Figure 1). In order to 787 identify the right key to use, the Pairwise Sender Key for endpoint X 788 may be associated to the Recipient ID of endpoint X, as defined in 789 the Recipient Context (i.e., the Sender ID from the point of view of 790 endpoint X). In this way, the Recipient ID can be used to lookup for 791 the right Pairwise Sender Key. This association may be implemented in 792 different ways, e.g., by storing the pair (Recipient ID, Pairwise 793 Sender Key) or linking a Pairwise Sender Key to a Recipient Context. 795 2.5. Update of Security Context 797 It is RECOMMENDED that the immutable part of the Security Context is 798 stored in non-volatile memory, or that it can otherwise be reliably 799 accessed throughout the operation of the group, e.g., after a device 800 reboots. However, also immutable parts of the Security Context may 801 need to be updated, for example due to scheduled key renewal, new or 802 re-joining members in the group, or the fact that the endpoint 803 changes Sender ID (see Section 2.5.3). 805 On the other hand, the mutable parts of the Security Context are 806 updated by the endpoint when executing the security protocol, but may 807 nevertheless become outdated, e.g., due to loss of the mutable 808 Security Context (see Section 2.5.1) or exhaustion of Sender Sequence 809 Numbers (see Section 2.5.2). 811 If it is not feasible or practically possible to store and maintain 812 up-to-date the mutable part in non-volatile memory (e.g., due to 813 limited number of write operations), the endpoint MUST be able to 814 detect a loss of the mutable Security Context and MUST accordingly 815 take the actions defined in Section 2.5.1. 817 2.5.1. Loss of Mutable Security Context 819 An endpoint may lose its mutable Security Context, e.g., due to a 820 reboot (see Section 2.5.1.1) or to an overflow of Recipient Contexts 821 (see Section 2.5.1.2). 823 In such a case, the endpoint needs to prevent the re-use of a nonce 824 with the same AEAD key, and to handle incoming replayed messages. 826 2.5.1.1. Reboot and Total Loss 828 In case a loss of the Sender Context and/or of the Recipient Contexts 829 is detected (e.g., following a reboot), the endpoint MUST NOT protect 830 further messages using this Security Context to avoid reusing an AEAD 831 nonce with the same AEAD key. 833 In particular, before resuming its operations in the group, the 834 endpoint MUST retrieve new Security Context parameters from the Group 835 Manager (see Section 2.5.3) and use them to derive a new Sender 836 Context (see Section 2.2). Since this includes a newly derived 837 Sender Key, a server will not reuse the same pair (key, nonce), even 838 when using the Partial IV of (old re-injected) requests to build the 839 AEAD nonce for protecting the corresponding responses. 841 From then on, the endpoint MUST use the latest installed Sender 842 Context to protect outgoing messages. Also, newly created Recipient 843 Contexts will have a Replay Window which is initialized as valid. 845 If not able to establish an updated Sender Context, e.g., because of 846 lack of connectivity with the Group Manager, the endpoint MUST NOT 847 protect further messages using the current Security Context and MUST 848 NOT accept incoming messages from other group members, as currently 849 unable to detect possible replays. 851 2.5.1.2. Overflow of Recipient Contexts 853 After reaching the maximum amount of Recipient Contexts, an endpoint 854 will experience an overflow when installing a new Recipient Context, 855 as it requires to first delete an existing one (see Section 2.2). 857 Every time this happens, the Replay Window of the new Recipient 858 Context is initialized as not valid. Therefore, the endpoint MUST 859 take the following actions, before accepting request messages from 860 the client associated to the new Recipient Context. 862 If it is not configured as silent server, the endpoint MUST either: 864 * Retrieve new Security Context parameters from the Group Manager 865 and derive a new Sender Context, as defined in Section 2.5.1.1; or 867 * When receiving a first request to process with the new Recipient 868 Context, use the approach specified in Appendix E and based on the 869 Echo Option for CoAP [I-D.ietf-core-echo-request-tag], if 870 supported. In particular, the endpoint MUST use its Partial IV 871 when generating the AEAD nonce and MUST include the Partial IV in 872 the response message conveying the Echo Option. If the endpoint 873 supports the CoAP Echo Option, it is RECOMMENDED to take this 874 approach. 876 If it is configured exclusively as silent server, the endpoint MUST 877 wait for the next group rekeying to occur, in order to derive a new 878 Security Context and re-initialize the Replay Window of each 879 Recipient Contexts as valid. 881 2.5.2. Exhaustion of Sender Sequence Number 883 An endpoint can eventually exhaust the Sender Sequence Number, which 884 is incremented for each new outgoing message including a Partial IV. 885 This is the case for group requests, Observe notifications [RFC7641] 886 and, optionally, any other response. 888 Implementations MUST be able to detect an exhaustion of Sender 889 Sequence Number, after the endpoint has consumed the largest usable 890 value. If an implementation's integers support wrapping addition, 891 the implementation MUST treat Sender Sequence Number as exhausted 892 when a wrap-around is detected. 894 Upon exhausting the Sender Sequence Numbers, the endpoint MUST NOT 895 use this Security Context to protect further messages including a 896 Partial IV. 898 The endpoint SHOULD inform the Group Manager, retrieve new Security 899 Context parameters from the Group Manager (see Section 2.5.3), and 900 use them to derive a new Sender Context (see Section 2.2). 902 From then on, the endpoint MUST use its latest installed Sender 903 Context to protect outgoing messages. 905 2.5.3. Retrieving New Security Context Parameters 907 The Group Manager can assist an endpoint with an incomplete Sender 908 Context to retrieve missing data of the Security Context and thereby 909 become fully operational in the group again. The two main options 910 for the Group Manager are described in this section: i) assignment of 911 a new Sender ID to the endpoint (see Section 2.5.3.1); and ii) 912 establishment of a new Security Context for the group (see 913 Section 2.5.3.2). The update of the Replay Window in each of the 914 Recipient Contexts is discussed in Section 6.2. 916 As group membership changes, or as group members get new Sender IDs 917 (see Section 2.5.3.1) so do the relevant Recipient IDs that the other 918 endpoints need to keep track of. As a consequence, group members may 919 end up retaining stale Recipient Contexts, that are no longer useful 920 to verify incoming secure messages. 922 The Recipient ID ('kid') SHOULD NOT be considered as a persistent and 923 reliable indicator of a group member. Such an indication can be 924 achieved only by using that member's public key, when verifying 925 countersignatures of received messages (in group mode), or when 926 verifying messages integrity-protected with pairwise keying material 927 derived from asymmetric keys (in pairwise mode). 929 Furthermore, applications MAY define policies to: i) delete 930 (long-)unused Recipient Contexts and reduce the impact on storage 931 space; as well as ii) check with the Group Manager that a public key 932 is currently the one associated to a 'kid' value, after a number of 933 consecutive failed verifications. 935 2.5.3.1. New Sender ID for the Endpoint 937 The Group Manager may assign a new Sender ID to an endpoint, while 938 leaving the Gid, Master Secret and Master Salt unchanged in the 939 group. In this case, the Group Manager MUST assign a Sender ID that 940 has not been used in the group since the latest time when the current 941 Gid value was assigned to the group (see Section 3.2). 943 Having retrieved the new Sender ID, and potentially other missing 944 data of the immutable Security Context, the endpoint can derive a new 945 Sender Context (see Section 2.2). When doing so, the endpoint resets 946 the Sender Sequence Number in its Sender Context to 0, and derives a 947 new Sender Key. This is in turn used to possibly derive new Pairwise 948 Sender Keys. 950 From then on, the endpoint MUST use its latest installed Sender 951 Context to protect outgoing messages. 953 The assignment of a new Sender ID may be the result of different 954 processes. The endpoint may request a new Sender ID, e.g., because 955 of exhaustion of Sender Sequence Numbers (see Section 2.5.2). An 956 endpoint may request to re-join the group, e.g., because of losing 957 its mutable Security Context (see Section 2.5.1), and is provided 958 with a new Sender ID together with the latest immutable Security 959 Context. 961 For the other group members, the Recipient Context corresponding to 962 the old Sender ID becomes stale (see Section 3.2). 964 2.5.3.2. New Security Context for the Group 966 The Group Manager may establish a new Security Context for the group 967 (see Section 3.2). The Group Manager does not necessarily establish 968 a new Security Context for the group if one member has an outdated 969 Security Context (see Section 2.5.3.1), unless that was already 970 planned or required for other reasons. 972 All the group members need to acquire new Security Context parameters 973 from the Group Manager. Once having acquired new Security Context 974 parameters, each group member performs the following actions. 976 * From then on, it MUST NOT use the current Security Context to 977 start processing new messages for the considered group. 979 * It completes any ongoing message processing for the considered 980 group. 982 * It derives and install a new Security Context. In particular: 984 - It re-derives the keying material stored in its Sender Context 985 and Recipient Contexts (see Section 2.2). The Master Salt used 986 for the re-derivations is the updated Master Salt parameter if 987 provided by the Group Manager, or the empty byte string 988 otherwise. 990 - It resets to 0 its Sender Sequence Number in its Sender 991 Context. 993 - It re-initializes the Replay Window of each Recipient Context. 995 - For each ongoing observation where it is an observer client and 996 that it wants to keep active, it resets to 0 the Notification 997 Number of each associated server (see Section 6.1). 999 From then on, it can resume processing new messages for the 1000 considered group. In particular: 1002 * It MUST use its latest installed Sender Context to protect 1003 outgoing messages. 1005 * It SHOULD use its latest installed Recipient Contexts to process 1006 incoming messages, unless application policies admit to 1007 temporarily retain and use the old, recent, Security Context (see 1008 Section 11.5.1). 1010 The distribution of a new Gid and Master Secret may result in 1011 temporarily misaligned Security Contexts among group members. In 1012 particular, this may result in a group member not being able to 1013 process messages received right after a new Gid and Master Secret 1014 have been distributed. A discussion on practical consequences and 1015 possible ways to address them, as well as on how to handle the old 1016 Security Context, is provided in Section 11.5. 1018 3. The Group Manager 1020 As with OSCORE, endpoints communicating with Group OSCORE need to 1021 establish the relevant Security Context. Group OSCORE endpoints need 1022 to acquire OSCORE input parameters, information about the group(s) 1023 and about other endpoints in the group(s). This document is based on 1024 the existence of an entity called Group Manager and responsible for 1025 the group, but it does not mandate how the Group Manager interacts 1026 with the group members. The responsibilities of the Group Manager 1027 are compiled together in Section 3.3. 1029 It is RECOMMENDED to use a Group Manager as described in 1030 [I-D.ietf-ace-key-groupcomm-oscore], where the join process is based 1031 on the ACE framework for authentication and authorization in 1032 constrained environments [I-D.ietf-ace-oauth-authz]. 1034 The Group Manager assigns an integer Key Generation Number to each of 1035 its groups, identifying the current version of the keying material 1036 used in that group. The first Key Generation Number assigned to 1037 every group MUST be 0. Separately for each group, the value of the 1038 Key Generation Number increases strictly monotonically, each time the 1039 Group Manager distributes new keying material to that group (see 1040 Section 3.2). That is, if the current Key Generation Number for a 1041 group is X, then X+1 will denote the keying material distributed and 1042 used in that group immediately after the current one. 1044 The Group Manager assigns unique Group Identifiers (Gids) to the 1045 groups under its control. Also, for each group, the Group Manager 1046 assigns unique Sender IDs (and thus Recipient IDs) to the respective 1047 group members. According to a hierarchical approach, the Gid value 1048 assigned to a group is associated to a dedicated space for the values 1049 of Sender ID and Recipient ID of the members of that group. 1051 When a node (re-)joins a group, it is provided also with the current 1052 Gid to use in the group, namely the Birth Gid of that node for that 1053 group. For each group member, the Group Manager MUST store the 1054 latest corresponding Birth Gid until that member leaves the group. 1055 In case the node has in fact re-joined the group, the newly 1056 determined Birth Gid overwrites the one currently stored. 1058 The Group Manager maintains records of the public keys of endpoints 1059 in a group, and provides information about the group and its members 1060 to other group members and to external principals with selected roles 1061 (see Section 3.1). Upon nodes' joining, the Group Manager collects 1062 such public keys and MUST verify proof-of-possession of the 1063 respective private key. 1065 An endpoint acquires group data such as the Gid and OSCORE input 1066 parameters including its own Sender ID from the Group Manager, and 1067 provides information about its public key to the Group Manager, for 1068 example upon joining the group. 1070 Furthermore, when joining the group or later on as a group member, an 1071 endpoint can retrieve from the Group Manager the public key of the 1072 Group Manager as well as the public key and other information 1073 associated to other members of the group, with which it can derive 1074 the corresponding Recipient Context. Together with the requested 1075 public keys, the Group Manager MUST provide the Sender ID of the 1076 associated group members and the current Key Generation Number in the 1077 group. An application can configure a group member to asynchronously 1078 retrieve information about Recipient Contexts, e.g., by Observing 1079 [RFC7641] a resource at the Group Manager to get updates on the group 1080 membership. 1082 3.1. Support for Additional Principals 1084 The Group Manager MAY serve additional principals acting as signature 1085 checkers, e.g., intermediary gateways. These principals do not join 1086 a group as members, but can retrieve public keys of group members and 1087 other selected group data from the Group Manager, in order to solely 1088 verify countersignatures of messages protected in group mode (see 1089 Section 8.5). 1091 In order to verify countersignatures of messages in a group, a 1092 signature checker needs to retrieve the following information about 1093 that group from the Group Manager. 1095 * The current ID Context (Gid) used in the group. 1097 * The public keys of the group members and the public key of the 1098 Group Manager. 1100 * The current Group Encryption Key (see Section 2.1.6). 1102 * The identifiers of the algorithms used in the group (see 1103 Section 2), i.e.: i) Signature Encryption Algorithm and Signature 1104 Algorithm; and ii) AEAD Algorithm and Pairwise Key Agreement 1105 Algorithm, if the group uses also the pairwise mode. 1107 A signature checker MUST be authorized before it can retrieve such 1108 information. To this end, the same method mentioned above based on 1109 the ACE framework [I-D.ietf-ace-oauth-authz] can be used. 1111 3.2. Management of Group Keying Material 1113 In order to establish a new Security Context for a group, the Group 1114 Manager MUST generate and assign to the group a new Group Identifier 1115 (Gid) and a new value for the Master Secret parameter. When doing 1116 so, a new value for the Master Salt parameter MAY also be generated 1117 and assigned to the group. When establishing the new Security 1118 Context, the Group Manager should preserve the current value of the 1119 Sender ID of each group member. 1121 The specific group key management scheme used to distribute new 1122 keying material, is out of the scope of this document. However, it 1123 is RECOMMENDED that the Group Manager supports the Group Rekeying 1124 Process described in [I-D.ietf-ace-key-groupcomm-oscore]. When 1125 possible, the delivery of rekeying messages should use a reliable 1126 transport, in order to reduce chances of group members missing a 1127 rekeying instance. 1129 The set of group members should not be assumed as fixed, i.e., the 1130 group membership is subject to changes, possibly on a frequent basis. 1131 The Group Manager MUST rekey the group when one or more currently 1132 present endpoints leave the group, or in order to evict them as 1133 compromised or suspected so. In either case, this excludes such 1134 nodes from future communications in the group, and thus preserves 1135 forward security. If required by the application, the Group Manager 1136 MUST rekey the group also before one or more new joining endpoints 1137 are added to the group, thus preserving backward security. 1139 The establishment of the new Security Context for the group takes the 1140 following steps. 1142 1. The Group Manager MUST increment by 1 the Key Generation Number 1143 for the group. 1145 2. The Group Manager MUST check if the new Gid to be distributed 1146 coincides with the Birth Gid of any of the current group members. 1147 If any of such "elder members" is found in the group, then: 1149 * The Group Manager MUST evict the elder members from the group. 1150 That is, the Group Manager MUST terminate their membership and 1151 MUST rekey the group in such a way that the new keying 1152 material is not provided to those evicted elder members. This 1153 ensures that an Observe notification [RFC7641] can never 1154 successfully match against the Observe requests of two 1155 different observations. 1157 * Until a further following group rekeying, the Group Manager 1158 MUST store the list of those latest-evicted elder members. If 1159 any of those endpoints re-joins the group before a further 1160 following group rekeying occurs, the Group Manager MUST NOT 1161 rekey the group upon their re-joining. When one of those 1162 endpoints re-joins the group, the Group Manager can rely, 1163 e.g., on the ongoing secure communication association to 1164 recognize the endpoint as included in the stored list. 1166 3. The Group Manager MUST build a set of stale Sender IDs including: 1168 * The Sender IDs that, during the current Gid, were both 1169 assigned to an endpoint and subsequently relinquished (see 1170 Section 2.5.3.1). 1172 * The current Sender IDs of the group members that the upcoming 1173 group rekeying aims to exclude from future group 1174 communications, if any. 1176 4. The Group Manager rekeys the group, by distributing: 1178 * The new keying material, i.e., the new Master Secret, the new 1179 Gid and (optionally) the new Master Salt. 1181 * The new Key Generation Number from step 1. 1183 * The set of stale Sender IDs from step 3. 1185 Further information may be distributed, depending on the specific 1186 group key management scheme used in the group. 1188 When receiving the new group keying materal, a group member considers 1189 the received stale Sender IDs and performs the following actions. 1191 * The group member MUST remove every public key associated to a 1192 stale Sender ID from its list of group members' public keys used 1193 in the group. 1195 * The group member MUST delete each of its Recipient Contexts used 1196 in the group whose corresponding Recipient ID is a stale Sender 1197 ID. 1199 After that, the group member installs the new keying material and 1200 derives the corresponding new Security Context. 1202 A group member might miss one group rekeying or more consecutive 1203 instances. As a result, the group member will retain old group 1204 keying material with Key Generation Number GEN_OLD. Eventually, the 1205 group member can notice the discrepancy, e.g., by repeatedly failing 1206 to verify incoming messages, or by explicitly querying the Group 1207 Manager for the current Key Generation Number. Once the group member 1208 gains knowledge of having missed a group rekeying, it MUST delete the 1209 old keying material it owns. 1211 Then, the group member proceeds according to the following steps. 1213 1. The group member retrieves from the Group Manager the current 1214 group keying material, together with the current Key Generation 1215 Number GEN_NEW. The group member MUST NOT install the obtained 1216 group keying material yet. 1218 2. The group member asks the Group Manager for the set of stale 1219 Sender IDs. 1221 3. If no exact indication can be obtained from the Group Manager, 1222 the group member MUST remove all the public keys from its list of 1223 group members' public keys used in the group and MUST delete all 1224 its Recipient Contexts used in the group. 1226 Otherwise, the group member MUST remove every public key 1227 associated to a stale Sender ID from its list of group members' 1228 public keys used in the group, and MUST delete each of its 1229 Recipient Contexts used in the group whose corresponding 1230 Recipient ID is a stale Sender ID. 1232 4. The group member installs the current group keying material, and 1233 derives the corresponding new Security Context. 1235 Alternatively, the group member can re-join the group. In such a 1236 case, the group member MUST take one of the following two actions. 1238 * The group member performs steps 2 and 3 above. Then, the group 1239 member re-joins the group. 1241 * The group member re-joins the group with the same roles it 1242 currently has in the group, and, during the re-joining process, it 1243 asks the Group Manager for the public keys of all the current 1244 group members. 1246 Then, given Z the set of public keys received from the Group 1247 Manager, the group member removes every public key which is not in 1248 Z from its list of group members' public keys used in the group, 1249 and deletes each of its Recipient Contexts used in the group that 1250 does not include any of the public keys in Z. 1252 By removing public keys and deleting Recipient Contexts associated to 1253 stale Sender IDs, it is ensured that a recipient endpoint owning the 1254 latest group keying material does not store the public keys of sender 1255 endpoints that are not current group members. This in turn allows 1256 group members to rely on owned public keys to confidently assert the 1257 group membership of sender endpoints, when receiving incoming 1258 messages protected in group mode (see Section 8). 1260 3.2.1. Recycling of Identifiers 1262 Although the Gid value changes every time a group is rekeyed, the 1263 Group Manager can reassign a Gid to the same group over that group's 1264 lifetime. This would happen, for instance, once the whole space of 1265 Gid values has been used for the group in question. 1267 From the moment when a Gid is assigned to a group until the moment a 1268 new Gid is assigned to that same group, the Group Manager MUST NOT 1269 reassign a Sender ID within the group. This prevents to reuse a 1270 Sender ID ('kid') with the same Gid, Master Secret and Master Salt. 1271 Within this restriction, the Group Manager can assign a Sender ID 1272 used under an old Gid value (including under a same, recycled Gid 1273 value), thus avoiding Sender ID values to irrecoverably grow in size. 1275 Even when an endpoint joining a group is recognized as a current 1276 member of that group, e.g., through the ongoing secure communication 1277 association, the Group Manager MUST assign a new Sender ID different 1278 than the one currently used by the endpoint in the group, unless the 1279 group is rekeyed first and a new Gid value is established. 1281 Figure 2 overviews the different keying material components, 1282 considering their relation and possible reuse across group rekeying. 1284 Components changed in lockstep 1285 upon a group rekeying 1286 +----------------------------+ * Changing a kid does not 1287 | | need changing the Group ID 1288 | Master Group |<--> kid1 1289 | Secret <---> o <---> ID | * A kid is not reassigned 1290 | ^ |<--> kid2 under the ongoing usage of 1291 | | | the current Group ID 1292 | | |<--> kid3 1293 | v | * Upon changing the Group ID, 1294 | Master Salt | ... ... every current kid should 1295 | (optional) | be preserved for efficient 1296 | | key rollover 1297 | The Key Generation Number | 1298 | is incremented by 1 | * After changing Group ID, an 1299 | | unused kid can be assigned 1300 +----------------------------+ 1302 Figure 2: Relations among keying material components. 1304 3.3. Responsibilities of the Group Manager 1306 The Group Manager is responsible for performing the following tasks: 1308 1. Creating and managing OSCORE groups. This includes the 1309 assignment of a Gid to every newly created group, ensuring 1310 uniqueness of Gids within the set of its OSCORE groups, and 1311 tracking the Birth Gids of current group members in each group. 1313 2. Defining policies for authorizing the joining of its OSCORE 1314 groups. 1316 3. Handling the join process to add new endpoints as group members. 1318 4. Establishing the Common Context part of the Security Context, 1319 and providing it to authorized group members during the join 1320 process, together with the corresponding Sender Context. 1322 5. Updating the Key Generation Number and the Gid of its OSCORE 1323 groups, upon renewing the respective Security Context. 1325 6. Generating and managing Sender IDs within its OSCORE groups, as 1326 well as assigning and providing them to new endpoints during the 1327 join process, or to current group members upon request of 1328 renewal or re-joining. This includes ensuring that: 1330 * Each Sender ID is unique within each of the OSCORE groups; 1332 * Each Sender ID is not reassigned within the same group since 1333 the latest time when the current Gid value was assigned to 1334 the group. That is, the Sender ID is not reassigned even to 1335 a current group member re-joining the same group, without a 1336 rekeying happening first. 1338 7. Defining communication policies for each of its OSCORE groups, 1339 and signaling them to new endpoints during the join process. 1341 8. Renewing the Security Context of an OSCORE group upon membership 1342 change, by revoking and renewing common security parameters and 1343 keying material (rekeying). 1345 9. Providing the management keying material that a new endpoint 1346 requires to participate in the rekeying process, consistently 1347 with the key management scheme used in the group joined by the 1348 new endpoint. 1350 10. Assisting a group member that has missed a group rekeying 1351 instance to understand which public keys and Recipient Contexts 1352 to delete, as associated to former group members. 1354 11. Acting as key repository, in order to handle the public keys of 1355 the members of its OSCORE groups, and providing such public keys 1356 to other members of the same group upon request. The actual 1357 storage of public keys may be entrusted to a separate secure 1358 storage device or service. 1360 12. Validating that the format and parameters of public keys of 1361 group members are consistent with the public key algorithm and 1362 related parameters used in the respective OSCORE group. 1364 The Group Manager described in [I-D.ietf-ace-key-groupcomm-oscore] 1365 provides these functionalities. 1367 4. The COSE Object 1369 Building on Section 5 of [RFC8613], this section defines how to use 1370 COSE [I-D.ietf-cose-rfc8152bis-struct] to wrap and protect data in 1371 the original message. OSCORE uses the untagged COSE_Encrypt0 1372 structure with an Authenticated Encryption with Associated Data 1373 (AEAD) algorithm. Unless otherwise specified, the following 1374 modifications apply for both the group mode and the pairwise mode of 1375 Group OSCORE. 1377 4.1. Countersignature 1379 When protecting a message in group mode, the 'unprotected' field MUST 1380 additionally include the following parameter: 1382 * COSE_CounterSignature0: its value is set to the encrypted 1383 countersignature of the COSE object, namely ENC_SIGNATURE. That 1384 is: 1386 - The countersignature of the COSE object, namely SIGNATURE, is 1387 computed by the sender as described in Sections 3.2 and 3.3 of 1388 [I-D.ietf-cose-countersign], by using its private key and 1389 according to the Signature Algorithm in the Security Context. 1391 In particular, the Countersign_structure contains the context 1392 text string "CounterSignature0", the external_aad as defined in 1393 Section 4.3 of this document, and the ciphertext of the COSE 1394 object as payload. 1396 - The encrypted countersignature, namely ENC_SIGNATURE, is 1397 computed as 1399 ENC_SIGNATURE = SIGNATURE XOR KEYSTREAM 1401 where KEYSTREAM is derived as per Section 4.1.1. 1403 4.1.1. Keystream Derivation 1405 The following defines how an endpoint derives the keystream 1406 KEYSTREAM, used to encrypt/decrypt the countersignature of an 1407 outgoing/incoming message M protected in group mode. 1409 The keystream SHALL be derived as follows, by using the HKDF 1410 Algorithm from the Common Context (see Section 3.2 of [RFC8613]), 1411 which consists of composing the HKDF-Extract and HKDF-Expand steps 1412 [RFC5869]. 1414 KEYSTREAM = HKDF(salt, IKM, info, L) 1416 The input parameters of HKDF are as follows. 1418 * salt takes as value the Partial IV (PIV) used to protect M. Note 1419 that, if M is a response, salt takes as value either: i) the fresh 1420 Partial IV generated by the server and included in the response; 1421 or ii) the same Partial IV of the request generated by the client 1422 and not included in the response. 1424 * IKM is the Group Encryption Key from the Common Context (see 1425 Section 2.1.6). 1427 * info is the serialization of a CBOR array consisting of (the 1428 notation follows [RFC8610]): 1430 info = [ 1431 id : bstr, 1432 id_context : bstr, 1433 type : bool, 1434 L: uint 1435 ] 1437 where: 1439 * id is the Sender ID of the endpoint that generated PIV. 1441 * id_context is the ID Context (Gid) used when protecting M. 1443 Note that, in case of group rekeying, a server might use a 1444 different Gid when protecting a response, compared to the Gid that 1445 it used to verify (that the client used to protect) the request, 1446 see Section 8.3. 1448 * type is the CBOR simple value True (0xf5) if M is a request, or 1449 the CBOR simple value False (0xf4) otherwise. 1451 * L is the size of the countersignature, as per Signature Algorithm 1452 from the Common Context (see Section 2.1.5), in bytes. 1454 4.1.2. Clarifications on Using a Countersignature 1456 Note that the literature commonly refers to a countersignature as a 1457 signature computed by a principal A over a document already protected 1458 by a different principal B. 1460 However, the COSE_Countersignature0 structure belongs to the set of 1461 abbreviated countersignatures defined in Sections 3.2 and 3.3 of 1462 [I-D.ietf-cose-countersign], which were designed primarily to deal 1463 with the problem of encrypted group messaging, but where it is 1464 required to know who originated the message. 1466 Since the parameters for computing or verifying the abbreviated 1467 countersignature generated by A are provided by the same context used 1468 to describe the security processing performed by B and to be 1469 countersigned, these structures are applicable also when the two 1470 principals A and B are actually the same one, like the sender of a 1471 Group OSCORE message protected in group mode. 1473 4.2. The 'kid' and 'kid context' parameters 1475 The value of the 'kid' parameter in the 'unprotected' field of 1476 response messages MUST be set to the Sender ID of the endpoint 1477 transmitting the message, if the request was protected in group mode. 1478 That is, unlike in [RFC8613], the 'kid' parameter is always present 1479 in responses to a request that was protected in group mode. 1481 The value of the 'kid context' parameter in the 'unprotected' field 1482 of requests messages MUST be set to the ID Context, i.e., the Group 1483 Identifier value (Gid) of the group. That is, unlike in [RFC8613], 1484 the 'kid context' parameter is always present in requests. 1486 4.3. external_aad 1488 The external_aad of the Additional Authenticated Data (AAD) is 1489 different compared to OSCORE [RFC8613], and is defined in this 1490 section. 1492 The same external_aad structure is used in group mode and pairwise 1493 mode for authenticated encryption/decryption (see Section 5.3 of 1494 [I-D.ietf-cose-rfc8152bis-struct]), as well as in group mode for 1495 computing and verifying the countersignature (see Section 4.4 of 1496 [I-D.ietf-cose-rfc8152bis-struct]). 1498 In particular, the external_aad includes also the Signature 1499 Algorithm, the Signature Encryption Algorithm, the Pairwise Key 1500 Agreement Algorithm, the value of the 'kid context' in the COSE 1501 object of the request, the OSCORE option of the protected message, 1502 the sender's public key, and the Group Manager's public key. 1504 The external_aad SHALL be a CBOR array wrapped in a bstr object as 1505 defined below, following the notation of [RFC8610]: 1507 external_aad = bstr .cbor aad_array 1509 aad_array = [ 1510 oscore_version : uint, 1511 algorithms : [alg_aead : int / tstr / null, 1512 alg_signature_enc : int / tstr / null, 1513 alg_signature : int / tstr / null, 1514 alg_pairwise_key_agreement : int / tstr / null], 1515 request_kid : bstr, 1516 request_piv : bstr, 1517 options : bstr, 1518 request_kid_context : bstr, 1519 OSCORE_option: bstr, 1520 sender_public_key: bstr, 1521 gm_public_key: bstr / null 1522 ] 1524 Figure 3: external_aad 1526 Compared with Section 5.4 of [RFC8613], the aad_array has the 1527 following differences. 1529 * The 'algorithms' array is extended as follows. 1531 The parameter 'alg_aead' MUST be set to the CBOR simple value Null 1532 if the group does not use the pairwise mode, regardless whether 1533 the endpoint supports the pairwise mode or not. Otherwise, this 1534 parameter MUST encode the value of AEAD Algorithm from the Common 1535 Context (see Section 2.1.1), as per Section 5.4 of [RFC8613]. 1537 Furthermore, the 'algorithms' array additionally includes: 1539 - 'alg_signature_enc', which specifies Signature Encryption 1540 Algorithm from the Common Context (see Section 2.1.5). This 1541 parameter MUST be set to the CBOR simple value Null if the 1542 group does not use the group mode, regardless whether the 1543 endpoint supports the group mode or not. Otherwise, this 1544 parameter MUST encode the value of Signature Encryption 1545 Algorithm as a CBOR integer or text string, consistently with 1546 the "Value" field in the "COSE Algorithms" Registry for this 1547 AEAD algorithm. 1549 - 'alg_signature', which specifies Signature Algorithm from the 1550 Common Context (see Section 2.1.5). This parameter MUST be set 1551 to the CBOR simple value Null if the group does not use the 1552 group mode, regardless whether the endpoint supports the group 1553 mode or not. Otherwise, this parameter MUST encode the value 1554 of Signature Algorithm as a CBOR integer or text string, 1555 consistently with the "Value" field in the "COSE Algorithms" 1556 Registry for this signature algorithm. 1558 - 'alg_pairwise_key_agreement', which specifies Pairwise Key 1559 Agreement Algorithm from the Common Context (see 1560 Section 2.1.5). This parameter MUST be set to the CBOR simple 1561 value Null if the group does not use the pairwise mode, 1562 regardless whether the endpoint supports the pairwise mode or 1563 not. Otherwise, this parameter MUST encode the value of 1564 Pairwise Key Agreement Algorithm as a CBOR integer or text 1565 string, consistently with the "Value" field in the "COSE 1566 Algorithms" Registry for this HKDF algorithm. 1568 * The new element 'request_kid_context' contains the value of the 1569 'kid context' in the COSE object of the request (see Section 4.2). 1571 In case Observe [RFC7641] is used, this enables endpoints to 1572 safely keep an observation active beyond a possible change of Gid 1573 (i.e., of ID Context), following a group rekeying (see 1574 Section 3.2). In fact, it ensures that every notification 1575 cryptographically matches with only one observation request, 1576 rather than with multiple ones that were protected with different 1577 keying material but share the same 'request_kid' and 'request_piv' 1578 values. 1580 * The new element 'OSCORE_option', containing the value of the 1581 OSCORE Option present in the protected message, encoded as a 1582 binary string. This prevents the attack described in Section 11.7 1583 when using the group mode, as further explained in Section 11.7.2. 1585 Note for implementation: this construction requires the OSCORE 1586 option of the message to be generated and finalized before 1587 computing the ciphertext of the COSE_Encrypt0 object (when using 1588 the group mode or the pairwise mode) and before calculating the 1589 countersignature (when using the group mode). Also, the aad_array 1590 needs to be large enough to contain the largest possible OSCORE 1591 option. 1593 * The new element 'sender_public_key', containing the sender's 1594 public key. This parameter MUST be set to a CBOR byte string, 1595 which encodes the sender's public key in its original binary 1596 representation made available to other endpoints in the group (see 1597 Section 2.3). 1599 * The new element 'gm_public_key', containing the Group Manager's 1600 public key. If no Group Manager maintains the group, this 1601 parameter MUST encode the CBOR simple value Null. Otherwise, this 1602 parameter MUST be set to a CBOR byte string, which encodes the 1603 Group Manager's public key in its original binary representation 1604 made available to other endpoints in the group (see Section 2.3). 1605 This prevents the attack described in Section 11.8. 1607 5. OSCORE Header Compression 1609 The OSCORE header compression defined in Section 6 of [RFC8613] is 1610 used, with the following differences. 1612 * The payload of the OSCORE message SHALL encode the ciphertext of 1613 the COSE_Encrypt0 object. In the group mode, the ciphertext above 1614 is concatenated with the value of the COSE_CounterSignature0 of 1615 the COSE object, computed as described in Section 4.1. 1617 * This document defines the usage of the sixth least significant 1618 bit, called "Group Flag", in the first byte of the OSCORE option 1619 containing the OSCORE flag bits. This flag bit is specified in 1620 Section 12.1. 1622 * The Group Flag MUST be set to 1 if the OSCORE message is protected 1623 using the group mode (see Section 8). 1625 * The Group Flag MUST be set to 0 if the OSCORE message is protected 1626 using the pairwise mode (see Section 9). The Group Flag MUST also 1627 be set to 0 for ordinary OSCORE messages processed according to 1628 [RFC8613]. 1630 5.1. Examples of Compressed COSE Objects 1632 This section covers a list of OSCORE Header Compression examples of 1633 Group OSCORE used in group mode (see Section 5.1.1) or in pairwise 1634 mode (see Section 5.1.2). 1636 The examples assume that the COSE_Encrypt0 object is set (which means 1637 the CoAP message and cryptographic material is known). Note that the 1638 examples do not include the full CoAP unprotected message or the full 1639 Security Context, but only the input necessary to the compression 1640 mechanism, i.e., the COSE_Encrypt0 object. The output is the 1641 compressed COSE object as defined in Section 5 and divided into two 1642 parts, since the object is transported in two CoAP fields: OSCORE 1643 option and payload. 1645 The examples assume that the plaintext (see Section 5.3 of [RFC8613]) 1646 is 6 bytes long, and that the AEAD tag is 8 bytes long, hence 1647 resulting in a ciphertext which is 14 bytes long. When using the 1648 group mode, the COSE_CounterSignature0 byte string as described in 1649 Section 4 is assumed to be 64 bytes long. 1651 5.1.1. Examples in Group Mode 1653 * Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 1654 0x25, Partial IV = 5 and kid context = 0x44616c. 1656 * Before compression (96 bytes): 1658 [ 1659 h'', 1660 { 4:h'25', 6:h'05', 10:h'44616c', 11:h'de9e ... f1' }, 1661 h'aea0155667924dff8a24e4cb35b9' 1662 ] 1664 * After compression (85 bytes): 1666 Flag byte: 0b00111001 = 0x39 (1 byte) 1668 Option Value: 0x39 05 03 44 61 6c 25 (7 bytes) 1670 Payload: 0xaea0155667924dff8a24e4cb35b9 de9e ... f1 1671 (14 bytes + size of the encrypted countersignature) 1673 * Response with ciphertext = 0x60b035059d9ef5667c5a0710823b, kid = 1674 0x52 and no Partial IV. 1676 * Before compression (88 bytes): 1678 [ 1679 h'', 1680 { 4:h'52', 11:h'ca1e ... b3' }, 1681 h'60b035059d9ef5667c5a0710823b' 1682 ] 1684 * After compression (80 bytes): 1686 Flag byte: 0b00101000 = 0x28 (1 byte) 1688 Option Value: 0x28 52 (2 bytes) 1690 Payload: 0x60b035059d9ef5667c5a0710823b ca1e ... b3 1691 (14 bytes + size of the encrypted countersignature) 1693 5.1.2. Examples in Pairwise Mode 1695 * Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 1696 0x25, Partial IV = 5 and kid context = 0x44616c. 1698 * Before compression (29 bytes): 1700 [ 1701 h'', 1702 { 4:h'25', 6:h'05', 10:h'44616c' }, 1703 h'aea0155667924dff8a24e4cb35b9' 1704 ] 1706 * After compression (21 bytes): 1708 Flag byte: 0b00011001 = 0x19 (1 byte) 1710 Option Value: 0x19 05 03 44 61 6c 25 (7 bytes) 1712 Payload: 0xaea0155667924dff8a24e4cb35b9 (14 bytes) 1714 * Response with ciphertext = 0x60b035059d9ef5667c5a0710823b and no 1715 Partial IV. 1717 * Before compression (18 bytes): 1719 [ 1720 h'', 1721 {}, 1722 h'60b035059d9ef5667c5a0710823b' 1723 ] 1725 * After compression (14 bytes): 1727 Flag byte: 0b00000000 = 0x00 (1 byte) 1729 Option Value: 0x (0 bytes) 1731 Payload: 0x60b035059d9ef5667c5a0710823b (14 bytes) 1733 6. Message Binding, Sequence Numbers, Freshness and Replay Protection 1735 The requirements and properties described in Section 7 of [RFC8613] 1736 also apply to Group OSCORE. In particular, Group OSCORE provides 1737 message binding of responses to requests, which enables absolute 1738 freshness of responses that are not notifications, relative freshness 1739 of requests and notification responses, and replay protection of 1740 requests. In addition, the following holds for Group OSCORE. 1742 6.1. Supporting Observe 1744 When Observe [RFC7641] is used, a client maintains for each ongoing 1745 observation one Notification Number for each different server. Then, 1746 separately for each server, the client uses the associated 1747 Notification Number to perform ordering and replay protection of 1748 notifications received from that server (see Section 8.4.1). 1750 Group OSCORE allows to preserve an observation active indefinitely, 1751 even in case the group is rekeyed, with consequent change of ID 1752 Context, or in case the observer client obtains a new Sender ID. 1754 As defined in Section 8 when discussing support for Observe, this is 1755 achieved by the client and server(s) storing the 'kid' and 'kid 1756 context' used in the original Observe request, throughout the whole 1757 duration of the observation. 1759 Upon leaving the group or before re-joining the group, a group member 1760 MUST terminate all the ongoing observations that it has started in 1761 the group as observer client. 1763 6.2. Update of Replay Window 1765 Sender Sequence Numbers seen by a server as Partial IV values in 1766 request messages can spontaneously increase at a fast pace, for 1767 example when a client exchanges unicast messages with other servers 1768 using the Group OSCORE Security Context. As in OSCORE [RFC8613], a 1769 server always needs to accept such increases and accordingly updates 1770 the Replay Window in each of its Recipient Contexts. 1772 As discussed in Section 2.5.1, a newly created Recipient Context 1773 would have an invalid Replay Window, if its installation has required 1774 to delete another Recipient Context. Hence, the server is not able 1775 to verify if a request from the client associated to the new 1776 Recipient Context is a replay. When this happens, the server MUST 1777 validate the Replay Window of the new Recipient Context, before 1778 accepting messages from the associated client (see Section 2.5.1). 1780 Furthermore, when the Group Manager establishes a new Security 1781 Context for the group (see Section 2.5.3.2), every server re- 1782 initializes the Replay Window in each of its Recipient Contexts. 1784 6.3. Message Freshness 1786 When receiving a request from a client for the first time, the server 1787 is not synchronized with the client's Sender Sequence Number, i.e., 1788 it is not able to verify if that request is fresh. This applies to a 1789 server that has just joined the group, with respect to already 1790 present clients, and recurs as new clients are added as group 1791 members. 1793 During its operations in the group, the server may also lose 1794 synchronization with a client's Sender Sequence Number. This can 1795 happen, for instance, if the server has rebooted or has deleted its 1796 previously synchronized version of the Recipient Context for that 1797 client (see Section 2.5.1). 1799 If the application requires message freshness, e.g., according to 1800 time- or event-based policies, the server has to (re-)synchronize 1801 with a client's Sender Sequence Number before delivering request 1802 messages from that client to the application. To this end, the 1803 server can use the approach in Appendix E based on the Echo Option 1804 for CoAP [I-D.ietf-core-echo-request-tag], as a variant of the 1805 approach defined in Appendix B.1.2 of [RFC8613] applicable to Group 1806 OSCORE. 1808 7. Message Reception 1810 Upon receiving a protected message, a recipient endpoint retrieves a 1811 Security Context as in [RFC8613]. An endpoint MUST be able to 1812 distinguish between a Security Context to process OSCORE messages as 1813 in [RFC8613] and a Group OSCORE Security Context to process Group 1814 OSCORE messages as defined in this document. 1816 To this end, an endpoint can take into account the different 1817 structure of the Security Context defined in Section 2, for example 1818 based on the presence of Signature Algorithm and/or Pairwise Key 1819 Agreement Algorithm in the Common Context. Alternatively 1820 implementations can use an additional parameter in the Security 1821 Context, to explicitly signal that it is intended for processing 1822 Group OSCORE messages. 1824 If either of the following conditions holds, a recipient endpoint 1825 MUST discard the incoming protected message: 1827 * The Group Flag is set to 0, and the recipient endpoint retrieves a 1828 Security Context which is both valid to process the message and 1829 also associated to an OSCORE group, but the endpoint does not 1830 support the pairwise mode. 1832 * The Group Flag is set to 1, and the recipient endpoint retrieves a 1833 Security Context which is both valid to process the message and 1834 also associated to an OSCORE group, but the endpoint does not 1835 support the group mode. 1837 * The Group Flag is set to 1, and the recipient endpoint can not 1838 retrieve a Security Context which is both valid to process the 1839 message and also associated to an OSCORE group. 1841 As per Section 6.1 of [RFC8613], this holds also when retrieving a 1842 Security Context which is valid but not associated to an OSCORE 1843 group. Future specifications may define how to process incoming 1844 messages protected with a Security Contexts as in [RFC8613], when 1845 the Group Flag bit is set to 1. 1847 Otherwise, if a Security Context associated to an OSCORE group and 1848 valid to process the message is retrieved, the recipient endpoint 1849 processes the message with Group OSCORE, using the group mode (see 1850 Section 8) if the Group Flag is set to 1, or the pairwise mode (see 1851 Section 9) if the Group Flag is set to 0. 1853 Note that, if the Group Flag is set to 0, and the recipient endpoint 1854 retrieves a Security Context which is valid to process the message 1855 but is not associated to an OSCORE group, then the message is 1856 processed according to [RFC8613]. 1858 8. Message Processing in Group Mode 1860 When using the group mode, messages are protected and processed as 1861 specified in [RFC8613], with the modifications described in this 1862 section. The security objectives of the group mode are discussed in 1863 Appendix A.2. 1865 The Group Manager indicates that the group uses (also) the group 1866 mode, as part of the group data provided to candidate group members 1867 when joining the group. 1869 During all the steps of the message processing, an endpoint MUST use 1870 the same Security Context for the considered group. That is, an 1871 endpoint MUST NOT install a new Security Context for that group (see 1872 Section 2.5.3.2) until the message processing is completed. 1874 The group mode MUST be used to protect group requests intended for 1875 multiple recipients or for the whole group. This includes both 1876 requests directly addressed to multiple recipients, e.g., sent by the 1877 client over multicast, as well as requests sent by the client over 1878 unicast to a proxy, that forwards them to the intended recipients 1879 over multicast [I-D.ietf-core-groupcomm-bis]. For encryption and 1880 decryption operations, the Signature Encryption Algorithm from the 1881 Common Context is used. 1883 As per [RFC7252][I-D.ietf-core-groupcomm-bis], group requests sent 1884 over multicast MUST be Non-Confirmable, and thus are not 1885 retransmitted by the CoAP messaging layer. Instead, applications 1886 should store such outgoing messages for a predefined, sufficient 1887 amount of time, in order to correctly perform possible 1888 retransmissions at the application layer. According to Section 5.2.3 1889 of [RFC7252], responses to Non-Confirmable group requests SHOULD also 1890 be Non-Confirmable, but endpoints MUST be prepared to receive 1891 Confirmable responses in reply to a Non-Confirmable group request. 1892 Confirmable group requests are acknowledged in non-multicast 1893 environments, as specified in [RFC7252]. 1895 Furthermore, endpoints in the group locally perform error handling 1896 and processing of invalid messages according to the same principles 1897 adopted in [RFC8613]. However, a recipient MUST stop processing and 1898 silently reject any message which is malformed and does not follow 1899 the format specified in Section 4 of this document, or which is not 1900 cryptographically validated in a successful way. In either case, it 1901 is RECOMMENDED that the recipient does not send back any error 1902 message. This prevents servers from replying with multiple error 1903 messages to a client sending a group request, so avoiding the risk of 1904 flooding and possibly congesting the network. 1906 8.1. Protecting the Request 1908 A client transmits a secure group request as described in Section 8.1 1909 of [RFC8613], with the following modifications. 1911 * In step 2, the Additional Authenticated Data is modified as 1912 described in Section 4 of this document. 1914 * In step 4, the encryption of the COSE object is modified as 1915 described in Section 4 of this document. The encoding of the 1916 compressed COSE object is modified as described in Section 5 of 1917 this document. In particular, the Group Flag MUST be set to 1. 1918 The Signature Encryption Algorithm from the Common Context MUST be 1919 used. 1921 * In step 5, the countersignature is computed and the format of the 1922 OSCORE message is modified as described in Section 4 and Section 5 1923 of this document. In particular the payload of the OSCORE message 1924 includes also the encrypted countersignature (see Section 4.1). 1926 8.1.1. Supporting Observe 1928 If Observe [RFC7641] is supported, the following holds for each newly 1929 started observation. 1931 * If the client intends to keep the observation active beyond a 1932 possible change of Sender ID, the client MUST store the value of 1933 the 'kid' parameter from the original Observe request, and retain 1934 it for the whole duration of the observation. Even in case the 1935 client is individually rekeyed and receives a new Sender ID from 1936 the Group Manager (see Section 2.5.3.1), the client MUST NOT 1937 update the stored value associated to a particular Observe 1938 request. 1940 * If the client intends to keep the observation active beyond a 1941 possible change of ID Context following a group rekeying (see 1942 Section 3.2), then the following applies. 1944 - The client MUST store the value of the 'kid context' parameter 1945 from the original Observe request, and retain it for the whole 1946 duration of the observation. Upon establishing a new Security 1947 Context with a new Gid as ID Context (see Section 2.5.3.2), the 1948 client MUST NOT update the stored value associated to a 1949 particular Observe request. 1951 - The client MUST store an invariant identifier of the group, 1952 which is immutable even in case the Security Context of the 1953 group is re-established. For example, this invariant 1954 identifier can be the "group name" in 1955 [I-D.ietf-ace-key-groupcomm-oscore], where it is used for 1956 joining the group and retrieving the current group keying 1957 material from the Group Manager. 1959 After a group rekeying, such an invariant information makes it 1960 simpler for the observer client to retrieve the current group 1961 keying material from the Group Manager, in case the client has 1962 missed both the rekeying messages and the first observe 1963 notification protected with the new Security Context (see 1964 Section 8.3.1). 1966 8.2. Verifying the Request 1968 Upon receiving a secure group request with the Group Flag set to 1, 1969 following the procedure in Section 7, a server proceeds as described 1970 in Section 8.2 of [RFC8613], with the following modifications. 1972 * In step 2, the decoding of the compressed COSE object follows 1973 Section 5 of this document. In particular: 1975 - If the server discards the request due to not retrieving a 1976 Security Context associated to the OSCORE group, the server MAY 1977 respond with a 4.01 (Unauthorized) error message. When doing 1978 so, the server MAY set an Outer Max-Age option with value zero, 1979 and MAY include a descriptive string as diagnostic payload. 1981 - If the received 'kid context' matches an existing ID Context 1982 (Gid) but the received 'kid' does not match any Recipient ID in 1983 this Security Context, then the server MAY create a new 1984 Recipient Context for this Recipient ID and initialize it 1985 according to Section 3 of [RFC8613], and also retrieve the 1986 associated public key. Such a configuration is application 1987 specific. If the application does not specify dynamic 1988 derivation of new Recipient Contexts, then the server SHALL 1989 stop processing the request. 1991 * In step 4, the Additional Authenticated Data is modified as 1992 described in Section 4 of this document. 1994 * In step 6, the server also verifies the countersignature using the 1995 public key of the client from the associated Recipient Context. 1996 In particular: 1998 - If the server does not have the public key of the client yet, 1999 the server MUST stop processing the request and MAY respond 2000 with a 5.03 (Service Unavailable) response. The response MAY 2001 include a Max-Age Option, indicating to the client the number 2002 of seconds after which to retry. If the Max-Age Option is not 2003 present, a retry time of 60 seconds will be assumed by the 2004 client, as default value defined in Section 5.10.5 of 2005 [RFC7252]. 2007 - The server MUST perform signature verification before 2008 decrypting the COSE object, as defined below. Implementations 2009 that cannot perform the two steps in this order MUST ensure 2010 that no access to the plaintext is possible before a successful 2011 signature verification and MUST prevent any possible leak of 2012 time-related information that can yield side-channel attacks. 2014 - The server retrieves the encrypted countersignature 2015 ENC_SIGNATURE from the message payload, and computes the 2016 original countersignature SIGNATURE as 2018 SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM 2020 where KEYSTREAM is derived as per Section 4.1.1. 2022 The server verifies the original countersignature SIGNATURE. 2024 - If the signature verification fails, the server SHALL stop 2025 processing the request, SHALL NOT update the Replay Window, and 2026 MAY respond with a 4.00 (Bad Request) response. The server MAY 2027 set an Outer Max-Age option with value zero. The diagnostic 2028 payload MAY contain a string, which, if present, MUST be 2029 "Decryption failed" as if the decryption had failed. 2031 - When decrypting the COSE object using the Recipient Key, the 2032 Signature Encryption Algorithm from the Common Context MUST be 2033 used. 2035 * Additionally, if the used Recipient Context was created upon 2036 receiving this group request and the message is not verified 2037 successfully, the server MAY delete that Recipient Context. Such 2038 a configuration, which is specified by the application, mitigates 2039 attacks that aim at overloading the server's storage. 2041 A server SHOULD NOT process a request if the received Recipient ID 2042 ('kid') is equal to its own Sender ID in its own Sender Context. For 2043 an example where this is not fulfilled, see Section 7.2.1 of 2044 [I-D.ietf-core-observe-multicast-notifications]. 2046 8.2.1. Supporting Observe 2048 If Observe [RFC7641] is supported, the following holds for each newly 2049 started observation. 2051 * The server MUST store the value of the 'kid' parameter from the 2052 original Observe request, and retain it for the whole duration of 2053 the observation. The server MUST NOT update the stored value of a 2054 'kid' parameter associated to a particular Observe request, even 2055 in case the observer client is individually rekeyed and starts 2056 using a new Sender ID received from the Group Manager (see 2057 Section 2.5.3.1). 2059 * The server MUST store the value of the 'kid context' parameter 2060 from the original Observe request, and retain it for the whole 2061 duration of the observation, beyond a possible change of ID 2062 Context following a group rekeying (see Section 3.2). That is, 2063 upon establishing a new Security Context with a new Gid as ID 2064 Context (see Section 2.5.3.2), the server MUST NOT update the 2065 stored value associated to the ongoing observation. 2067 8.3. Protecting the Response 2069 If a server generates a CoAP message in response to a Group OSCORE 2070 request, then the server SHALL follow the description in Section 8.3 2071 of [RFC8613], with the modifications described in this section. 2073 Note that the server always protects a response with the Sender 2074 Context from its latest Security Context, and that establishing a new 2075 Security Context resets the Sender Sequence Number to 0 (see 2076 Section 3.2). 2078 * In step 2, the Additional Authenticated Data is modified as 2079 described in Section 4 of this document. 2081 * In step 3, if the server is using a different Security Context for 2082 the response compared to what was used to verify the request (see 2083 Section 3.2), then the server MUST include its Sender Sequence 2084 Number as Partial IV in the response and use it to build the AEAD 2085 nonce to protect the response. This prevents the AEAD nonce from 2086 the request from being reused. 2088 * In step 4, the encryption of the COSE object is modified as 2089 described in Section 4 of this document. The encoding of the 2090 compressed COSE object is modified as described in Section 5 of 2091 this document. In particular, the Group Flag MUST be set to 1. 2092 The Signature Encryption Algorithm from the Common Context MUST be 2093 used. 2095 If the server is using a different ID Context (Gid) for the 2096 response compared to what was used to verify the request (see 2097 Section 3.2), then the new ID Context MUST be included in the 'kid 2098 context' parameter of the response. 2100 The server can obtain a new Sender ID from the Group Manager, when 2101 individually rekeyed (see Section 2.5.3.1) or when re-joining the 2102 group. In such a case, the server can help the client to 2103 synchronize, by including the 'kid' parameter in a response 2104 protected in group mode, even when the request was protected in 2105 pairwise mode (see Section 9.3). 2107 That is, when responding to a request protected in pairwise mode, 2108 the server SHOULD include the 'kid' parameter in a response 2109 protected in group mode, if it is replying to that client for the 2110 first time since the assignment of its new Sender ID. 2112 * In step 5, the countersignature is computed and the format of the 2113 OSCORE message is modified as described in Section 4 and Section 5 2114 of this document. In particular the payload of the OSCORE message 2115 includes also the encrypted countersignature (see Section 4.1). 2117 8.3.1. Supporting Observe 2119 If Observe [RFC7641] is supported, the following holds when 2120 protecting notifications for an ongoing observation. 2122 * The server MUST use the stored value of the 'kid' parameter from 2123 the original Observe request (see Section 8.2.1), as value for the 2124 'request_kid' parameter in the external_aad structure (see 2125 Section 4.3). 2127 * The server MUST use the stored value of the 'kid context' 2128 parameter from the original Observe request (see Section 8.2.1), 2129 as value for the 'request_kid_context' parameter in the 2130 external_aad structure (see Section 4.3). 2132 Furthermore, the server may have ongoing observations started by 2133 Observe requests protected with an old Security Context. After 2134 completing the establishment of a new Security Context, the server 2135 MUST protect the following notifications with the Sender Context of 2136 the new Security Context. 2138 For each ongoing observation, the server can help the client to 2139 synchronize, by including also the 'kid context' parameter in 2140 notifications following a group rekeying, with value set to the ID 2141 Context (Gid) of the new Security Context. 2143 If there is a known upper limit to the duration of a group rekeying, 2144 the server SHOULD include the 'kid context' parameter during that 2145 time. Otherwise, the server SHOULD include it until the Max-Age has 2146 expired for the last notification sent before the installation of the 2147 new Security Context. 2149 8.4. Verifying the Response 2151 Upon receiving a secure response message with the Group Flag set to 2152 1, following the procedure in Section 7, the client proceeds as 2153 described in Section 8.4 of [RFC8613], with the following 2154 modifications. 2156 Note that a client may receive a response protected with a Security 2157 Context different from the one used to protect the corresponding 2158 request, and that, upon the establishment of a new Security Context, 2159 the client re-initializes its Replay Windows in its Recipient 2160 Contexts (see Section 3.2). 2162 * In step 2, the decoding of the compressed COSE object is modified 2163 as described in Section 5 of this document. In particular, a 2164 'kid' may not be present, if the response is a reply to a request 2165 protected in pairwise mode. In such a case, the client assumes 2166 the response 'kid' to be the Recipient ID for the server to which 2167 the request protected in pairwise mode was intended for. 2169 If the response 'kid context' matches an existing ID Context (Gid) 2170 but the received/assumed 'kid' does not match any Recipient ID in 2171 this Security Context, then the client MAY create a new Recipient 2172 Context for this Recipient ID and initialize it according to 2173 Section 3 of [RFC8613], and also retrieve the associated public 2174 key. If the application does not specify dynamic derivation of 2175 new Recipient Contexts, then the client SHALL stop processing the 2176 response. 2178 * In step 3, the Additional Authenticated Data is modified as 2179 described in Section 4 of this document. 2181 * In step 5, the client also verifies the countersignature using the 2182 public key of the server from the associated Recipient Context. 2183 In particular: 2185 - The client MUST perform signature verification before 2186 decrypting the COSE object, as defined below. Implementations 2187 that cannot perform the two steps in this order MUST ensure 2188 that no access to the plaintext is possible before a successful 2189 signature verification and MUST prevent any possible leak of 2190 time-related information that can yield side-channel attacks. 2192 - The client retrieves the encrypted countersignature 2193 ENC_SIGNATURE from the message payload, and computes the 2194 original countersignature SIGNATURE as 2196 SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM 2198 where KEYSTREAM is derived as per Section 4.1.1. 2200 The client verifies the original countersignature SIGNATURE. 2202 - If the verification of the countersignature fails, the server 2203 SHALL stop processing the response, and SHALL NOT update the 2204 Notification Number associated to the server if the response is 2205 an Observe notification [RFC7641]. 2207 - After a successful verification of the countersignature, the 2208 client performs also the following actions if the response is 2209 not an Observe notification. 2211 o In case the request was protected in pairwise mode and the 2212 'kid' parameter is present in the response, the client 2213 checks whether this received 'kid' is equal to the expected 2214 'kid', i.e., the known Recipient ID for the server to which 2215 the request was intended for. 2217 o If this is not the case, the client checks whether the 2218 server that has sent the response is the same one to which 2219 the request was intended for. This can be done by checking 2220 that the public key used to verify the countersignature of 2221 the response is equal to the Recipient Public Key taken as 2222 input to derive the Pairwise Sender Key used for protecting 2223 the request (see Section 2.4.1). 2225 o If the client determines that the response has come from a 2226 different server than the expected one, then the client 2227 SHALL discard the response and SHALL NOT deliver it to the 2228 application. Otherwise, the client hereafter considers the 2229 received 'kid' as the current Recipient ID for the server. 2231 - When decrypting the COSE object using the Recipient Key, the 2232 Signature Encryption Algorithm from the Common Context MUST be 2233 used. 2235 * Additionally, if the used Recipient Context was created upon 2236 receiving this response and the message is not verified 2237 successfully, the client MAY delete that Recipient Context. Such 2238 a configuration, which is specified by the application, mitigates 2239 attacks that aim at overloading the client's storage. 2241 8.4.1. Supporting Observe 2243 If Observe [RFC7641] is supported, the following holds when verifying 2244 notifications for an ongoing observation. 2246 * The client MUST use the stored value of the 'kid' parameter from 2247 the original Observe request (see Section 8.1.1), as value for the 2248 'request_kid' parameter in the external_aad structure (see 2249 Section 4.3). 2251 * The client MUST use the stored value of the 'kid context' 2252 parameter from the original Observe request (see Section 8.1.1), 2253 as value for the 'request_kid_context' parameter in the 2254 external_aad structure (see Section 4.3). 2256 This ensures that the client can correctly verify notifications, even 2257 in case it is individually rekeyed and starts using a new Sender ID 2258 received from the Group Manager (see Section 2.5.3.1), as well as 2259 when it installs a new Security Context with a new ID Context (Gid) 2260 following a group rekeying (see Section 3.2). 2262 * The ordering and the replay protection of notifications received 2263 from a server are performed as per Sections 4.1.3.5.2 and 7.4.1 of 2264 [RFC8613], by using the Notification Number associated to that 2265 server for the observation in question. In addition, the client 2266 performs the following actions for each ongoing observation. 2268 - When receiving the first valid notification from a server, the 2269 client MUST store the current kid "kid1" of that server for the 2270 observation in question. If the 'kid' field is included in the 2271 OSCORE option of the notification, its value specifies "kid1". 2272 If the Observe request was protected in pairwise mode (see 2273 Section 9.3), the 'kid' field may not be present in the OSCORE 2274 option of the notification (see Section 4.2). In this case, 2275 the client assumes "kid1" to be the Recipient ID for the server 2276 to which the Observe request was intended for. 2278 - When receiving another valid notification from the same server 2279 - which can be identified and recognized through the same 2280 public key used to verify the countersignature - the client 2281 determines the current kid "kid2" of the server as above for 2282 "kid1", and MUST check whether "kid2" is equal to the stored 2283 "kid1". If "kid1" and "kid2" are different, the client MUST 2284 cancel or re-register the observation in question. 2286 Note that, if "kid2" is different from "kid1" and the 'kid' 2287 field is omitted from the notification - which is possible if 2288 the Observe request was protected in pairwise mode - then the 2289 client will compute a wrong keystream to decrypt the 2290 countersignature (i.e., by using "kid1" rather than "kid2" in 2291 the 'id' field of the 'info' array in Section 4.1.1), thus 2292 subsequently failing to verify the countersignature and 2293 discarding the notification. 2295 This ensures that the client remains able to correctly perform the 2296 ordering and replay protection of notifications, even in case a 2297 server legitimately starts using a new Sender ID, as received from 2298 the Group Manager when individually rekeyed (see Section 2.5.3.1) or 2299 when re-joining the group. 2301 8.5. External Signature Checkers 2303 When receiving a message protected in group mode, a signature checker 2304 (see Section 3.1) proceeds as follows. 2306 * The signature checker retrieves the encrypted countersignature 2307 ENC_SIGNATURE from the message payload, and computes the original 2308 countersignature SIGNATURE as 2310 SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM 2312 where KEYSTREAM is derived as per Section 4.1.1. 2314 * The signature checker verifies the original countersignature 2315 SIGNATURE, by using the public key of the sender endpoint. The 2316 signature checker determines the public key to use based on the ID 2317 Context (Gid) and the Sender ID of the sender endpoint. 2319 Note that the following applies when attempting to verify the 2320 countersignature of a response message. 2322 * The response may not include a Partial IV and/or an ID Context. 2323 In such a case, the signature checker considers the same values 2324 from the corresponding request, i.e., the request matching with 2325 the response by CoAP Token value. 2327 * The response may not include a Sender ID. This can happen when 2328 the response protected in group mode matches a request protected 2329 in pairwise mode (see Section 9.1), with a case in point provided 2330 by [I-D.amsuess-core-cachable-oscore]. In such a case, the 2331 signature checker needs to use other means (e.g., source 2332 addressing information of the server endpoint) to identify the 2333 correct public key to use for verifying the countersignature of 2334 the response. 2336 The particular actions following a successful or unsuccessful 2337 verification of the countersignature are application specific and out 2338 of the scope of this document. 2340 9. Message Processing in Pairwise Mode 2342 When using the pairwise mode of Group OSCORE, messages are protected 2343 and processed as in [RFC8613], with the modifications described in 2344 this section. The security objectives of the pairwise mode are 2345 discussed in Appendix A.2. 2347 The pairwise mode takes advantage of an existing Security Context for 2348 the group mode to establish a Security Context shared exclusively 2349 with any other member. In order to use the pairwise mode in a group 2350 that uses also the group mode, the signature scheme of the group mode 2351 MUST support a combined signature and encryption scheme. This can 2352 be, for example, signature using ECDSA, and encryption using AES-CCM 2353 with a key derived with ECDH. For encryption and decryption 2354 operations, the AEAD Algorithm from the Common Context is used (see 2355 Section 2.1.1). 2357 The pairwise mode does not support the use of additional entities 2358 acting as verifiers of source authentication and integrity of group 2359 messages, such as intermediary gateways (see Section 3). 2361 An endpoint implementing only a silent server does not support the 2362 pairwise mode. 2364 If the signature algorithm used in the group supports ECDH (e.g., 2365 ECDSA, EdDSA), the pairwise mode MUST be supported by endpoints that 2366 use the CoAP Echo Option [I-D.ietf-core-echo-request-tag] and/or 2367 block-wise transfers [RFC7959], for instance for responses after the 2368 first block-wise request, which possibly targets all servers in the 2369 group and includes the CoAP Block2 option (see Section 3.8 of 2370 [I-D.ietf-core-groupcomm-bis]). This prevents the attack described 2371 in Section 11.9, which leverages requests sent over unicast to a 2372 single group member and protected with the group mode. 2374 Senders cannot use the pairwise mode to protect a message intended 2375 for multiple recipients. In fact, the pairwise mode is defined only 2376 between two endpoints and the keying material is thus only available 2377 to one recipient. 2379 However, a sender can use the pairwise mode to protect a message sent 2380 to (but not intended for) multiple recipients, if interested in a 2381 response from only one of them. For instance, this is useful to 2382 support the address discovery service defined in Section 9.1, when a 2383 single 'kid' value is indicated in the payload of a request sent to 2384 multiple recipients, e.g., over multicast. 2386 The Group Manager indicates that the group uses (also) the pairwise 2387 mode, as part of the group data provided to candidate group members 2388 when joining the group. 2390 9.1. Pre-Conditions 2392 In order to protect an outgoing message in pairwise mode, the sender 2393 needs to know the public key and the Recipient ID for the recipient 2394 endpoint, as stored in the Recipient Context associated to that 2395 endpoint (see Section 2.4.4). 2397 Furthermore, the sender needs to know the individual address of the 2398 recipient endpoint. This information may not be known at any given 2399 point in time. For instance, right after having joined the group, a 2400 client may know the public key and Recipient ID for a given server, 2401 but not the addressing information required to reach it with an 2402 individual, one-to-one request. 2404 To make addressing information of individual endpoints available, 2405 servers in the group MAY expose a resource to which a client can send 2406 a group request targeting a set of servers, identified by their 'kid' 2407 values specified in the request payload. The specified set may be 2408 empty, hence identifying all the servers in the group. Further 2409 details of such an interface are out of scope for this document. 2411 9.2. Main Differences from OSCORE 2413 The pairwise mode protects messages between two members of a group, 2414 essentially following [RFC8613], but with the following notable 2415 differences. 2417 * The 'kid' and 'kid context' parameters of the COSE object are used 2418 as defined in Section 4.2 of this document. 2420 * The external_aad defined in Section 4.3 of this document is used 2421 for the encryption process. 2423 * The Pairwise Sender/Recipient Keys used as Sender/Recipient keys 2424 are derived as defined in Section 2.4 of this document. 2426 9.3. Protecting the Request 2428 When using the pairwise mode, the request is protected as defined in 2429 Section 8.1 of [RFC8613], with the differences summarized in 2430 Section 9.2 of this document. The following difference also applies. 2432 * If Observe [RFC7641] is supported, what defined in Section 8.1.1 2433 of this document holds. 2435 9.4. Verifying the Request 2437 Upon receiving a request with the Group Flag set to 0, following the 2438 procedure in Section 7, the server MUST process it as defined in 2439 Section 8.2 of [RFC8613], with the differences summarized in 2440 Section 9.2 of this document. The following differences also apply. 2442 * If the server discards the request due to not retrieving a 2443 Security Context associated to the OSCORE group or to not 2444 supporting the pairwise mode, the server MAY respond with a 4.01 2445 (Unauthorized) error message or a 4.02 (Bad Option) error message, 2446 respectively. When doing so, the server MAY set an Outer Max-Age 2447 option with value zero, and MAY include a descriptive string as 2448 diagnostic payload. 2450 * If a new Recipient Context is created for this Recipient ID, new 2451 Pairwise Sender/Recipient Keys are also derived (see 2452 Section 2.4.1). The new Pairwise Sender/Recipient Keys are 2453 deleted if the Recipient Context is deleted as a result of the 2454 message not being successfully verified. 2456 * If Observe [RFC7641] is supported, what defined in Section 8.2.1 2457 of this document holds. 2459 9.5. Protecting the Response 2461 When using the pairwise mode, a response is protected as defined in 2462 Section 8.3 of [RFC8613], with the differences summarized in 2463 Section 9.2 of this document. The following differences also apply. 2465 * If the server is using a different Security Context for the 2466 response compared to what was used to verify the request (see 2467 Section 3.2), then the server MUST include its Sender Sequence 2468 Number as Partial IV in the response and use it to build the AEAD 2469 nonce to protect the response. This prevents the AEAD nonce from 2470 the request from being reused. 2472 * If the server is using a different ID Context (Gid) for the 2473 response compared to what was used to verify the request (see 2474 Section 3.2), then the new ID Context MUST be included in the 'kid 2475 context' parameter of the response. 2477 * The server can obtain a new Sender ID from the Group Manager, when 2478 individually rekeyed (see Section 2.5.3.1) or when re-joining the 2479 group. In such a case, the server can help the client to 2480 synchronize, by including the 'kid' parameter in a response 2481 protected in pairwise mode, even when the request was also 2482 protected in pairwise mode. 2484 That is, when responding to a request protected in pairwise mode, 2485 the server SHOULD include the 'kid' parameter in a response 2486 protected in pairwise mode, if it is replying to that client for 2487 the first time since the assignment of its new Sender ID. 2489 * If Observe [RFC7641] is supported, what defined in Section 8.3.1 2490 of this document holds. 2492 9.6. Verifying the Response 2494 Upon receiving a response with the Group Flag set to 0, following the 2495 procedure in Section 7, the client MUST process it as defined in 2496 Section 8.4 of [RFC8613], with the differences summarized in 2497 Section 9.2 of this document. The following differences also apply. 2499 * The client may receive a response protected with a Security 2500 Context different from the one used to protect the corresponding 2501 request. Also, upon the establishment of a new Security Context, 2502 the client re-initializes its Replay Windows in its Recipient 2503 Contexts (see Section 3.2). 2505 * The same as described in Section 8.4 holds with respect to 2506 handling the 'kid' parameter of the response, when received as a 2507 reply to a request protected in pairwise mode. The client can 2508 also in this case check whether the replying server is the 2509 expected one, by relying on the server's public key. However, 2510 since the response is protected in pairwise mode, the public key 2511 is not used for verifying a countersignature as in Section 8.4, 2512 but rather as input to derive the Pairwise Recipient Key used to 2513 decrypt and verify the response (see Section 2.4.1). 2515 * If a new Recipient Context is created for this Recipient ID, new 2516 Pairwise Sender/Recipient Keys are also derived (see 2517 Section 2.4.1). The new Pairwise Sender/Recipient Keys are 2518 deleted if the Recipient Context is deleted as a result of the 2519 message not being successfully verified. 2521 * If Observe [RFC7641] is supported, what defined in Section 8.4.1 2522 of this document holds. The client can also in this case identify 2523 a server to be the same one across a change of Sender ID, by 2524 relying on the server's public key. However, since the 2525 notification is protected in pairwise mode, the public key is not 2526 used for verifying a countersignature as in Section 8.4, but 2527 rather as input to derive the Pairwise Recipient Key used to 2528 decrypt and verify the notification (see Section 2.4.1). 2530 10. Mandatory-to-Implement Compliance Requirements 2532 Like in [RFC8613], HKDF SHA-256 is the mandatory to implement HKDF. 2534 An endpoint may support only the group mode, or only the pairwise 2535 mode, or both. 2537 For endpoints that support the group mode, the following applies. 2539 * For endpoints that use authenticated encryption, the AEAD 2540 algorithm AES-CCM-16-64-128 defined in Section 4.2 of 2541 [I-D.ietf-cose-rfc8152bis-algs] is mandatory to implement as 2542 Signature Encryption Algorithm (see Section 2.1.4). 2544 * For many constrained IoT devices it is problematic to support more 2545 than one signature algorithm. Existing devices can be expected to 2546 support either EdDSA or ECDSA. In order to enable as much 2547 interoperability as we can reasonably achieve, the following 2548 applies with respect to the Signature Algorithm (see 2549 Section 2.1.5). 2551 Less constrained endpoints SHOULD implement both: the EdDSA 2552 signature algorithm together with the elliptic curve Ed25519 2553 [RFC8032]; and the ECDSA signature algorithm together with the 2554 elliptic curve P-256. 2556 Constrained endpoints SHOULD implement: the EdDSA signature 2557 algorithm together with the elliptic curve Ed25519 [RFC8032]; or 2558 the ECDSA signature algorithm together with the elliptic curve 2559 P-256. 2561 * If elliptic curve signatures are used, it is RECOMMENDED to 2562 implement deterministic signatures with additional randomness as 2563 specified in [I-D.mattsson-cfrg-det-sigs-with-noise]. 2565 For endpoints that support the pairwise mode, the following applies. 2567 * The AEAD algorithm AES-CCM-16-64-128 defined in Section 4.2 of 2568 [I-D.ietf-cose-rfc8152bis-algs] is mandatory to implement as AEAD 2569 Algorithm (see Section 2.1.1). 2571 * The ECDH-SS + HKDF-256 algorithm specified in Section 6.3.1 of 2572 [I-D.ietf-cose-rfc8152bis-algs] is mandatory to implement as 2573 Pairwise Key Agreement Algorithm (see Section 2.1.7). 2575 * In order to enable as much interoperability as we can reasonably 2576 achieve in the presence of constrained devices (see above), the 2577 following applies. 2579 Less constrained endpoints SHOULD implement both the X25519 curve 2580 [RFC7748] and the P-256 curve as ECDH curves. 2582 Constrained endpoints SHOULD implement the X25519 curve [RFC7748] 2583 or the P-256 curve as ECDH curve. 2585 Constrained IoT devices may alternatively represent Montgomery curves 2586 and (twisted) Edwards curves [RFC7748] in the short-Weierstrass form 2587 Wei25519, with which the algorithms ECDSA25519 and ECDH25519 can be 2588 used for signature operations and Diffie-Hellman secret calculation, 2589 respectively [I-D.ietf-lwig-curve-representations]. 2591 11. Security Considerations 2593 The same threat model discussed for OSCORE in Appendix D.1 of 2594 [RFC8613] holds for Group OSCORE. In addition, when using the group 2595 mode, source authentication of messages is explicitly ensured by 2596 means of countersignatures, as discussed in Section 11.1. 2598 Note that, even if an endpoint is authorized to be a group member and 2599 to take part in group communications, there is a risk that it behaves 2600 inappropriately. For instance, it can forward the content of 2601 messages in the group to unauthorized entities. However, in many use 2602 cases, the devices in the group belong to a common authority and are 2603 configured by a commissioner (see Appendix B), which results in a 2604 practically limited risk and enables a prompt detection/reaction in 2605 case of misbehaving. 2607 The same considerations on supporting Proxy operations discussed for 2608 OSCORE in Appendix D.2 of [RFC8613] hold for Group OSCORE. 2610 The same considerations on protected message fields for OSCORE 2611 discussed in Appendix D.3 of [RFC8613] hold for Group OSCORE. 2613 The same considerations on uniqueness of (key, nonce) pairs for 2614 OSCORE discussed in Appendix D.4 of [RFC8613] hold for Group OSCORE. 2615 This is further discussed in Section 11.3 of this document. 2617 The same considerations on unprotected message fields for OSCORE 2618 discussed in Appendix D.5 of [RFC8613] hold for Group OSCORE, with 2619 the following differences. First, the 'kid context' of request 2620 messages is part of the Additional Authenticated Data, thus safely 2621 enabling to keep observations active beyond a possible change of ID 2622 Context (Gid), following a group rekeying (see Section 4.3). Second, 2623 the countersignature included in a Group OSCORE message protected in 2624 group mode is computed also over the value of the OSCORE option, 2625 which is also part of the Additional Authenticated Data used in the 2626 signing process. This is further discussed in Section 11.7 of this 2627 document. 2629 As discussed in Section 6.2.3 of [I-D.ietf-core-groupcomm-bis], Group 2630 OSCORE addresses security attacks against CoAP listed in Sections 2631 11.2-11.6 of [RFC7252], especially when run over IP multicast. 2633 The rest of this section first discusses security aspects to be taken 2634 into account when using Group OSCORE. Then it goes through aspects 2635 covered in the security considerations of OSCORE (see Section 12 of 2636 [RFC8613]), and discusses how they hold when Group OSCORE is used. 2638 11.1. Security of the Group Mode 2640 The group mode defined in Section 8 relies on commonly shared group 2641 keying material to protect communication within a group. Using the 2642 group mode has the implications discussed below. The following 2643 refers to group members as the endpoints in the group owning the 2644 latest version of the group keying material. 2646 * Messages are encrypted at a group level (group-level data 2647 confidentiality), i.e., they can be decrypted by any member of the 2648 group, but not by an external adversary or other external 2649 entities. 2651 * If the used encryption algorithm provides integrity protection, 2652 then it also ensures group authentication and proof of group 2653 membership, but not source authentication. That is, it ensures 2654 that a message sent to a group has been sent by a member of that 2655 group, but not necessarily by the alleged sender. In fact, any 2656 group member is able to derive the Sender Key used by the actual 2657 sender endpoint, and thus can compute a valid authentication tag. 2658 Therefore, the message content could originate from any of the 2659 current group members. 2661 Furthermore, if the used encryption algorithm does not provide 2662 integrity protection, then it does not ensure any level of message 2663 authentication or proof of group membership. 2665 On the other hand, proof of group membership is always ensured by 2666 construction through the strict management of the group keying 2667 material (see Section 3.2). That is, the group is rekeyed in case 2668 of nodes' leaving, and the current group members are informed of 2669 former group members. Thus, a current group member owning the 2670 latest group keying material does not own the public key of any 2671 former group member. 2673 This allows a recipient endpoint to rely on the owned public keys, 2674 in order to always confidently assert the group membership of a 2675 sender endpoint when processing an incoming message, i.e., to 2676 assert that the sender endpoint was a group member when it signed 2677 the message. In turn, this prevents a former group member to 2678 possibly re-sign and inject in the group a stored message that was 2679 protected with old keying material. 2681 * Source authentication of messages sent to a group is ensured 2682 through a countersignature, which is computed by the sender using 2683 its own private key and then appended to the message payload. 2684 Also, the countersignature is encrypted by using a keystream 2685 derived from the group keying material (see Section 4.1). This 2686 ensures group privacy, i.e., an attacker cannot track an endpoint 2687 over two groups by linking messages between the two groups, unless 2688 being also a member of those groups. 2690 The security properties of the group mode are summarized below. 2692 1. Asymmetric source authentication, by means of a countersignature. 2694 2. Symmetric group authentication, by means of an authentication tag 2695 (only for encryption algorithms providing integrity protection). 2697 3. Symmetric group confidentiality, by means of symmetric 2698 encryption. 2700 4. Proof of group membership, by strictly managing the group keying 2701 material, as well as by means of integrity tags when using an 2702 encryption algorithm that provides also integrity protection. 2704 5. Group privacy, by encrypting the countersignature. 2706 The group mode fulfills the security properties above while also 2707 displaying the following benefits. First, the use of encryption 2708 algorithm that does not provide integrity protection results in a 2709 minimal communication overhead, by limiting the message payload to 2710 the ciphertext and the encrypted countersignature. Second, it is 2711 possible to deploy semi-trusted principals such as signature checkers 2712 (see Section 3.1), which can break property 5, but cannot break 2713 properties 1, 2 and 3. 2715 11.2. Security of the Pairwise Mode 2717 The pairwise mode defined in Section 9 protects messages by using 2718 pairwise symmetric keys, derived from the static-static Diffie- 2719 Hellman shared secret computed from the asymmetric keys of the sender 2720 and recipient endpoint (see Section 2.4). 2722 The used encryption algorithm MUST provide integrity protection. 2723 Therefore, the pairwise mode ensures both pairwise data- 2724 confidentiality and source authentication of messages, without using 2725 countersignatures. Furthermore, the recipient endpoint achieves 2726 proof of group membership for the sender endpoint, since only current 2727 group members have the required keying material to derive a valid 2728 Pairwise Sender/Recipient Key. 2730 The long-term storing of the Diffie-Hellman shared secret is a 2731 potential security issue. In fact, if the shared secret of two group 2732 members is leaked, a third group member can exploit it to impersonate 2733 any of those two group members, by deriving and using their pairwise 2734 key. The possibility of such leakage should be contemplated, as more 2735 likely to happen than the leakage of a private key, which could be 2736 rather protected at a significantly higher level than generic memory, 2737 e.g., by using a Trusted Platform Module. Therefore, there is a 2738 trade-off between the maximum amount of time a same shared secret is 2739 stored and the frequency of its re-computing. 2741 11.3. Uniqueness of (key, nonce) 2743 The proof for uniqueness of (key, nonce) pairs in Appendix D.4 of 2744 [RFC8613] is also valid in group communication scenarios. That is, 2745 given an OSCORE group: 2747 * Uniqueness of Sender IDs within the group is enforced by the Group 2748 Manager. In fact, from the moment when a Gid is assigned to a 2749 group until the moment a new Gid is assigned to that same group, 2750 the Group Manager does not reassign a Sender ID within the group 2751 (see Section 3.2). 2753 * The case A in Appendix D.4 of [RFC8613] concerns all group 2754 requests and responses including a Partial IV (e.g., Observe 2755 notifications). In this case, same considerations from [RFC8613] 2756 apply here as well. 2758 * The case B in Appendix D.4 of [RFC8613] concerns responses not 2759 including a Partial IV (e.g., single response to a group request). 2760 In this case, same considerations from [RFC8613] apply here as 2761 well. 2763 As a consequence, each message encrypted/decrypted with the same 2764 Sender Key is processed by using a different (ID_PIV, PIV) pair. 2765 This means that nonces used by any fixed encrypting endpoint are 2766 unique. Thus, each message is processed with a different (key, 2767 nonce) pair. 2769 11.4. Management of Group Keying Material 2771 The approach described in this document should take into account the 2772 risk of compromise of group members. In particular, this document 2773 specifies that a key management scheme for secure revocation and 2774 renewal of Security Contexts and group keying material MUST be 2775 adopted. 2777 [I-D.ietf-ace-key-groupcomm-oscore] provides a simple rekeying scheme 2778 for renewing the Security Context in a group. 2780 Alternative rekeying schemes which are more scalable with the group 2781 size may be needed in dynamic, large-scale groups where endpoints can 2782 join and leave at any time, in order to limit the impact on 2783 performance due to the Security Context and keying material update. 2785 11.5. Update of Security Context and Key Rotation 2787 A group member can receive a message shortly after the group has been 2788 rekeyed, and new security parameters and keying material have been 2789 distributed by the Group Manager. 2791 This may result in a client using an old Security Context to protect 2792 a request, and a server using a different new Security Context to 2793 protect a corresponding response. As a consequence, clients may 2794 receive a response protected with a Security Context different from 2795 the one used to protect the corresponding request. 2797 In particular, a server may first get a request protected with the 2798 old Security Context, then install the new Security Context, and only 2799 after that produce a response to send back to the client. In such a 2800 case, as specified in Section 8.3, the server MUST protect the 2801 potential response using the new Security Context. Specifically, the 2802 server MUST include its Sender Sequence Number as Partial IV in the 2803 response and use it to build the AEAD nonce to protect the response. 2804 This prevents the AEAD nonce from the request from being reused with 2805 the new Security Context. 2807 The client will process that response using the new Security Context, 2808 provided that it has installed the new security parameters and keying 2809 material before the message processing. 2811 In case block-wise transfer [RFC7959] is used, the same 2812 considerations from Section 10.3 of [I-D.ietf-ace-key-groupcomm] 2813 hold. 2815 Furthermore, as described below, a group rekeying may temporarily 2816 result in misaligned Security Contexts between the sender and 2817 recipient of a same message. 2819 11.5.1. Late Update on the Sender 2821 In this case, the sender protects a message using the old Security 2822 Context, i.e., before having installed the new Security Context. 2823 However, the recipient receives the message after having installed 2824 the new Security Context, and is thus unable to correctly process it. 2826 A possible way to ameliorate this issue is to preserve the old, 2827 recent, Security Context for a maximum amount of time defined by the 2828 application. By doing so, the recipient can still try to process the 2829 received message using the old retained Security Context as a second 2830 attempt. This makes particular sense when the recipient is a client, 2831 that would hence be able to process incoming responses protected with 2832 the old, recent, Security Context used to protect the associated 2833 group request. Instead, a recipient server would better and more 2834 simply discard an incoming group request which is not successfully 2835 processed with the new Security Context. 2837 This tolerance preserves the processing of secure messages throughout 2838 a long-lasting key rotation, as group rekeying processes may likely 2839 take a long time to complete, especially in large scale groups. On 2840 the other hand, a former (compromised) group member can abusively 2841 take advantage of this, and send messages protected with the old 2842 retained Security Context. Therefore, a conservative application 2843 policy should not admit the retention of old Security Contexts. 2845 11.5.2. Late Update on the Recipient 2847 In this case, the sender protects a message using the new Security 2848 Context, but the recipient receives that message before having 2849 installed the new Security Context. Therefore, the recipient would 2850 not be able to correctly process the message and hence discards it. 2852 If the recipient installs the new Security Context shortly after that 2853 and the sender endpoint retransmits the message, the former will 2854 still be able to receive and correctly process the message. 2856 In any case, the recipient should actively ask the Group Manager for 2857 an updated Security Context according to an application-defined 2858 policy, for instance after a given number of unsuccessfully decrypted 2859 incoming messages. 2861 11.6. Collision of Group Identifiers 2863 In case endpoints are deployed in multiple groups managed by 2864 different non-synchronized Group Managers, it is possible for Group 2865 Identifiers of different groups to coincide. 2867 This does not impair the security of the AEAD algorithm. In fact, as 2868 long as the Master Secret is different for different groups and this 2869 condition holds over time, AEAD keys are different among different 2870 groups. 2872 The entity assigning an IP multicast address may help limiting the 2873 chances to experience such collisions of Group Identifiers. In 2874 particular, it may allow the Group Managers of groups using the same 2875 IP multicast address to share their respective list of assigned Group 2876 Identifiers currently in use. 2878 11.7. Cross-group Message Injection 2880 A same endpoint is allowed to and would likely use the same public/ 2881 private key pair in multiple OSCORE groups, possibly administered by 2882 different Group Managers. 2884 When a sender endpoint sends a message protected in pairwise mode to 2885 a recipient endpoint in an OSCORE group, a malicious group member may 2886 attempt to inject the message to a different OSCORE group also 2887 including the same endpoints (see Section 11.7.1). 2889 This practically relies on altering the content of the OSCORE option, 2890 and having the same MAC in the ciphertext still correctly validating, 2891 which has a success probability depending on the size of the MAC. 2893 As discussed in Section 11.7.2, the attack is practically infeasible 2894 if the message is protected in group mode, thanks to the 2895 countersignature also bound to the OSCORE option through the 2896 Additional Authenticated Data used in the signing process (see 2897 Section 4.3). 2899 11.7.1. Attack Description 2901 Let us consider: 2903 * Two OSCORE groups G1 and G2, with ID Context (Group ID) Gid1 and 2904 Gid2, respectively. Both G1 and G2 use the AEAD cipher AES-CCM- 2905 16-64-128, i.e., the MAC of the ciphertext is 8 bytes in size. 2907 * A sender endpoint X which is member of both G1 and G2, and uses 2908 the same public/private key pair in both groups. The endpoint X 2909 has Sender ID Sid1 in G1 and Sender ID Sid2 in G2. The pairs 2910 (Sid1, Gid1) and (Sid2, Gid2) identify the same public key of X in 2911 G1 and G2, respectively. 2913 * A recipient endpoint Y which is member of both G1 and G2, and uses 2914 the same public/private key pair in both groups. The endpoint Y 2915 has Sender ID Sid3 in G1 and Sender ID Sid4 in G2. The pairs 2916 (Sid3, Gid1) and (Sid4, Gid2) identify the same public key of Y in 2917 G1 and G2, respectively. 2919 * A malicious endpoint Z is also member of both G1 and G2. Hence, Z 2920 is able to derive the Sender Keys used by X in G1 and G2. 2922 When X sends a message M1 addressed to Y in G1 and protected in 2923 pairwise mode, Z can intercept M1, and attempt to forge a valid 2924 message M2 to be injected in G2, making it appear as still sent by X 2925 to Y and valid to be accepted. 2927 More in detail, Z intercepts and stops message M1, and forges a 2928 message M2 by changing the value of the OSCORE option from M1 as 2929 follows: the 'kid context' is set to G2 (rather than G1); and the 2930 'kid' is set to Sid2 (rather than Sid1). Then, Z injects message M2 2931 as addressed to Y in G2. 2933 Upon receiving M2, there is a probability equal to 2^-64 that Y 2934 successfully verifies the same unchanged MAC by using the Pairwise 2935 Recipient Key associated to X in G2. 2937 Note that Z does not know the pairwise keys of X and Y, since it does 2938 not know and is not able to compute their shared Diffie-Hellman 2939 secret. Therefore, Z is not able to check offline if a performed 2940 forgery is actually valid, before sending the forged message to G2. 2942 11.7.2. Attack Prevention in Group Mode 2944 When a Group OSCORE message is protected with the group mode, the 2945 countersignature is computed also over the value of the OSCORE 2946 option, which is part of the Additional Authenticated Data used in 2947 the signing process (see Section 4.3). 2949 That is, other than over the ciphertext, the countersignature is 2950 computed over: the ID Context (Gid) and the Partial IV, which are 2951 always present in group requests; as well as the Sender ID of the 2952 message originator, which is always present in group requests as well 2953 as in responses to requests protected in group mode. 2955 Since the signing process takes as input also the ciphertext of the 2956 COSE_Encrypt0 object, the countersignature is bound not only to the 2957 intended OSCORE group, hence to the triplet (Master Secret, Master 2958 Salt, ID Context), but also to a specific Sender ID in that group and 2959 to its specific symmetric key used for AEAD encryption, hence to the 2960 quartet (Master Secret, Master Salt, ID Context, Sender ID). 2962 This makes it practically infeasible to perform the attack described 2963 in Section 11.7.1, since it would require the adversary to 2964 additionally forge a valid countersignature that replaces the 2965 original one in the forged message M2. 2967 If the countersignature did not cover the OSCORE option, the attack 2968 would still be possible against response messages protected in group 2969 mode, since the same unchanged countersignature from message M1 would 2970 be also valid in message M2. 2972 Also, the following attack simplifications would hold, since Z is 2973 able to derive the Sender/Recipient Keys of X and Y in G1 and G2. 2974 That is, Z can also set a convenient Partial IV in the response, 2975 until the same unchanged MAC is successfully verified by using G2 as 2976 'request_kid_context', Sid2 as 'request_kid', and the symmetric key 2977 associated to X in G2. 2979 Since the Partial IV is 5 bytes in size, this requires 2^40 2980 operations to test all the Partial IVs, which can be done in real- 2981 time. The probability that a single given message M1 can be used to 2982 forge a response M2 for a given request would be equal to 2^-24, 2983 since there are more MAC values (8 bytes in size) than Partial IV 2984 values (5 bytes in size). 2986 Note that, by changing the Partial IV as discussed above, any member 2987 of G1 would also be able to forge a valid signed response message M2 2988 to be injected in the same group G1. 2990 11.8. Prevention of Group Cloning Attack 2992 Both when using the group mode and the pairwise mode, the message 2993 protection covers also the Group Manager's public key. This public 2994 key is included in the Additional Authenticated Data used in the 2995 signing process and/or in the integrity-protected encryption process 2996 (see Section 4.3). 2998 By doing so, an endpoint X member of a group G1 cannot perform the 2999 following attack. 3001 1. X sets up a group G2 where it acts as Group Manager. 3003 2. X makes G2 a "clone" of G1, i.e., G1 and G2 use the same 3004 algorithms and have the same Master Secret, Master Salt and ID 3005 Context. 3007 3. X collects a message M sent to G1 and injects it in G2. 3009 4. Members of G2 accept M and believe it to be originated in G2. 3011 The attack above is effectively prevented, since message M is 3012 protected by including the public key of G1's Group Manager in the 3013 Additional Authenticated Data. Therefore, members of G2 do not 3014 successfully verify and decrypt M, since they correctly use the 3015 public key of X as Group Manager of G2 when attempting to. 3017 11.9. Group OSCORE for Unicast Requests 3019 If a request is intended to be sent over unicast as addressed to a 3020 single group member, it is NOT RECOMMENDED for the client to protect 3021 the request by using the group mode as defined in Section 8.1. 3023 This does not include the case where the client sends a request over 3024 unicast to a proxy, to be forwarded to multiple intended recipients 3025 over multicast [I-D.ietf-core-groupcomm-bis]. In this case, the 3026 client MUST protect the request with the group mode, even though it 3027 is sent to the proxy over unicast (see Section 8). 3029 If the client uses the group mode with its own Sender Key to protect 3030 a unicast request to a group member, an on-path adversary can, right 3031 then or later on, redirect that request to one/many different group 3032 member(s) over unicast, or to the whole OSCORE group over multicast. 3033 By doing so, the adversary can induce the target group member(s) to 3034 perform actions intended for one group member only. Note that the 3035 adversary can be external, i.e., (s)he does not need to also be a 3036 member of the OSCORE group. 3038 This is due to the fact that the client is not able to indicate the 3039 single intended recipient in a way which is secure and possible to 3040 process for Group OSCORE on the server side. In particular, Group 3041 OSCORE does not protect network addressing information such as the IP 3042 address of the intended recipient server. It follows that the 3043 server(s) receiving the redirected request cannot assert whether that 3044 was the original intention of the client, and would thus simply 3045 assume so. 3047 The impact of such an attack depends especially on the REST method of 3048 the request, i.e., the Inner CoAP Code of the OSCORE request message. 3049 In particular, safe methods such as GET and FETCH would trigger 3050 (several) unintended responses from the targeted server(s), while not 3051 resulting in destructive behavior. On the other hand, non safe 3052 methods such as PUT, POST and PATCH/iPATCH would result in the target 3053 server(s) taking active actions on their resources and possible 3054 cyber-physical environment, with the risk of destructive consequences 3055 and possible implications for safety. 3057 A client can instead use the pairwise mode as defined in Section 9.3, 3058 in order to protect a request sent to a single group member by using 3059 pairwise keying material (see Section 2.4). This prevents the attack 3060 discussed above by construction, as only the intended server is able 3061 to derive the pairwise keying material used by the client to protect 3062 the request. A client supporting the pairwise mode SHOULD use it to 3063 protect requests sent to a single group member over unicast, instead 3064 of using the group mode. For an example where this is not fulfilled, 3065 see Section 7.2.1 of [I-D.ietf-core-observe-multicast-notifications]. 3067 With particular reference to block-wise transfers [RFC7959], 3068 Section 3.8 of [I-D.ietf-core-groupcomm-bis] points out that, while 3069 an initial request including the CoAP Block2 option can be sent over 3070 multicast, any other request in a transfer has to occur over unicast, 3071 individually addressing the servers in the group. 3073 Additional considerations are discussed in Appendix E, with respect 3074 to requests including a CoAP Echo Option 3075 [I-D.ietf-core-echo-request-tag] that has to be sent over unicast, as 3076 a challenge-response method for servers to achieve synchronization of 3077 clients' Sender Sequence Number. 3079 11.10. End-to-end Protection 3081 The same considerations from Section 12.1 of [RFC8613] hold for Group 3082 OSCORE. 3084 Additionally, (D)TLS and Group OSCORE can be combined for protecting 3085 message exchanges occurring over unicast. However, it is not 3086 possible to combine (D)TLS and Group OSCORE for protecting message 3087 exchanges where messages are (also) sent over multicast. 3089 11.11. Master Secret 3091 Group OSCORE derives the Security Context using the same construction 3092 as OSCORE, and by using the Group Identifier of a group as the 3093 related ID Context. Hence, the same required properties of the 3094 Security Context parameters discussed in Section 3.3 of [RFC8613] 3095 hold for this document. 3097 With particular reference to the OSCORE Master Secret, it has to be 3098 kept secret among the members of the respective OSCORE group and the 3099 Group Manager responsible for that group. Also, the Master Secret 3100 must have a good amount of randomness, and the Group Manager can 3101 generate it offline using a good random number generator. This 3102 includes the case where the Group Manager rekeys the group by 3103 generating and distributing a new Master Secret. Randomness 3104 requirements for security are described in [RFC4086]. 3106 11.12. Replay Protection 3108 As in OSCORE [RFC8613], also Group OSCORE relies on Sender Sequence 3109 Numbers included in the COSE message field 'Partial IV' and used to 3110 build AEAD nonces. 3112 Note that the Partial IV of an endpoint does not necessarily grow 3113 monotonically. For instance, upon exhaustion of the endpoint Sender 3114 Sequence Number, the Partial IV also gets exhausted. As discussed in 3115 Section 2.5.3, this results either in the endpoint being individually 3116 rekeyed and getting a new Sender ID, or in the establishment of a new 3117 Security Context in the group. Therefore, uniqueness of (key, nonce) 3118 pairs (see Section 11.3) is preserved also when a new Security 3119 Context is established. 3121 Since one-to-many communication such as multicast usually involves 3122 unreliable transports, the simplification of the Replay Window to a 3123 size of 1 suggested in Section 7.4 of [RFC8613] is not viable with 3124 Group OSCORE, unless exchanges in the group rely only on unicast 3125 messages. 3127 As discussed in Section 6.2, a Replay Window may be initialized as 3128 not valid, following the loss of mutable Security Context 3129 Section 2.5.1. In particular, Section 2.5.1.1 and Section 2.5.1.2 3130 define measures that endpoints need to take in such a situation, 3131 before resuming to accept incoming messages from other group members. 3133 11.13. Message Freshness 3135 As discussed in Section 6.3, a server may not be able to assert 3136 whether an incoming request is fresh, in case it does not have or has 3137 lost synchronization with the client's Sender Sequence Number. 3139 If freshness is relevant for the application, the server may 3140 (re-)synchronize with the client's Sender Sequence Number at any 3141 time, by using the approach described in Appendix E and based on the 3142 CoAP Echo Option [I-D.ietf-core-echo-request-tag], as a variant of 3143 the approach defined in Appendix B.1.2 of [RFC8613] applicable to 3144 Group OSCORE. 3146 11.14. Client Aliveness 3148 Building on Section 12.5 of [RFC8613], a server may use the CoAP Echo 3149 Option [I-D.ietf-core-echo-request-tag] to verify the aliveness of 3150 the client that originated a received request, by using the approach 3151 described in Appendix E of this document. 3153 11.15. Cryptographic Considerations 3155 The same considerations from Section 12.6 of [RFC8613] about the 3156 maximum Sender Sequence Number hold for Group OSCORE. 3158 As discussed in Section 2.5.2, an endpoint that experiences an 3159 exhaustion of its own Sender Sequence Numbers MUST NOT protect 3160 further messages including a Partial IV, until it has derived a new 3161 Sender Context. This prevents the endpoint to reuse the same AEAD 3162 nonces with the same Sender Key. 3164 In order to renew its own Sender Context, the endpoint SHOULD inform 3165 the Group Manager, which can either renew the whole Security Context 3166 by means of group rekeying, or provide only that endpoint with a new 3167 Sender ID value. In either case, the endpoint derives a new Sender 3168 Context, and in particular a new Sender Key. 3170 Additionally, the same considerations from Section 12.6 of [RFC8613] 3171 hold for Group OSCORE, about building the AEAD nonce and the secrecy 3172 of the Security Context parameters. 3174 The group mode uses the "encrypt-then-sign" construction, i.e., the 3175 countersignature is computed over the COSE_Encrypt0 object (see 3176 Section 4.1). This is motivated by enabling additional principals 3177 acting as signature checkers (see Section 3.1), which do not join a 3178 group as members but are allowed to verify countersignatures of 3179 messages protected in group mode without being able to decrypt them 3180 (see Section 8.5). 3182 If the encryption algorithm used in group mode provides integrity 3183 protection, countersignatures of COSE_Encrypt0 with short 3184 authentication tags do not provide the security properties associated 3185 with the same algorithm used in COSE_Sign (see Section 6 of 3186 [I-D.ietf-cose-countersign]). To provide 128-bit security against 3187 collision attacks, the tag length MUST be at least 256-bits. A 3188 countersignature of a COSE_Encrypt0 with AES-CCM-16-64-128 provides 3189 at most 32 bits of integrity protection. 3191 The derivation of pairwise keys defined in Section 2.4.1 is 3192 compatible with ECDSA and EdDSA asymmetric keys, but is not 3193 compatible with RSA asymmetric keys. 3195 For the public key translation from Ed25519 (Ed448) to X25519 (X448) 3196 specified in Section 2.4.1, variable time methods can be used since 3197 the translation operates on public information. Any byte string of 3198 appropriate length is accepted as a public key for X25519 (X448) in 3199 [RFC7748]. It is therefore not necessary for security to validate 3200 the translated public key (assuming the translation was successful). 3202 The security of using the same key pair for Diffie-Hellman and for 3203 signing (by considering the ECDH procedure in Section 2.4 as a Key 3204 Encapsulation Mechanism (KEM)) is demonstrated in [Degabriele] and 3205 [Thormarker]. 3207 Applications using ECDH (except X25519 and X448) based KEM in 3208 Section 2.4 are assumed to verify that a peer endpoint's public key 3209 is on the expected curve and that the shared secret is not the point 3210 at infinity. The KEM in [Degabriele] checks that the shared secret 3211 is different from the point at infinity, as does the procedure in 3212 Section 5.7.1.2 of [NIST-800-56A] which is referenced in Section 2.4. 3214 Extending Theorem 2 of [Degabriele], [Thormarker] shows that the same 3215 key pair can be used with X25519 and Ed25519 (X448 and Ed448) for the 3216 KEM specified in Section 2.4. By symmetry in the KEM used in this 3217 document, both endpoints can consider themselves to have the 3218 recipient role in the KEM - as discussed in Section 7 of [Thormarker] 3219 - and rely on the mentioned proofs for the security of their key 3220 pairs. 3222 Theorem 3 in [Degabriele] shows that the same key pair can be used 3223 for an ECDH based KEM and ECDSA. The KEM uses a different KDF than 3224 in Section 2.4, but the proof only depends on that the KDF has 3225 certain required properties, which are the typical assumptions about 3226 HKDF, e.g., that output keys are pseudorandom. In order to comply 3227 with the assumptions of Theorem 3, received public keys MUST be 3228 successfully validated, see Section 5.6.2.3.4 of [NIST-800-56A]. The 3229 validation MAY be performed by a trusted Group Manager. For 3231 [Degabriele] to apply as it is written, public keys need to be in the 3232 expected subgroup. For this we rely on cofactor DH, Section 5.7.1.2 3233 of [NIST-800-56A] which is referenced in Section 2.4. 3235 HashEdDSA variants of Ed25519 and Ed448 are not used by COSE, see 3236 Section 2.2 of [I-D.ietf-cose-rfc8152bis-algs], and are not covered 3237 by the analysis in [Thormarker], and hence MUST NOT be used with the 3238 public keys used with pairwise keys as specified in this document. 3240 11.16. Message Segmentation 3242 The same considerations from Section 12.7 of [RFC8613] hold for Group 3243 OSCORE. 3245 11.17. Privacy Considerations 3247 Group OSCORE ensures end-to-end integrity protection and encryption 3248 of the message payload and all options that are not used for proxy 3249 operations. In particular, options are processed according to the 3250 same class U/I/E that they have for OSCORE. Therefore, the same 3251 privacy considerations from Section 12.8 of [RFC8613] hold for Group 3252 OSCORE, with the following addition. 3254 * When protecting a message in group mode, the countersignature is 3255 encrypted by using a keystream derived from the group keying 3256 material (see Section 4.1 and Section 4.1.1). This ensures group 3257 privacy. That is, an attacker cannot track an endpoint over two 3258 groups by linking messages between the two groups, unless being 3259 also a member of those groups. 3261 Furthermore, the following privacy considerations hold about the 3262 OSCORE option, which may reveal information on the communicating 3263 endpoints. 3265 * The 'kid' parameter, which is intended to help a recipient 3266 endpoint to find the right Recipient Context, may reveal 3267 information about the Sender Endpoint. When both a request and 3268 the corresponding responses include the 'kid' parameter, this may 3269 reveal information about both a client sending a request and all 3270 the possibly replying servers sending their own individual 3271 response. 3273 * The 'kid context' parameter, which is intended to help a recipient 3274 endpoint to find the right Security Context, reveals information 3275 about the sender endpoint. In particular, it reveals that the 3276 sender endpoint is a member of a particular OSCORE group, whose 3277 current Group ID is indicated in the 'kid context' parameter. 3279 When receiving a group request, each of the recipient endpoints can 3280 reply with a response that includes its Sender ID as 'kid' parameter. 3281 All these responses will be matchable with the request through the 3282 Token. Thus, even if these responses do not include a 'kid context' 3283 parameter, it becomes possible to understand that the responder 3284 endpoints are in the same group of the requester endpoint. 3286 Furthermore, using the mechanisms described in Appendix E to achieve 3287 Sender Sequence Number synchronization with a client may reveal when 3288 a server device goes through a reboot. This can be mitigated by the 3289 server device storing the precise state of the Replay Window of each 3290 known client on a clean shutdown. 3292 Finally, the mechanism described in Section 11.6 to prevent 3293 collisions of Group Identifiers from different Group Managers may 3294 reveal information about events in the respective OSCORE groups. In 3295 particular, a Group Identifier changes when the corresponding group 3296 is rekeyed. Thus, Group Managers might use the shared list of Group 3297 Identifiers to infer the rate and patterns of group membership 3298 changes triggering a group rekeying, e.g., due to newly joined 3299 members or evicted (compromised) members. In order to alleviate this 3300 privacy concern, it should be hidden from the Group Managers which 3301 exact Group Manager has currently assigned which Group Identifiers in 3302 its OSCORE groups. 3304 12. IANA Considerations 3306 Note to RFC Editor: Please replace "[This Document]" with the RFC 3307 number of this document and delete this paragraph. 3309 This document has the following actions for IANA. 3311 12.1. OSCORE Flag Bits Registry 3313 IANA is asked to add the following value entry to the "OSCORE Flag 3314 Bits" registry within the "Constrained RESTful Environments (CoRE) 3315 Parameters" registry group. 3317 +--------------+------------+-----------------------------+-----------+ 3318 | Bit Position | Name | Description | Reference | 3319 +--------------+------------+-----------------------------+-----------+ 3320 | 2 | Group Flag | For using a Group OSCORE | [This | 3321 | | | Security Context, set to 1 | Document] | 3322 | | | if the message is protected | | 3323 | | | with the group mode | | 3324 +--------------+------------+-----------------------------+-----------+ 3326 13. References 3327 13.1. Normative References 3329 [I-D.ietf-core-groupcomm-bis] 3330 Dijk, E., Wang, C., and M. Tiloca, "Group Communication 3331 for the Constrained Application Protocol (CoAP)", Work in 3332 Progress, Internet-Draft, draft-ietf-core-groupcomm-bis- 3333 05, 25 October 2021, . 3336 [I-D.ietf-cose-countersign] 3337 Schaad, J. and R. Housley, "CBOR Object Signing and 3338 Encryption (COSE): Countersignatures", Work in Progress, 3339 Internet-Draft, draft-ietf-cose-countersign-05, 23 June 3340 2021, . 3343 [I-D.ietf-cose-rfc8152bis-algs] 3344 Schaad, J., "CBOR Object Signing and Encryption (COSE): 3345 Initial Algorithms", Work in Progress, Internet-Draft, 3346 draft-ietf-cose-rfc8152bis-algs-12, 24 September 2020, 3347 . 3350 [I-D.ietf-cose-rfc8152bis-struct] 3351 Schaad, J., "CBOR Object Signing and Encryption (COSE): 3352 Structures and Process", Work in Progress, Internet-Draft, 3353 draft-ietf-cose-rfc8152bis-struct-15, 1 February 2021, 3354 . 3357 [NIST-800-56A] 3358 Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. 3359 Davis, "Recommendation for Pair-Wise Key-Establishment 3360 Schemes Using Discrete Logarithm Cryptography - NIST 3361 Special Publication 800-56A, Revision 3", April 2018, 3362 . 3365 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3366 Requirement Levels", BCP 14, RFC 2119, 3367 DOI 10.17487/RFC2119, March 1997, 3368 . 3370 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 3371 "Randomness Requirements for Security", BCP 106, RFC 4086, 3372 DOI 10.17487/RFC4086, June 2005, 3373 . 3375 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 3376 Application Protocol (CoAP)", RFC 7252, 3377 DOI 10.17487/RFC7252, June 2014, 3378 . 3380 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 3381 for Security", RFC 7748, DOI 10.17487/RFC7748, January 3382 2016, . 3384 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 3385 Signature Algorithm (EdDSA)", RFC 8032, 3386 DOI 10.17487/RFC8032, January 2017, 3387 . 3389 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3390 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3391 May 2017, . 3393 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 3394 Definition Language (CDDL): A Notational Convention to 3395 Express Concise Binary Object Representation (CBOR) and 3396 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 3397 June 2019, . 3399 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 3400 "Object Security for Constrained RESTful Environments 3401 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 3402 . 3404 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 3405 Representation (CBOR)", STD 94, RFC 8949, 3406 DOI 10.17487/RFC8949, December 2020, 3407 . 3409 13.2. Informative References 3411 [Degabriele] 3412 Degabriele, J.P., Lehmann, A., Paterson, K.G., Smart, 3413 N.P., and M. Strefler, "On the Joint Security of 3414 Encryption and Signature in EMV", December 2011, 3415 . 3417 [I-D.amsuess-core-cachable-oscore] 3418 Amsüss, C. and M. Tiloca, "Cacheable OSCORE", Work in 3419 Progress, Internet-Draft, draft-amsuess-core-cachable- 3420 oscore-02, 12 July 2021, . 3423 [I-D.ietf-ace-key-groupcomm] 3424 Palombini, F. and M. Tiloca, "Key Provisioning for Group 3425 Communication using ACE", Work in Progress, Internet- 3426 Draft, draft-ietf-ace-key-groupcomm-14, 25 October 2021, 3427 . 3430 [I-D.ietf-ace-key-groupcomm-oscore] 3431 Tiloca, M., Park, J., and F. Palombini, "Key Management 3432 for OSCORE Groups in ACE", Work in Progress, Internet- 3433 Draft, draft-ietf-ace-key-groupcomm-oscore-12, 25 October 3434 2021, . 3437 [I-D.ietf-ace-oauth-authz] 3438 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 3439 H. Tschofenig, "Authentication and Authorization for 3440 Constrained Environments (ACE) using the OAuth 2.0 3441 Framework (ACE-OAuth)", Work in Progress, Internet-Draft, 3442 draft-ietf-ace-oauth-authz-45, 29 August 2021, 3443 . 3446 [I-D.ietf-core-echo-request-tag] 3447 Amsüss, C., Mattsson, J. P., and G. Selander, "CoAP: Echo, 3448 Request-Tag, and Token Processing", Work in Progress, 3449 Internet-Draft, draft-ietf-core-echo-request-tag-14, 4 3450 October 2021, . 3453 [I-D.ietf-core-observe-multicast-notifications] 3454 Tiloca, M., Höglund, R., Amsüss, C., and F. Palombini, 3455 "Observe Notifications as CoAP Multicast Responses", Work 3456 in Progress, Internet-Draft, draft-ietf-core-observe- 3457 multicast-notifications-02, 25 October 2021, 3458 . 3461 [I-D.ietf-cose-cbor-encoded-cert] 3462 Mattsson, J. P., Selander, G., Raza, S., Höglund, J., and 3463 M. Furuhed, "CBOR Encoded X.509 Certificates (C509 3464 Certificates)", Work in Progress, Internet-Draft, draft- 3465 ietf-cose-cbor-encoded-cert-02, 12 July 2021, 3466 . 3469 [I-D.ietf-lwig-curve-representations] 3470 Struik, R., "Alternative Elliptic Curve Representations", 3471 Work in Progress, Internet-Draft, draft-ietf-lwig-curve- 3472 representations-21, 9 June 2021, 3473 . 3476 [I-D.ietf-lwig-security-protocol-comparison] 3477 Mattsson, J. P., Palombini, F., and M. Vucinic, 3478 "Comparison of CoAP Security Protocols", Work in Progress, 3479 Internet-Draft, draft-ietf-lwig-security-protocol- 3480 comparison-05, 2 November 2020, 3481 . 3484 [I-D.ietf-tls-dtls13] 3485 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 3486 Datagram Transport Layer Security (DTLS) Protocol Version 3487 1.3", Work in Progress, Internet-Draft, draft-ietf-tls- 3488 dtls13-43, 30 April 2021, . 3491 [I-D.mattsson-cfrg-det-sigs-with-noise] 3492 Mattsson, J. P., Thormarker, E., and S. Ruohomaa, 3493 "Deterministic ECDSA and EdDSA Signatures with Additional 3494 Randomness", Work in Progress, Internet-Draft, draft- 3495 mattsson-cfrg-det-sigs-with-noise-02, 11 March 2020, 3496 . 3499 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 3500 "Transmission of IPv6 Packets over IEEE 802.15.4 3501 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 3502 . 3504 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 3505 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 3506 . 3508 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 3509 Key Derivation Function (HKDF)", RFC 5869, 3510 DOI 10.17487/RFC5869, May 2010, 3511 . 3513 [RFC6282] Hui, J., Ed. and P. Thubert, "Compression Format for IPv6 3514 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 3515 DOI 10.17487/RFC6282, September 2011, 3516 . 3518 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 3519 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 3520 January 2012, . 3522 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 3523 Constrained-Node Networks", RFC 7228, 3524 DOI 10.17487/RFC7228, May 2014, 3525 . 3527 [RFC7641] Hartke, K., "Observing Resources in the Constrained 3528 Application Protocol (CoAP)", RFC 7641, 3529 DOI 10.17487/RFC7641, September 2015, 3530 . 3532 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 3533 Security (TLS) / Datagram Transport Layer Security (DTLS) 3534 Profiles for the Internet of Things", RFC 7925, 3535 DOI 10.17487/RFC7925, July 2016, 3536 . 3538 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 3539 the Constrained Application Protocol (CoAP)", RFC 7959, 3540 DOI 10.17487/RFC7959, August 2016, 3541 . 3543 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 3544 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 3545 May 2018, . 3547 [Thormarker] 3548 Thormarker, E., "On using the same key pair for Ed25519 3549 and an X25519 based KEM", April 2021, 3550 . 3552 Appendix A. Assumptions and Security Objectives 3554 This section presents a set of assumptions and security objectives 3555 for the approach described in this document. The rest of this 3556 section refers to three types of groups: 3558 * Application group, i.e., a set of CoAP endpoints that share a 3559 common pool of resources. 3561 * Security group, as defined in Section 1.1 of this document. There 3562 can be a one-to-one or a one-to-many relation between security 3563 groups and application groups, and vice versa. 3565 * CoAP group, i.e., a set of CoAP endpoints where each endpoint is 3566 configured to receive one-to-many CoAP requests, e.g., sent to the 3567 group's associated IP multicast address and UDP port as defined in 3568 [I-D.ietf-core-groupcomm-bis]. An endpoint may be a member of 3569 multiple CoAP groups. There can be a one-to-one or a one-to-many 3570 relation between application groups and CoAP groups. Note that a 3571 device sending a CoAP request to a CoAP group is not necessarily 3572 itself a member of that group: it is a member only if it also has 3573 a CoAP server endpoint listening to requests for this CoAP group, 3574 sent to the associated IP multicast address and port. In order to 3575 provide secure group communication, all members of a CoAP group as 3576 well as all further endpoints configured only as clients sending 3577 CoAP (multicast) requests to the CoAP group have to be member of a 3578 security group. There can be a one-to-one or a one-to-many 3579 relation between security groups and CoAP groups, and vice versa. 3581 A.1. Assumptions 3583 The following points are assumed to be already addressed and are out 3584 of the scope of this document. 3586 * Multicast communication topology: this document considers both 3587 1-to-N (one sender and multiple recipients) and M-to-N (multiple 3588 senders and multiple recipients) communication topologies. The 3589 1-to-N communication topology is the simplest group communication 3590 scenario that would serve the needs of a typical Low-power and 3591 Lossy Network (LLN). Examples of use cases that benefit from 3592 secure group communication are provided in Appendix B. 3594 In a 1-to-N communication model, only a single client transmits 3595 data to the CoAP group, in the form of request messages; in an 3596 M-to-N communication model (where M and N do not necessarily have 3597 the same value), M clients transmit data to the CoAP group. 3598 According to [I-D.ietf-core-groupcomm-bis], any possible proxy 3599 entity is supposed to know about the clients. Also, every client 3600 expects and is able to handle multiple response messages 3601 associated to a same request sent to the CoAP group. 3603 * Group size: security solutions for group communication should be 3604 able to adequately support different and possibly large security 3605 groups. The group size is the current number of members in a 3606 security group. In the use cases mentioned in this document, the 3607 number of clients (normally the controlling devices) is expected 3608 to be much smaller than the number of servers (i.e., the 3609 controlled devices). A security solution for group communication 3610 that supports 1 to 50 clients would be able to properly cover the 3611 group sizes required for most use cases that are relevant for this 3612 document. The maximum group size is expected to be in the range 3613 of 2 to 100 devices. Security groups larger than that should be 3614 divided into smaller independent groups. One should not assume 3615 that the set of members of a security group remains fixed. That 3616 is, the group membership is subject to changes, possibly on a 3617 frequent basis. 3619 * Communication with the Group Manager: an endpoint must use a 3620 secure dedicated channel when communicating with the Group 3621 Manager, also when not registered as a member of the security 3622 group. 3624 * Provisioning and management of Security Contexts: a Security 3625 Context must be established among the members of the security 3626 group. A secure mechanism must be used to generate, revoke and 3627 (re-)distribute keying material, communication policies and 3628 security parameters in the security group. The actual 3629 provisioning and management of the Security Context is out of the 3630 scope of this document. 3632 * Multicast data security ciphersuite: all members of a security 3633 group must agree on a ciphersuite to provide authenticity, 3634 integrity and confidentiality of messages in the group. The 3635 ciphersuite is specified as part of the Security Context. 3637 * Backward security: a new device joining the security group should 3638 not have access to any old Security Contexts used before its 3639 joining. This ensures that a new member of the security group is 3640 not able to decrypt confidential data sent before it has joined 3641 the security group. The adopted key management scheme should 3642 ensure that the Security Context is updated to ensure backward 3643 confidentiality. The actual mechanism to update the Security 3644 Context and renew the group keying material in the security group 3645 upon a new member's joining has to be defined as part of the group 3646 key management scheme. 3648 * Forward security: entities that leave the security group should 3649 not have access to any future Security Contexts or message 3650 exchanged within the security group after their leaving. This 3651 ensures that a former member of the security group is not able to 3652 decrypt confidential data sent within the security group anymore. 3653 Also, it ensures that a former member is not able to send 3654 protected messages to the security group anymore. The actual 3655 mechanism to update the Security Context and renew the group 3656 keying material in the security group upon a member's leaving has 3657 to be defined as part of the group key management scheme. 3659 A.2. Security Objectives 3661 The approach described in this document aims at fulfilling the 3662 following security objectives: 3664 * Data replay protection: group request messages or response 3665 messages replayed within the security group must be detected. 3667 * Data confidentiality: messages sent within the security group 3668 shall be encrypted. 3670 * Group-level data confidentiality: the group mode provides group- 3671 level data confidentiality since messages are encrypted at a group 3672 level, i.e., in such a way that they can be decrypted by any 3673 member of the security group, but not by an external adversary or 3674 other external entities. 3676 * Pairwise data confidentiality: the pairwise mode especially 3677 provides pairwise data confidentiality, since messages are 3678 encrypted using pairwise keying material shared between any two 3679 group members, hence they can be decrypted only by the intended 3680 single recipient. 3682 * Source message authentication: messages sent within the security 3683 group shall be authenticated. That is, it is essential to ensure 3684 that a message is originated by a member of the security group in 3685 the first place, and in particular by a specific, identifiable 3686 member of the security group. 3688 * Message integrity: messages sent within the security group shall 3689 be integrity protected. That is, it is essential to ensure that a 3690 message has not been tampered with, either by a group member, or 3691 by an external adversary or other external entities which are not 3692 members of the security group. 3694 * Message ordering: it must be possible to determine the ordering of 3695 messages coming from a single sender. In accordance with OSCORE 3696 [RFC8613], this results in providing absolute freshness of 3697 responses that are not notifications, as well as relative 3698 freshness of group requests and notification responses. It is not 3699 required to determine ordering of messages from different senders. 3701 Appendix B. List of Use Cases 3703 Group Communication for CoAP [I-D.ietf-core-groupcomm-bis] provides 3704 the necessary background for multicast-based CoAP communication, with 3705 particular reference to low-power and lossy networks (LLNs) and 3706 resource constrained environments. The interested reader is 3707 encouraged to first read [I-D.ietf-core-groupcomm-bis] to understand 3708 the non-security related details. This section discusses a number of 3709 use cases that benefit from secure group communication, and refers to 3710 the three types of groups from Appendix A. Specific security 3711 requirements for these use cases are discussed in Appendix A. 3713 * Lighting control: consider a building equipped with IP-connected 3714 lighting devices, switches, and border routers. The lighting 3715 devices acting as servers are organized into application groups 3716 and CoAP groups, according to their physical location in the 3717 building. For instance, lighting devices in a room or corridor 3718 can be configured as members of a single application group and 3719 corresponding CoAP group. Those lighting devices together with 3720 the switches acting as clients in the same room or corridor can be 3721 configured as members of the corresponding security group. 3722 Switches are then used to control the lighting devices by sending 3723 on/off/dimming commands to all lighting devices in the CoAP group, 3724 while border routers connected to an IP network backbone (which is 3725 also multicast-enabled) can be used to interconnect routers in the 3726 building. Consequently, this would also enable logical groups to 3727 be formed even if devices with a role in the lighting application 3728 may be physically in different subnets (e.g., on wired and 3729 wireless networks). Connectivity between lighting devices may be 3730 realized, for instance, by means of IPv6 and (border) routers 3731 supporting 6LoWPAN [RFC4944][RFC6282]. Group communication 3732 enables synchronous operation of a set of connected lights, 3733 ensuring that the light preset (e.g., dimming level or color) of a 3734 large set of luminaires are changed at the same perceived time. 3735 This is especially useful for providing a visual synchronicity of 3736 light effects to the user. As a practical guideline, events 3737 within a 200 ms interval are perceived as simultaneous by humans, 3738 which is necessary to ensure in many setups. Devices may reply 3739 back to the switches that issue on/off/dimming commands, in order 3740 to report about the execution of the requested operation (e.g., 3741 OK, failure, error) and their current operational status. In a 3742 typical lighting control scenario, a single switch is the only 3743 entity responsible for sending commands to a set of lighting 3744 devices. In more advanced lighting control use cases, a M-to-N 3745 communication topology would be required, for instance in case 3746 multiple sensors (presence or day-light) are responsible to 3747 trigger events to a set of lighting devices. Especially in 3748 professional lighting scenarios, the roles of client and server 3749 are configured by the lighting commissioner, and devices strictly 3750 follow those roles. 3752 * Integrated building control: enabling Building Automation and 3753 Control Systems (BACSs) to control multiple heating, ventilation 3754 and air-conditioning units to predefined presets. Controlled 3755 units can be organized into application groups and CoAP groups in 3756 order to reflect their physical position in the building, e.g., 3757 devices in the same room can be configured as members of a single 3758 application group and corresponding CoAP group. As a practical 3759 guideline, events within intervals of seconds are typically 3760 acceptable. Controlled units are expected to possibly reply back 3761 to the BACS issuing control commands, in order to report about the 3762 execution of the requested operation (e.g., OK, failure, error) 3763 and their current operational status. 3765 * Software and firmware updates: software and firmware updates often 3766 comprise quite a large amount of data. This can overload a Low- 3767 power and Lossy Network (LLN) that is otherwise typically used to 3768 deal with only small amounts of data, on an infrequent base. 3769 Rather than sending software and firmware updates as unicast 3770 messages to each individual device, multicasting such updated data 3771 to a larger set of devices at once displays a number of benefits. 3772 For instance, it can significantly reduce the network load and 3773 decrease the overall time latency for propagating this data to all 3774 devices. Even if the complete whole update process itself is 3775 secured, securing the individual messages is important, in case 3776 updates consist of relatively large amounts of data. In fact, 3777 checking individual received data piecemeal for tampering avoids 3778 that devices store large amounts of partially corrupted data and 3779 that they detect tampering hereof only after all data has been 3780 received. Devices receiving software and firmware updates are 3781 expected to possibly reply back, in order to provide a feedback 3782 about the execution of the update operation (e.g., OK, failure, 3783 error) and their current operational status. 3785 * Parameter and configuration update: by means of multicast 3786 communication, it is possible to update the settings of a set of 3787 similar devices, both simultaneously and efficiently. Possible 3788 parameters are related, for instance, to network load management 3789 or network access controls. Devices receiving parameter and 3790 configuration updates are expected to possibly reply back, to 3791 provide a feedback about the execution of the update operation 3792 (e.g., OK, failure, error) and their current operational status. 3794 * Commissioning of Low-power and Lossy Network (LLN) systems: a 3795 commissioning device is responsible for querying all devices in 3796 the local network or a selected subset of them, in order to 3797 discover their presence, and be aware of their capabilities, 3798 default configuration, and operating conditions. Queried devices 3799 displaying similarities in their capabilities and features, or 3800 sharing a common physical location can be configured as members of 3801 a single application group and corresponding CoAP group. Queried 3802 devices are expected to reply back to the commissioning device, in 3803 order to notify their presence, and provide the requested 3804 information and their current operational status. 3806 * Emergency multicast: a particular emergency related information 3807 (e.g., natural disaster) is generated and multicast by an 3808 emergency notifier, and relayed to multiple devices. The latter 3809 may reply back to the emergency notifier, in order to provide 3810 their feedback and local information related to the ongoing 3811 emergency. This kind of setups should additionally rely on a 3812 fault tolerance multicast algorithm, such as Multicast Protocol 3813 for Low-Power and Lossy Networks (MPL). 3815 Appendix C. Example of Group Identifier Format 3817 This section provides an example of how the Group Identifier (Gid) 3818 can be specifically formatted. That is, the Gid can be composed of 3819 two parts, namely a Group Prefix and a Group Epoch. 3821 For each group, the Group Prefix is constant over time and is 3822 uniquely defined in the set of all the groups associated to the same 3823 Group Manager. The choice of the Group Prefix for a given group's 3824 Security Context is application specific. The size of the Group 3825 Prefix directly impact on the maximum number of distinct groups under 3826 the same Group Manager. 3828 The Group Epoch is set to 0 upon the group's initialization, and is 3829 incremented by 1 each time new keying material, together with a new 3830 Gid, is distributed to the group in order to establish a new Security 3831 Context (see Section 3.2). 3833 As an example, a 3-byte Gid can be composed of: i) a 1-byte Group 3834 Prefix '0xb1' interpreted as a raw byte string; and ii) a 2-byte 3835 Group Epoch interpreted as an unsigned integer ranging from 0 to 3836 65535. Then, after having established the Common Context 61532 times 3837 in the group, its Gid will assume value '0xb1f05c'. 3839 Using an immutable Group Prefix for a group assumes that enough time 3840 elapses before all possible Group Epoch values are used, i.e., before 3841 the Group Manager starts reassigning Gid values to the same group 3842 (see Section 3.2). Thus, the expected highest rate for addition/ 3843 removal of group members and consequent group rekeying should be 3844 taken into account for a proper dimensioning of the Group Epoch size. 3846 As discussed in Section 11.6, if endpoints are deployed in multiple 3847 groups managed by different non-synchronized Group Managers, it is 3848 possible that Group Identifiers of different groups coincide at some 3849 point in time. In this case, a recipient has to handle coinciding 3850 Group Identifiers, and has to try using different Security Contexts 3851 to process an incoming message, until the right one is found and the 3852 message is correctly verified. Therefore, it is favorable that Group 3853 Identifiers from different Group Managers have a size that result in 3854 a small probability of collision. How small this probability should 3855 be is up to system designers. 3857 Appendix D. Set-up of New Endpoints 3859 An endpoint joins a group by explicitly interacting with the 3860 responsible Group Manager. When becoming members of a group, 3861 endpoints are not required to know how many and what endpoints are in 3862 the same group. 3864 Communications between a joining endpoint and the Group Manager rely 3865 on the CoAP protocol and must be secured. Specific details on how to 3866 secure communications between joining endpoints and a Group Manager 3867 are out of the scope of this document. 3869 The Group Manager must verify that the joining endpoint is authorized 3870 to join the group. To this end, the Group Manager can directly 3871 authorize the joining endpoint, or expect it to provide authorization 3872 evidence previously obtained from a trusted entity. Further details 3873 about the authorization of joining endpoints are out of scope. 3875 In case of successful authorization check, the Group Manager 3876 generates a Sender ID assigned to the joining endpoint, before 3877 proceeding with the rest of the join process. That is, the Group 3878 Manager provides the joining endpoint with the keying material and 3879 parameters to initialize the Security Context, including its own 3880 public key (see Section 2). The actual provisioning of keying 3881 material and parameters to the joining endpoint is out of the scope 3882 of this document. 3884 It is RECOMMENDED that the join process adopts the approach described 3885 in [I-D.ietf-ace-key-groupcomm-oscore] and based on the ACE framework 3886 for Authentication and Authorization in constrained environments 3887 [I-D.ietf-ace-oauth-authz]. 3889 Appendix E. Challenge-Response Synchronization 3891 This section describes a possible approach that a server endpoint can 3892 use to synchronize with Sender Sequence Numbers of client endpoints 3893 in the group. In particular, the server performs a challenge- 3894 response exchange with a client, by using the Echo Option for CoAP 3895 described in Section 2 of [I-D.ietf-core-echo-request-tag] and 3896 according to Appendix B.1.2 of [RFC8613]. 3898 That is, upon receiving a request from a particular client for the 3899 first time, the server processes the message as described in this 3900 document, but, even if valid, does not deliver it to the application. 3901 Instead, the server replies to the client with an OSCORE protected 3902 4.01 (Unauthorized) response message, including only the Echo Option 3903 and no diagnostic payload. The Echo option value SHOULD NOT be 3904 reused; when it is reused, it MUST be highly unlikely to have been 3905 used with this client recently. Since this response is protected 3906 with the Security Context used in the group, the client will consider 3907 the response valid upon successfully decrypting and verifying it. 3909 The server stores the Echo Option value included therein, together 3910 with the pair (gid,kid), where 'gid' is the Group Identifier of the 3911 OSCORE group and 'kid' is the Sender ID of the client in the group, 3912 as specified in the 'kid context' and 'kid' fields of the OSCORE 3913 Option of the request, respectively. After a group rekeying has been 3914 completed and a new Security Context has been established in the 3915 group, which results also in a new Group Identifier (see 3916 Section 3.2), the server MUST delete all the stored Echo values 3917 associated to members of that group. 3919 Upon receiving a 4.01 (Unauthorized) response that includes an Echo 3920 Option and originates from a verified group member, the client sends 3921 a request as a unicast message addressed to the same server, echoing 3922 the Echo Option value. The client MUST NOT send the request 3923 including the Echo Option over multicast. 3925 If the group uses also the group mode and the used Signature 3926 Algorithm supports ECDH (e.g., ECDSA, EdDSA), the client MUST use the 3927 pairwise mode of Group OSCORE to protect the request, as described in 3928 Section 9.3. Note that, as defined in Section 9, members of such a 3929 group and that use the Echo Option MUST support the pairwise mode. 3931 The client does not necessarily resend the same group request, but 3932 can instead send a more recent one, if the application permits it. 3933 This makes it possible for the client to not retain previously sent 3934 group requests for full retransmission, unless the application 3935 explicitly requires otherwise. In either case, the client uses a 3936 fresh Sender Sequence Number value from its own Sender Context. If 3937 the client stores group requests for possible retransmission with the 3938 Echo Option, it should not store a given request for longer than a 3939 preconfigured time interval. Note that the unicast request echoing 3940 the Echo Option is correctly treated and processed as a message, 3941 since the 'kid context' field including the Group Identifier of the 3942 OSCORE group is still present in the OSCORE Option as part of the 3943 COSE object (see Section 4). 3945 Upon receiving the unicast request including the Echo Option, the 3946 server performs the following verifications. 3948 * If the server does not store an Echo Option value for the pair 3949 (gid,kid), it considers: i) the time t1 when it has established 3950 the Security Context used to protect the received request; and ii) 3951 the time t2 when the request has been received. Since a valid 3952 request cannot be older than the Security Context used to protect 3953 it, the server verifies that (t2 - t1) is less than the largest 3954 amount of time acceptable to consider the request fresh. 3956 * If the server stores an Echo Option value for the pair (gid,kid) 3957 associated to that same client in the same group, the server 3958 verifies that the option value equals that same stored value 3959 previously sent to that client. 3961 If the verifications above fail, the server MUST NOT process the 3962 request further and MAY send a 4.01 (Unauthorized) response including 3963 an Echo Option. 3965 If the verifications above are successful and the Replay Window has 3966 not been set yet, the server updates its Replay Window to mark the 3967 current Sender Sequence Number from the latest received request as 3968 seen (but all newer ones as new), and delivers the message as fresh 3969 to the application. Otherwise, it discards the verification result 3970 and treats the message as fresh or as a replay, according to the 3971 existing Replay Window. 3973 A server should not deliver requests from a given client to the 3974 application until one valid request from that same client has been 3975 verified as fresh, as conveying an echoed Echo Option 3976 [I-D.ietf-core-echo-request-tag]. Also, a server may perform the 3977 challenge-response described above at any time, if synchronization 3978 with Sender Sequence Numbers of clients is lost, for instance after a 3979 device reboot. A client has to be always ready to perform the 3980 challenge-response based on the Echo Option in case a server starts 3981 it. 3983 It is the role of the server application to define under what 3984 circumstances Sender Sequence Numbers lose synchronization. This can 3985 include experiencing a "large enough" gap D = (SN2 - SN1), between 3986 the Sender Sequence Number SN1 of the latest accepted group request 3987 from a client and the Sender Sequence Number SN2 of a group request 3988 just received from that client. However, a client may send several 3989 unicast requests to different group members as protected with the 3990 pairwise mode (see Section 9.3), which may result in the server 3991 experiencing the gap D in a relatively short time. This would induce 3992 the server to perform more challenge-response exchanges than actually 3993 needed. 3995 To ameliorate this, the server may rather rely on a trade-off between 3996 the Sender Sequence Number gap D and a time gap T = (t2 - t1), where 3997 t1 is the time when the latest group request from a client was 3998 accepted and t2 is the time when the latest group request from that 3999 client has been received, respectively. Then, the server can start a 4000 challenge-response when experiencing a time gap T larger than a 4001 given, preconfigured threshold. Also, the server can start a 4002 challenge-response when experiencing a Sender Sequence Number gap D 4003 greater than a different threshold, computed as a monotonically 4004 increasing function of the currently experienced time gap T. 4006 The challenge-response approach described in this appendix provides 4007 an assurance of absolute message freshness. However, it can result 4008 in an impact on performance which is undesirable or unbearable, 4009 especially in large groups where many endpoints at the same time 4010 might join as new members or lose synchronization. 4012 Note that endpoints configured as silent servers are not able to 4013 perform the challenge-response described above, as they do not store 4014 a Sender Context to secure the 4.01 (Unauthorized) response to the 4015 client. Therefore, silent servers should adopt alternative 4016 approaches to achieve and maintain synchronization with Sender 4017 Sequence Numbers of clients. 4019 Since requests including the Echo Option are sent over unicast, a 4020 server can be a victim of the attack discussed in Section 11.9, when 4021 such requests are protected with the group mode of Group OSCORE, as 4022 described in Section 8.1. 4024 Instead, protecting requests with the Echo Option by using the 4025 pairwise mode of Group OSCORE as described in Section 9.3 prevents 4026 the attack in Section 11.9. In fact, only the exact server involved 4027 in the Echo exchange is able to derive the correct pairwise key used 4028 by the client to protect the request including the Echo Option. 4030 In either case, an internal on-path adversary would not be able to 4031 mix up the Echo Option value of two different unicast requests, sent 4032 by a same client to any two different servers in the group. In fact, 4033 if the group mode was used, this would require the adversary to forge 4034 the client's countersignature in both such requests. As a 4035 consequence, each of the two servers remains able to selectively 4036 accept a request with the Echo Option only if it is waiting for that 4037 exact integrity-protected Echo Option value, and is thus the intended 4038 recipient. 4040 Appendix F. Document Updates 4042 RFC EDITOR: PLEASE REMOVE THIS SECTION. 4044 F.1. Version -12 to -13 4046 * Fixes in the derivation of the Group Encryption Key. 4048 * Added Mandatory-to-Implement compliance requirements. 4050 * Changed UCCS to CCS. 4052 F.2. Version -11 to -12 4054 * No mode of operation is mandatory to support. 4056 * Revised parameters of the Security Context, COSE object and 4057 external_aad. 4059 * Revised management of keying material for the Group Manager. 4061 * Informing of former members when rekeying the group. 4063 * Admit encryption-only algorithms in group mode. 4065 * Encrypted countersignature through a keystream. 4067 * Added public key of the Group Manager as key material and 4068 protected data. 4070 * Clarifications about message processing, especially notifications. 4072 * Guidance for message processing of external signature checkers. 4074 * Updated derivation of pairwise keys, with more security 4075 considerations. 4077 * Termination of ongoing observations as client, upon leaving or 4078 before re-joining the group. 4080 * Recycling Group IDs by tracking the "Birth Gid" of each group 4081 member. 4083 * Expanded security and privacy considerations about the group mode. 4085 * Removed appendices on skipping signature verification and on COSE 4086 capabilities. 4088 * Fixes and editorial improvements. 4090 F.3. Version -10 to -11 4092 * Loss of Recipient Contexts due to their overflow. 4094 * Added diagram on keying material components and their relation. 4096 * Distinction between anti-replay and freshness. 4098 * Preservation of Sender IDs over rekeying. 4100 * Clearer cause-effect about reset of SSN. 4102 * The GM provides public keys of group members with associated 4103 Sender IDs. 4105 * Removed 'par_countersign_key' from the external_aad. 4107 * One single format for the external_aad, both for encryption and 4108 signing. 4110 * Presence of 'kid' in responses to requests protected with the 4111 pairwise mode. 4113 * Inclusion of 'kid_context' in notifications following a group 4114 rekeying. 4116 * Pairwise mode presented with OSCORE as baseline. 4118 * Revised examples with signature values. 4120 * Decoupled growth of clients' Sender Sequence Numbers and loss of 4121 synchronization for server. 4123 * Sender IDs not recycled in the group under the same Gid. 4125 * Processing and description of the Group Flag bit in the OSCORE 4126 option. 4128 * Usage of the pairwise mode for multicast requests. 4130 * Clarifications on synchronization using the Echo option. 4132 * General format of context parameters and external_aad elements, 4133 supporting future registered COSE algorithms (new Appendix). 4135 * Fixes and editorial improvements. 4137 F.4. Version -09 to -10 4139 * Removed 'Counter Signature Key Parameters' from the Common 4140 Context. 4142 * New parameters in the Common Context covering the DH secret 4143 derivation. 4145 * New countersignature header parameter from draft-ietf-cose- 4146 countersign. 4148 * Stronger policies non non-recycling of Sender IDs and Gid. 4150 * The Sender Sequence Number is reset when establishing a new 4151 Security Context. 4153 * Added 'request_kid_context' in the aad_array. 4155 * The server can respond with 5.03 if the client's public key is not 4156 available. 4158 * The observer client stores an invariant identifier of the group. 4160 * Relaxed storing of original 'kid' for observer clients. 4162 * Both client and server store the 'kid_context' of the original 4163 observation request. 4165 * The server uses a fresh PIV if protecting the response with a 4166 Security Context different from the one used to protect the 4167 request. 4169 * Clarifications on MTI algorithms and curves. 4171 * Removed optimized requests. 4173 * Overall clarifications and editorial revision. 4175 F.5. Version -08 to -09 4177 * Pairwise keys are discarded after group rekeying. 4179 * Signature mode renamed to group mode. 4181 * The parameters for countersignatures use the updated COSE 4182 registries. Newly defined IANA registries have been removed. 4184 * Pairwise Flag bit renamed as Group Flag bit, set to 1 in group 4185 mode and set to 0 in pairwise mode. 4187 * Dedicated section on updating the Security Context. 4189 * By default, sender sequence numbers and replay windows are not 4190 reset upon group rekeying. 4192 * An endpoint implementing only a silent server does not support the 4193 pairwise mode. 4195 * Separate section on general message reception. 4197 * Pairwise mode moved to the document body. 4199 * Considerations on using the pairwise mode in non-multicast 4200 settings. 4202 * Optimized requests are moved as an appendix. 4204 * Normative support for the signature and pairwise mode. 4206 * Revised methods for synchronization with clients' sender sequence 4207 number. 4209 * Appendix with example values of parameters for countersignatures. 4211 * Clarifications and editorial improvements. 4213 F.6. Version -07 to -08 4215 * Clarified relation between pairwise mode and group communication 4216 (Section 1). 4218 * Improved definition of "silent server" (Section 1.1). 4220 * Clarified when a Recipient Context is needed (Section 2). 4222 * Signature checkers as entities supported by the Group Manager 4223 (Section 2.3). 4225 * Clarified that the Group Manager is under exclusive control of Gid 4226 and Sender ID values in a group, with Sender ID values under each 4227 Gid value (Section 2.3). 4229 * Mitigation policies in case of recycled 'kid' values 4230 (Section 2.4). 4232 * More generic exhaustion (not necessarily wrap-around) of sender 4233 sequence numbers (Sections 2.5 and 10.11). 4235 * Pairwise key considerations, as to group rekeying and Sender 4236 Sequence Numbers (Section 3). 4238 * Added reference to static-static Diffie-Hellman shared secret 4239 (Section 3). 4241 * Note for implementation about the external_aad for signing 4242 (Sectino 4.3.2). 4244 * Retransmission by the application for group requests over 4245 multicast as Non-Confirmable (Section 7). 4247 * A server MUST use its own Partial IV in a response, if protecting 4248 it with a different context than the one used for the request 4249 (Section 7.3). 4251 * Security considerations: encryption of pairwise mode as 4252 alternative to group-level security (Section 10.1). 4254 * Security considerations: added approach to reduce the chance of 4255 global collisions of Gid values from different Group Managers 4256 (Section 10.5). 4258 * Security considerations: added implications for block-wise 4259 transfers when using the signature mode for requests over unicast 4260 (Section 10.7). 4262 * Security considerations: (multiple) supported signature algorithms 4263 (Section 10.13). 4265 * Security considerations: added privacy considerations on the 4266 approach for reducing global collisions of Gid values 4267 (Section 10.15). 4269 * Updates to the methods for synchronizing with clients' sequence 4270 number (Appendix E). 4272 * Simplified text on discovery services supporting the pairwise mode 4273 (Appendix G.1). 4275 * Editorial improvements. 4277 F.7. Version -06 to -07 4279 * Updated abstract and introduction. 4281 * Clarifications of what pertains a group rekeying. 4283 * Derivation of pairwise keying material. 4285 * Content re-organization for COSE Object and OSCORE header 4286 compression. 4288 * Defined the Pairwise Flag bit for the OSCORE option. 4290 * Supporting CoAP Observe for group requests and responses. 4292 * Considerations on message protection across switching to new 4293 keying material. 4295 * New optimized mode based on pairwise keying material. 4297 * More considerations on replay protection and Security Contexts 4298 upon key renewal. 4300 * Security considerations on Group OSCORE for unicast requests, also 4301 as affecting the usage of the Echo option. 4303 * Clarification on different types of groups considered 4304 (application/security/CoAP). 4306 * New pairwise mode, using pairwise keying material for both 4307 requests and responses. 4309 F.8. Version -05 to -06 4311 * Group IDs mandated to be unique under the same Group Manager. 4313 * Clarifications on parameter update upon group rekeying. 4315 * Updated external_aad structures. 4317 * Dynamic derivation of Recipient Contexts made optional and 4318 application specific. 4320 * Optional 4.00 response for failed signature verification on the 4321 server. 4323 * Removed client handling of duplicated responses to multicast 4324 requests. 4326 * Additional considerations on public key retrieval and group 4327 rekeying. 4329 * Added Group Manager responsibility on validating public keys. 4331 * Updates IANA registries. 4333 * Reference to RFC 8613. 4335 * Editorial improvements. 4337 F.9. Version -04 to -05 4339 * Added references to draft-dijk-core-groupcomm-bis. 4341 * New parameter Counter Signature Key Parameters (Section 2). 4343 * Clarification about Recipient Contexts (Section 2). 4345 * Two different external_aad for encrypting and signing 4346 (Section 3.1). 4348 * Updated response verification to handle Observe notifications 4349 (Section 6.4). 4351 * Extended Security Considerations (Section 8). 4353 * New "Counter Signature Key Parameters" IANA Registry 4354 (Section 9.2). 4356 F.10. Version -03 to -04 4358 * Added the new "Counter Signature Parameters" in the Common Context 4359 (see Section 2). 4361 * Added recommendation on using "deterministic ECDSA" if ECDSA is 4362 used as countersignature algorithm (see Section 2). 4364 * Clarified possible asynchronous retrieval of keying material from 4365 the Group Manager, in order to process incoming messages (see 4366 Section 2). 4368 * Structured Section 3 into subsections. 4370 * Added the new 'par_countersign' to the aad_array of the 4371 external_aad (see Section 3.1). 4373 * Clarified non reliability of 'kid' as identity indicator for a 4374 group member (see Section 2.1). 4376 * Described possible provisioning of new Sender ID in case of 4377 Partial IV wrap-around (see Section 2.2). 4379 * The former signature bit in the Flag Byte of the OSCORE option 4380 value is reverted to reserved (see Section 4.1). 4382 * Updated examples of compressed COSE object, now with the sixth 4383 less significant bit in the Flag Byte of the OSCORE option value 4384 set to 0 (see Section 4.3). 4386 * Relaxed statements on sending error messages (see Section 6). 4388 * Added explicit step on computing the countersignature for outgoing 4389 messages (see Sections 6.1 and 6.3). 4391 * Handling of just created Recipient Contexts in case of 4392 unsuccessful message verification (see Sections 6.2 and 6.4). 4394 * Handling of replied/repeated responses on the client (see 4395 Section 6.4). 4397 * New IANA Registry "Counter Signature Parameters" (see 4398 Section 9.1). 4400 F.11. Version -02 to -03 4402 * Revised structure and phrasing for improved readability and better 4403 alignment with draft-ietf-core-object-security. 4405 * Added discussion on wrap-Around of Partial IVs (see Section 2.2). 4407 * Separate sections for the COSE Object (Section 3) and the OSCORE 4408 Header Compression (Section 4). 4410 * The countersignature is now appended to the encrypted payload of 4411 the OSCORE message, rather than included in the OSCORE Option (see 4412 Section 4). 4414 * Extended scope of Section 5, now titled " Message Binding, 4415 Sequence Numbers, Freshness and Replay Protection". 4417 * Clarifications about Non-Confirmable messages in Section 5.1 4418 "Synchronization of Sender Sequence Numbers". 4420 * Clarifications about error handling in Section 6 "Message 4421 Processing". 4423 * Compacted list of responsibilities of the Group Manager in 4424 Section 7. 4426 * Revised and extended security considerations in Section 8. 4428 * Added IANA considerations for the OSCORE Flag Bits Registry in 4429 Section 9. 4431 * Revised Appendix D, now giving a short high-level description of a 4432 new endpoint set-up. 4434 F.12. Version -01 to -02 4436 * Terminology has been made more aligned with RFC7252 and draft- 4437 ietf-core-object-security: i) "client" and "server" replace the 4438 old "multicaster" and "listener", respectively; ii) "silent 4439 server" replaces the old "pure listener". 4441 * Section 2 has been updated to have the Group Identifier stored in 4442 the 'ID Context' parameter defined in draft-ietf-core-object- 4443 security. 4445 * Section 3 has been updated with the new format of the Additional 4446 Authenticated Data. 4448 * Major rewriting of Section 4 to better highlight the differences 4449 with the message processing in draft-ietf-core-object-security. 4451 * Added Sections 7.2 and 7.3 discussing security considerations 4452 about uniqueness of (key, nonce) and collision of group 4453 identifiers, respectively. 4455 * Minor updates to Appendix A.1 about assumptions on multicast 4456 communication topology and group size. 4458 * Updated Appendix C on format of group identifiers, with practical 4459 implications of possible collisions of group identifiers. 4461 * Updated Appendix D.2, adding a pointer to draft-palombini-ace-key- 4462 groupcomm about retrieval of nodes' public keys through the Group 4463 Manager. 4465 * Minor updates to Appendix E.3 about Challenge-Response 4466 synchronization of sequence numbers based on the Echo option from 4467 draft-ietf-core-echo-request-tag. 4469 F.13. Version -00 to -01 4471 * Section 1.1 has been updated with the definition of group as 4472 "security group". 4474 * Section 2 has been updated with: 4476 - Clarifications on establishment/derivation of Security 4477 Contexts. 4479 - A table summarizing the the additional context elements 4480 compared to OSCORE. 4482 * Section 3 has been updated with: 4484 - Examples of request and response messages. 4486 - Use of CounterSignature0 rather than CounterSignature. 4488 - Additional Authenticated Data including also the signature 4489 algorithm, while not including the Group Identifier any longer. 4491 * Added Section 6, listing the responsibilities of the Group 4492 Manager. 4494 * Added Appendix A (former section), including assumptions and 4495 security objectives. 4497 * Appendix B has been updated with more details on the use cases. 4499 * Added Appendix C, providing an example of Group Identifier format. 4501 * Appendix D has been updated to be aligned with draft-palombini- 4502 ace-key-groupcomm. 4504 Acknowledgments 4506 The authors sincerely thank Christian Amsuess, Stefan Beck, Rolf 4507 Blom, Carsten Bormann, Esko Dijk, Martin Gunnarsson, Klaus Hartke, 4508 Rikard Hoeglund, Richard Kelsey, Dave Robin, Jim Schaad, Ludwig 4509 Seitz, Peter van der Stok and Erik Thormarker for their feedback and 4510 comments. 4512 The work on this document has been partly supported by VINNOVA and 4513 the Celtic-Next project CRITISEC; the H2020 project SIFIS-Home (Grant 4514 agreement 952652); the SSF project SEC4Factory under the grant 4515 RIT17-0032; and the EIT-Digital High Impact Initiative ACTIVE. 4517 Authors' Addresses 4519 Marco Tiloca 4520 RISE AB 4521 Isafjordsgatan 22 4522 SE-16440 Stockholm Kista 4523 Sweden 4525 Email: marco.tiloca@ri.se 4527 Göran Selander 4528 Ericsson AB 4529 Torshamnsgatan 23 4530 SE-16440 Stockholm Kista 4531 Sweden 4533 Email: goran.selander@ericsson.com 4535 Francesca Palombini 4536 Ericsson AB 4537 Torshamnsgatan 23 4538 SE-16440 Stockholm Kista 4539 Sweden 4541 Email: francesca.palombini@ericsson.com 4543 John Preuss Mattsson 4544 Ericsson AB 4545 Torshamnsgatan 23 4546 SE-16440 Stockholm Kista 4547 Sweden 4549 Email: john.mattsson@ericsson.com 4551 Jiye Park 4552 Universitaet Duisburg-Essen 4553 Schuetzenbahn 70 4554 45127 Essen 4555 Germany 4557 Email: ji-ye.park@uni-due.de