idnits 2.17.1 draft-ietf-core-oscore-groupcomm-11.txt: 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: ---------------------------------------------------------------------------- No issues found here. 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 (February 22, 2021) is 1159 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) -- Looks like a reference, but probably isn't: '1' on line 3266 -- Looks like a reference, but probably isn't: '6' on line 3170 -- Looks like a reference, but probably isn't: '7' on line 3171 -- Looks like a reference, but probably isn't: '2' on line 3198 -- Looks like a reference, but probably isn't: '3' on line 3198 -- Looks like a reference, but probably isn't: '4' on line 3190 -- Looks like a reference, but probably isn't: '5' on line 3192 -- Looks like a reference, but probably isn't: '0' on line 3293 == Outdated reference: A later version (-11) exists of draft-ietf-core-groupcomm-bis-03 == Outdated reference: A later version (-10) exists of draft-ietf-cose-countersign-02 -- 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 (-18) exists of draft-ietf-ace-key-groupcomm-11 == Outdated reference: A later version (-16) exists of draft-ietf-ace-key-groupcomm-oscore-10 == Outdated reference: A later version (-46) exists of draft-ietf-ace-oauth-authz-37 == Outdated reference: A later version (-14) exists of draft-ietf-core-echo-request-tag-12 == Outdated reference: A later version (-23) exists of draft-ietf-lwig-curve-representations-20 == Outdated reference: A later version (-07) exists of draft-ietf-lwig-security-protocol-comparison-05 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-41 == 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 (~~), 11 warnings (==), 13 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: August 26, 2021 F. Palombini 6 J. Mattsson 7 Ericsson AB 8 J. Park 9 Universitaet Duisburg-Essen 10 February 22, 2021 12 Group OSCORE - Secure Group Communication for CoAP 13 draft-ietf-core-oscore-groupcomm-11 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. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at https://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on August 26, 2021. 42 Copyright Notice 44 Copyright (c) 2021 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (https://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 60 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 61 2. Security Context . . . . . . . . . . . . . . . . . . . . . . 7 62 2.1. Common Context . . . . . . . . . . . . . . . . . . . . . 9 63 2.1.1. ID Context . . . . . . . . . . . . . . . . . . . . . 9 64 2.1.2. Counter Signature Algorithm . . . . . . . . . . . . . 9 65 2.1.3. Counter Signature Parameters . . . . . . . . . . . . 9 66 2.1.4. Secret Derivation Algorithm . . . . . . . . . . . . . 10 67 2.1.5. Secret Derivation Parameters . . . . . . . . . . . . 11 68 2.2. Sender Context and Recipient Context . . . . . . . . . . 11 69 2.3. Pairwise Keys . . . . . . . . . . . . . . . . . . . . . . 12 70 2.3.1. Derivation of Pairwise Keys . . . . . . . . . . . . . 12 71 2.3.2. Usage of Sequence Numbers . . . . . . . . . . . . . . 13 72 2.3.3. Security Context for Pairwise Mode . . . . . . . . . 14 73 2.4. Update of Security Context . . . . . . . . . . . . . . . 14 74 2.4.1. Loss of Mutable Security Context . . . . . . . . . . 15 75 2.4.2. Exhaustion of Sender Sequence Number . . . . . . . . 16 76 2.4.3. Retrieving New Security Context Parameters . . . . . 17 77 3. The Group Manager . . . . . . . . . . . . . . . . . . . . . . 19 78 3.1. Management of Group Keying Material . . . . . . . . . . . 20 79 3.2. Responsibilities of the Group Manager . . . . . . . . . . 21 80 4. The COSE Object . . . . . . . . . . . . . . . . . . . . . . . 23 81 4.1. Counter Signature . . . . . . . . . . . . . . . . . . . . 23 82 4.2. The 'kid' and 'kid context' parameters . . . . . . . . . 23 83 4.3. external_aad . . . . . . . . . . . . . . . . . . . . . . 23 84 5. OSCORE Header Compression . . . . . . . . . . . . . . . . . . 25 85 5.1. Examples of Compressed COSE Objects . . . . . . . . . . . 26 86 5.1.1. Examples in Group Mode . . . . . . . . . . . . . . . 26 87 5.1.2. Examples in Pairwise Mode . . . . . . . . . . . . . . 27 88 6. Message Binding, Sequence Numbers, Freshness and Replay 89 Protection . . . . . . . . . . . . . . . . . . . . . . . . . 28 90 6.1. Update of Replay Window . . . . . . . . . . . . . . . . . 28 91 6.2. Message Freshness . . . . . . . . . . . . . . . . . . . . 29 92 7. Message Reception . . . . . . . . . . . . . . . . . . . . . . 29 93 8. Message Processing in Group Mode . . . . . . . . . . . . . . 30 94 8.1. Protecting the Request . . . . . . . . . . . . . . . . . 31 95 8.1.1. Supporting Observe . . . . . . . . . . . . . . . . . 31 96 8.2. Verifying the Request . . . . . . . . . . . . . . . . . . 32 97 8.2.1. Supporting Observe . . . . . . . . . . . . . . . . . 34 98 8.3. Protecting the Response . . . . . . . . . . . . . . . . . 34 99 8.3.1. Supporting Observe . . . . . . . . . . . . . . . . . 35 100 8.4. Verifying the Response . . . . . . . . . . . . . . . . . 35 101 8.4.1. Supporting Observe . . . . . . . . . . . . . . . . . 36 102 9. Message Processing in Pairwise Mode . . . . . . . . . . . . . 37 103 9.1. Pre-Conditions . . . . . . . . . . . . . . . . . . . . . 38 104 9.2. Main Differences from OSCORE . . . . . . . . . . . . . . 38 105 9.3. Protecting the Request . . . . . . . . . . . . . . . . . 39 106 9.4. Verifying the Request . . . . . . . . . . . . . . . . . . 39 107 9.5. Protecting the Response . . . . . . . . . . . . . . . . . 39 108 9.6. Verifying the Response . . . . . . . . . . . . . . . . . 40 109 10. Security Considerations . . . . . . . . . . . . . . . . . . . 40 110 10.1. Group-level Security . . . . . . . . . . . . . . . . . . 41 111 10.2. Uniqueness of (key, nonce) . . . . . . . . . . . . . . . 42 112 10.3. Management of Group Keying Material . . . . . . . . . . 42 113 10.4. Update of Security Context and Key Rotation . . . . . . 43 114 10.4.1. Late Update on the Sender . . . . . . . . . . . . . 43 115 10.4.2. Late Update on the Recipient . . . . . . . . . . . . 44 116 10.5. Collision of Group Identifiers . . . . . . . . . . . . . 44 117 10.6. Cross-group Message Injection . . . . . . . . . . . . . 45 118 10.6.1. Attack Description . . . . . . . . . . . . . . . . . 45 119 10.6.2. Attack Prevention in Group Mode . . . . . . . . . . 46 120 10.7. Group OSCORE for Unicast Requests . . . . . . . . . . . 47 121 10.8. End-to-end Protection . . . . . . . . . . . . . . . . . 48 122 10.9. Master Secret . . . . . . . . . . . . . . . . . . . . . 48 123 10.10. Replay Protection . . . . . . . . . . . . . . . . . . . 49 124 10.11. Message Freshness . . . . . . . . . . . . . . . . . . . 49 125 10.12. Client Aliveness . . . . . . . . . . . . . . . . . . . . 50 126 10.13. Cryptographic Considerations . . . . . . . . . . . . . . 50 127 10.14. Message Segmentation . . . . . . . . . . . . . . . . . . 51 128 10.15. Privacy Considerations . . . . . . . . . . . . . . . . . 51 129 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 130 11.1. OSCORE Flag Bits Registry . . . . . . . . . . . . . . . 52 131 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 52 132 12.1. Normative References . . . . . . . . . . . . . . . . . . 52 133 12.2. Informative References . . . . . . . . . . . . . . . . . 54 134 Appendix A. Assumptions and Security Objectives . . . . . . . . 56 135 A.1. Assumptions . . . . . . . . . . . . . . . . . . . . . . . 57 136 A.2. Security Objectives . . . . . . . . . . . . . . . . . . . 58 137 Appendix B. List of Use Cases . . . . . . . . . . . . . . . . . 59 138 Appendix C. Example of Group Identifier Format . . . . . . . . . 61 139 Appendix D. Set-up of New Endpoints . . . . . . . . . . . . . . 62 140 Appendix E. Challenge-Response Synchronization . . . . . . . . . 63 141 Appendix F. No Verification of Signatures in Group Mode . . . . 66 142 Appendix G. Example Values with COSE Capabilities . . . . . . . 67 143 Appendix H. Parameter Extensibility for Future COSE Algorithms . 68 144 H.1. Counter Signature Parameters . . . . . . . . . . . . . . 68 145 H.2. Secret Derivation Parameters . . . . . . . . . . . . . . 69 146 H.3. 'par_countersign' in the external_aad . . . . . . . . . . 69 147 Appendix I. Document Updates . . . . . . . . . . . . . . . . . . 71 148 I.1. Version -10 to -11 . . . . . . . . . . . . . . . . . . . 71 149 I.2. Version -09 to -10 . . . . . . . . . . . . . . . . . . . 72 150 I.3. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 72 151 I.4. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 73 152 I.5. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 75 153 I.6. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 75 154 I.7. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 76 155 I.8. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 76 156 I.9. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 77 157 I.10. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 78 158 I.11. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 79 159 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 79 160 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 80 162 1. Introduction 164 The Constrained Application Protocol (CoAP) [RFC7252] is a web 165 transfer protocol specifically designed for constrained devices and 166 networks [RFC7228]. Group communication for CoAP 167 [I-D.ietf-core-groupcomm-bis] addresses use cases where deployed 168 devices benefit from a group communication model, for example to 169 reduce latencies, improve performance and reduce bandwidth 170 utilization. Use cases include lighting control, integrated building 171 control, software and firmware updates, parameter and configuration 172 updates, commissioning of constrained networks, and emergency 173 multicast (see Appendix B). This specification defines the security 174 protocol for Group communication for CoAP 175 [I-D.ietf-core-groupcomm-bis]. 177 Object Security for Constrained RESTful Environments (OSCORE) 178 [RFC8613] describes a security protocol based on the exchange of 179 protected CoAP messages. OSCORE builds on CBOR Object Signing and 180 Encryption (COSE) 181 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and 182 provides end-to-end encryption, integrity, replay protection and 183 binding of response to request between a sender and a recipient, 184 independent of the transport layer also in the presence of 185 intermediaries. To this end, a CoAP message is protected by 186 including its payload (if any), certain options, and header fields in 187 a COSE object, which replaces the authenticated and encrypted fields 188 in the protected message. 190 This document defines Group OSCORE, providing the same end-to-end 191 security properties as OSCORE in the case where CoAP requests have 192 multiple recipients. In particular, the described approach defines 193 how OSCORE is used in a group communication setting to provide source 194 authentication for CoAP group requests, sent by a client to multiple 195 servers, and for protection of the corresponding CoAP responses. 197 Just like OSCORE, Group OSCORE is independent of the transport layer 198 and works wherever CoAP does. Group communication for CoAP 199 [I-D.ietf-core-groupcomm-bis] uses UDP/IP multicast as the underlying 200 data transport. 202 As with OSCORE, it is possible to combine Group OSCORE with 203 communication security on other layers. One example is the use of 204 transport layer security, such as DTLS 205 [RFC6347][I-D.ietf-tls-dtls13], between one client and one proxy (and 206 vice versa), or between one proxy and one server (and vice versa), in 207 order to protect the routing information of packets from observers. 208 Note that DTLS does not define how to secure messages sent over IP 209 multicast. 211 Group OSCORE defines two modes of operation: 213 o In the group mode, Group OSCORE requests and responses are 214 digitally signed with the private key of the sender and the 215 signature is embedded in the protected CoAP message. The group 216 mode supports all COSE algorithms as well as signature 217 verification by intermediaries. This mode is defined in Section 8 218 and MUST be supported. 220 o In the pairwise mode, two group members exchange Group OSCORE 221 requests and responses over unicast, and the messages are 222 protected with symmetric keys. These symmetric keys are derived 223 from Diffie-Hellman shared secrets, calculated with the asymmetric 224 keys of the sender and recipient, allowing for shorter integrity 225 tags and therefore lower message overhead. This mode is defined 226 in Section 9 and is OPTIONAL to support. 228 Both modes provide source authentication of CoAP messages. The 229 application decides what mode to use, potentially on a per-message 230 basis. Such decisions can be based, for instance, on pre-configured 231 policies or dynamic assessing of the target recipient and/or 232 resource, among other things. One important case is when requests 233 are protected with the group mode, and responses with the pairwise 234 mode. Since such responses convey shorter integrity tags instead of 235 bigger, full-fledged signatures, this significantly reduces the 236 message overhead in case of many responses to one request. 238 A special deployment of Group OSCORE is to use pairwise mode only. 239 For example, consider the case of a constrained-node network 240 [RFC7228] with a large number of CoAP endpoints and the objective to 241 establish secure communication between any pair of endpoints with a 242 small provisioning effort and message overhead. Since the total 243 number of security associations that needs to be established grows 244 with the square of the number of nodes, it is desirable to restrict 245 the provisioned keying material. Moreover, a key establishment 246 protocol would need to be executed for each security association. 247 One solution to this is to deploy Group OSCORE, with the endpoints 248 being part of a group, and use the pairwise mode. This solution 249 assumes a trusted third party called Group Manager (see Section 3), 250 but has the benefit of restricting the symmetric keying material 251 while distributing only the public key of each group member. After 252 that, a CoAP endpoint can locally derive the OSCORE Security Context 253 for the other endpoint in the group, and protect CoAP communications 254 with very low overhead [I-D.ietf-lwig-security-protocol-comparison]. 256 1.1. Terminology 258 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 259 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 260 "OPTIONAL" in this document are to be interpreted as described in BCP 261 14 [RFC2119] [RFC8174] when, and only when, they appear in all 262 capitals, as shown here. 264 Readers are expected to be familiar with the terms and concepts 265 described in CoAP [RFC7252] including "endpoint", "client", "server", 266 "sender" and "recipient"; group communication for CoAP 267 [I-D.ietf-core-groupcomm-bis]; CBOR [RFC8949]; COSE 268 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and 269 related counter signatures [I-D.ietf-cose-countersign]. 271 Readers are also expected to be familiar with the terms and concepts 272 for protection and processing of CoAP messages through OSCORE, such 273 as "Security Context" and "Master Secret", defined in [RFC8613]. 275 Terminology for constrained environments, such as "constrained 276 device" and "constrained-node network", is defined in [RFC7228]. 278 This document refers also to the following terminology. 280 o Keying material: data that is necessary to establish and maintain 281 secure communication among endpoints. This includes, for 282 instance, keys and IVs [RFC4949]. 284 o Group: a set of endpoints that share group keying material and 285 security parameters (Common Context, see Section 2). That is, 286 unless otherwise specified, the term group used in this 287 specification refers to a "security group" (see Section 2.1 of 289 [I-D.ietf-core-groupcomm-bis]), not to be confused with "CoAP 290 group" or "application group". 292 o Group Manager: entity responsible for a group. Each endpoint in a 293 group communicates securely with the respective Group Manager, 294 which is neither required to be an actual group member nor to take 295 part in the group communication. The full list of 296 responsibilities of the Group Manager is provided in Section 3.2. 298 o Silent server: member of a group that never sends protected 299 responses in reply to requests. For CoAP group communications, 300 requests are normally sent without necessarily expecting a 301 response. A silent server may send unprotected responses, as 302 error responses reporting an OSCORE error. Note that an endpoint 303 can implement both a silent server and a client, i.e. the two 304 roles are independent. An endpoint acting only as a silent server 305 performs only Group OSCORE processing on incoming requests. 306 Silent servers maintain less keying material and in particular do 307 not have a Sender Context for the group. Since silent servers do 308 not have a Sender ID, they cannot support the pairwise mode. 310 o Group Identifier (Gid): identifier assigned to the group, unique 311 within the set of groups of a given Group Manager. 313 o Group request: CoAP request message sent by a client in the group 314 to all servers in that group. 316 o Source authentication: evidence that a received message in the 317 group originated from a specific identified group member. This 318 also provides assurance that the message was not tampered with by 319 anyone, be it a different legitimate group member or an endpoint 320 which is not a group member. 322 2. Security Context 324 This specification refers to a group as a set of endpoints sharing 325 keying material and security parameters for executing the Group 326 OSCORE protocol (see Section 1.1). Each endpoint which is member of 327 a group maintains a Security Context as defined in Section 3 of 328 [RFC8613], extended as follows (see Figure 1): 330 o One Common Context, shared by all the endpoints in the group. Two 331 new parameters are included in the Common Context, namely Counter 332 Signature Algorithm and Counter Signature Parameters. These 333 relate to the computation of counter signatures, when messages are 334 protected using the group mode (see Section 8). 336 If the pairwise mode is supported, the Common Context is further 337 extended with two new parameters, namely Secret Derivation 338 Algorithm and Secret Derivation Parameters. These relate to the 339 derivation of a static-static Diffie-Hellman shared secret, from 340 which pairwise keys are derived (see Section 2.3.1) to protect 341 messages with the pairwise mode (see Section 9). 343 o One Sender Context, extended with the endpoint's private key. The 344 private key is used to sign the message in group mode, and for 345 deriving the pairwise keys in pairwise mode (see Section 2.3). If 346 the pairwise mode is supported, the Sender Context is also 347 extended with the Pairwise Sender Keys associated to the other 348 endpoints (see Section 2.3). The Sender Context is omitted if the 349 endpoint is configured exclusively as silent server. 351 o One Recipient Context for each endpoint from which messages are 352 received. It is not necessary to maintain Recipient Contexts 353 associated to endpoints from which messages are not (expected to 354 be) received. The Recipient Context is extended with the public 355 key of the associated endpoint, used to verify the signature in 356 group mode and for deriving the pairwise keys in pairwise mode 357 (see Section 2.3). If the pairwise mode is supported, then the 358 Recipient Context is also extended with the Pairwise Recipient Key 359 associated to the other endpoint (see Section 2.3). 361 +-------------------+-----------------------------------------------+ 362 | Context Component | New Information Elements | 363 +-------------------+-----------------------------------------------+ 364 | Common Context | Counter Signature Algorithm | 365 | | Counter Signature Parameters | 366 | | *Secret Derivation Algorithm | 367 | | *Secret Derivation Parameters | 368 +-------------------+-----------------------------------------------+ 369 | Sender Context | Endpoint's own private key | 370 | | *Pairwise Sender Keys for the other endpoints | 371 +-------------------+-----------------------------------------------+ 372 | Each | Public key of the other endpoint | 373 | Recipient Context | *Pairwise Recipient Key of the other endpoint | 374 +-------------------+-----------------------------------------------+ 376 Figure 1: Additions to the OSCORE Security Context. Optional 377 additions are labeled with an asterisk. 379 Further details about the Security Context of Group OSCORE are 380 provided in the remainder of this section. How the Security Context 381 is established by the group members is out of scope for this 382 specification, but if there is more than one Security Context 383 applicable to a message, then the endpoints MUST be able to tell 384 which Security Context was latest established. 386 The default setting for how to manage information about the group is 387 described in terms of a Group Manager (see Section 3). 389 2.1. Common Context 391 The Common Context may be acquired from the Group Manager (see 392 Section 3). The following sections define how the Common Context is 393 extended, compared to [RFC8613]. 395 2.1.1. ID Context 397 The ID Context parameter (see Sections 3.3 and 5.1 of [RFC8613]) in 398 the Common Context SHALL contain the Group Identifier (Gid) of the 399 group. The choice of the Gid format is application specific. An 400 example of specific formatting of the Gid is given in Appendix C. 401 The application needs to specify how to handle potential collisions 402 between Gids (see Section 10.5). 404 2.1.2. Counter Signature Algorithm 406 Counter Signature Algorithm identifies the digital signature 407 algorithm used to compute a counter signature on the COSE object (see 408 Sections 3.2 and 3.3 of [I-D.ietf-cose-countersign]), when messages 409 are protected using the group mode (see Section 8). 411 This parameter is immutable once the Common Context is established. 412 Counter Signature Algorithm MUST take value from the "Value" column 413 of the "COSE Algorithms" Registry [COSE.Algorithms]. The value is 414 associated to a COSE key type, as specified in the "Capabilities" 415 column of the "COSE Algorithms" Registry [COSE.Algorithms]. COSE 416 capabilities for algorithms are defined in Section 8 of 417 [I-D.ietf-cose-rfc8152bis-algs]. 419 The EdDSA signature algorithm and the elliptic curve Ed25519 420 [RFC8032] are mandatory to implement. If elliptic curve signatures 421 are used, it is RECOMMENDED to implement deterministic signatures 422 with additional randomness as specified in 423 [I-D.mattsson-cfrg-det-sigs-with-noise]. 425 2.1.3. Counter Signature Parameters 427 Counter Signature Parameters identifies the parameters associated to 428 the digital signature algorithm specified in Counter Signature 429 Algorithm. This parameter is immutable once the Common Context is 430 established. 432 This parameter is a CBOR array including the following two elements, 433 whose exact structure and value depend on the value of Counter 434 Signature Algorithm: 436 o The first element is the array of COSE capabilities for Counter 437 Signature Algorithm, as specified for that algorithm in the 438 "Capabilities" column of the "COSE Algorithms" Registry 439 [COSE.Algorithms] (see Section 8.1 of 440 [I-D.ietf-cose-rfc8152bis-algs]). 442 o The second element is the array of COSE capabilities for the COSE 443 key type associated to Counter Signature Algorithm, as specified 444 for that key type in the "Capabilities" column of the "COSE Key 445 Types" Registry [COSE.Key.Types] (see Section 8.2 of 446 [I-D.ietf-cose-rfc8152bis-algs]). 448 Examples of Counter Signature Parameters are in Appendix G. 450 This format is consistent with every counter signature algorithm 451 currently considered in [I-D.ietf-cose-rfc8152bis-algs], i.e. with 452 algorithms that have only the COSE key type as their COSE capability. 453 Appendix H describes how Counter Signature Parameters can be 454 generalized for possible future registered algorithms having a 455 different set of COSE capabilities. 457 2.1.4. Secret Derivation Algorithm 459 Secret Derivation Algorithm identifies the elliptic curve Diffie- 460 Hellman algorithm used to derive a static-static Diffie-Hellman 461 shared secret, from which pairwise keys are derived (see 462 Section 2.3.1) to protect messages with the pairwise mode (see 463 Section 9). 465 This parameter is immutable once the Common Context is established. 466 Secret Derivation Algorithm MUST take value from the "Value" column 467 of the "COSE Algorithms" Registry [COSE.Algorithms]. The value is 468 associated to a COSE key type, as specified in the "Capabilities" 469 column of the "COSE Algorithms" Registry [COSE.Algorithms]. COSE 470 capabilities for algorithms are defined in Section 8 of 471 [I-D.ietf-cose-rfc8152bis-algs]. 473 For endpoints that support the pairwise mode, the ECDH-SS + HKDF-256 474 algorithm specified in Section 6.3.1 of 475 [I-D.ietf-cose-rfc8152bis-algs] and the X25519 curve [RFC7748] are 476 mandatory to implement. 478 2.1.5. Secret Derivation Parameters 480 Secret Derivation Parameters identifies the parameters associated to 481 the elliptic curve Diffie-Hellman algorithm specified in Secret 482 Derivation Algorithm. This parameter is immutable once the Common 483 Context is established. 485 This parameter is a CBOR array including the following two elements, 486 whose exact structure and value depend on the value of Secret 487 Derivation Algorithm: 489 o The first element is the array of COSE capabilities for Secret 490 Derivation Algorithm, as specified for that algorithm in the 491 "Capabilities" column of the "COSE Algorithms" Registry 492 [COSE.Algorithms] (see Section 8.1 of 493 [I-D.ietf-cose-rfc8152bis-algs]). 495 o The second element is the array of COSE capabilities for the COSE 496 key type associated to Secret Derivation Algorithm, as specified 497 for that key type in the "Capabilities" column of the "COSE Key 498 Types" Registry [COSE.Key.Types] (see Section 8.2 of 499 [I-D.ietf-cose-rfc8152bis-algs]). 501 Examples of Secret Derivation Parameters are in Appendix G. 503 This format is consistent with every elliptic curve Diffie-Hellman 504 algorithm currently considered in [I-D.ietf-cose-rfc8152bis-algs], 505 i.e. with algorithms that have only the COSE key type as their COSE 506 capability. Appendix H describes how Secret Derivation Parameters 507 can be generalized for possible future registered algorithms having a 508 different set of COSE capabilities. 510 2.2. Sender Context and Recipient Context 512 OSCORE specifies the derivation of Sender Context and Recipient 513 Context, specifically of Sender/Recipient Keys and Common IV, from a 514 set of input parameters (see Section 3.2 of [RFC8613]). This 515 derivation applies also to Group OSCORE, and the mandatory-to- 516 implement HKDF and AEAD algorithms are the same as in [RFC8613]. The 517 Sender ID SHALL be unique for each endpoint in a group with a fixed 518 Master Secret, Master Salt and Group Identifier (see Section 3.3 of 519 [RFC8613]). 521 For Group OSCORE, the Sender Context and Recipient Context 522 additionally contain asymmetric keys, as described previously in 523 Section 2. The private/public key pair of the sender can, for 524 example, be generated by the endpoint or provisioned during 525 manufacturing. 527 With the exception of the public key of the sender endpoint and the 528 possibly associated pairwise keys, a receiver endpoint can derive a 529 complete Security Context from a received Group OSCORE message and 530 the Common Context. The public keys in the Recipient Contexts can be 531 retrieved from the Group Manager (see Section 3) upon joining the 532 group. A public key can alternatively be acquired from the Group 533 Manager at a later time, for example the first time a message is 534 received from a particular endpoint in the group (see Section 8.2 and 535 Section 8.4). 537 For severely constrained devices, it may be not feasible to 538 simultaneously handle the ongoing processing of a recently received 539 message in parallel with the retrieval of the sender endpoint's 540 public key. Such devices can be configured to drop a received 541 message for which there is no (complete) Recipient Context, and 542 retrieve the sender endpoint's public key in order to have it 543 available to verify subsequent messages from that endpoint. 545 An endpoint admits a maximum amount of Recipient Contexts for a same 546 Security Context, e.g. due to memory limitations. After reaching 547 that limit, the creation of a new Recipient Context results in an 548 overflow. When this happens, the endpoint has to delete a current 549 Recipient Context to install the new one. It is up to the 550 application to define policies for selecting the current Recipient 551 Context to delete. A newly installed Recipient Context that has 552 required to delete another Recipient Context is initialized with an 553 invalid Replay Window, and accordingly requires the endpoint to take 554 appropriate actions (see Section 2.4.1.2). 556 2.3. Pairwise Keys 558 Certain signature schemes, such as EdDSA and ECDSA, support a secure 559 combined signature and encryption scheme. This section specifies the 560 derivation of "pairwise keys", for use in the pairwise mode defined 561 in Section 9. 563 2.3.1. Derivation of Pairwise Keys 565 Using the Group OSCORE Security Context (see Section 2), a group 566 member can derive AEAD keys to protect point-to-point communication 567 between itself and any other endpoint in the group. The same AEAD 568 algorithm as in the group mode is used. The key derivation of these 569 so-called pairwise keys follows the same construction as in 570 Section 3.2.1 of [RFC8613]: 572 Pairwise Sender Key = HKDF(Sender Key, Shared Secret, info, L) 573 Pairwise Recipient Key = HKDF(Recipient Key, Shared Secret, info, L) 574 where: 576 o The Pairwise Sender Key is the AEAD key for processing outgoing 577 messages addressed to endpoint X. 579 o The Pairwise Recipient Key is the AEAD key for processing incoming 580 messages from endpoint X. 582 o HKDF is the HKDF algorithm specified by Secret Derivation 583 Algorithm from the Common Context (see Section 2.1.4). 585 o The Sender Key and private key are from the Sender Context. The 586 Sender Key is used as salt in the HKDF, when deriving the Pairwise 587 Sender Key. 589 o The Recipient Key and the public key are from the Recipient 590 Context associated to endpoint X. The Recipient Key is used as 591 salt in the HKDF, when deriving the Pairwise Recipient Key. 593 o The Shared Secret is computed as a static-static Diffie-Hellman 594 shared secret [NIST-800-56A], where the endpoint uses its private 595 key and the public key of the other endpoint X. The Shared Secret 596 is used as Input Keying Material (IKM) in the HKDF. 598 o info and L are as defined in Section 3.2.1 of [RFC8613]. 600 If EdDSA asymmetric keys are used, the Edward coordinates are mapped 601 to Montgomery coordinates using the maps defined in Sections 4.1 and 602 4.2 of [RFC7748], before using the X25519 and X448 functions defined 603 in Section 5 of [RFC7748]. 605 After establishing a partially or completely new Security Context 606 (see Section 2.4 and Section 3.1), the old pairwise keys MUST be 607 deleted. Since new Sender/Recipient Keys are derived from the new 608 group keying material (see Section 2.2), every group member MUST use 609 the new Sender/Recipient Keys when deriving new pairwise keys. 611 As long as any two group members preserve the same asymmetric keys, 612 their Diffie-Hellman shared secret does not change across updates of 613 the group keying material. 615 2.3.2. Usage of Sequence Numbers 617 When using any of its Pairwise Sender Keys, a sender endpoint 618 including the 'Partial IV' parameter in the protected message MUST 619 use the current fresh value of the Sender Sequence Number from its 620 Sender Context (see Section 2.2). That is, the same Sender Sequence 621 Number space is used for all outgoing messages protected with Group 622 OSCORE, thus limiting both storage and complexity. 624 On the other hand, when combining group and pairwise communication 625 modes, this may result in the Partial IV values moving forward more 626 often. This can happen when a client engages in frequent or long 627 sequences of one-to-one exchanges with servers in the group, by 628 sending requests over unicast. 630 2.3.3. Security Context for Pairwise Mode 632 If the pairwise mode is supported, the Security Context additionally 633 includes Secret Derivation Algorithm, Secret Derivation Parameters 634 and the pairwise keys, as described at the beginning of Section 2. 636 The pairwise keys as well as the shared secrets used in their 637 derivation (see Section 2.3.1) may be stored in memory or recomputed 638 every time they are needed. The shared secret changes only when a 639 public/private key pair used for its derivation changes, which 640 results in the pairwise keys also changing. Additionally, the 641 pairwise keys change if the Sender ID changes or if a new Security 642 Context is established for the group (see Section 2.4.3). In order 643 to optimize protocol performance, an endpoint may store the derived 644 pairwise keys for easy retrieval. 646 In the pairwise mode, the Sender Context includes the Pairwise Sender 647 Keys to use with the other endpoints (see Figure 1). In order to 648 identify the right key to use, the Pairwise Sender Key for endpoint X 649 may be associated to the Recipient ID of endpoint X, as defined in 650 the Recipient Context (i.e. the Sender ID from the point of view of 651 endpoint X). In this way, the Recipient ID can be used to lookup for 652 the right Pairwise Sender Key. This association may be implemented in 653 different ways, e.g. by storing the pair (Recipient ID, Pairwise 654 Sender Key) or linking a Pairwise Sender Key to a Recipient Context. 656 2.4. Update of Security Context 658 It is RECOMMENDED that the immutable part of the Security Context is 659 stored in non-volatile memory, or that it can otherwise be reliably 660 accessed throughout the operation of the group, e.g. after a device 661 reboots. However, also immutable parts of the Security Context may 662 need to be updated, for example due to scheduled key renewal, new or 663 re-joining members in the group, or the fact that the endpoint 664 changes Sender ID (see Section 2.4.3). 666 On the other hand, the mutable parts of the Security Context are 667 updated by the endpoint when executing the security protocol, but may 668 nevertheless become outdated, e.g. due to loss of the mutable 669 Security Context (see Section 2.4.1) or exhaustion of Sender Sequence 670 Numbers (see Section 2.4.2). 672 If it is not feasible or practically possible to store and maintain 673 up-to-date the mutable part in non-volatile memory (e.g., due to 674 limited number of write operations), the endpoint MUST be able to 675 detect a loss of the mutable Security Context and MUST accordingly 676 take the actions defined in Section 2.4.1. 678 2.4.1. Loss of Mutable Security Context 680 An endpoint may lose its mutable Security Context, e.g. due to a 681 reboot (see Section 2.4.1.1) or to an overflow of Recipient Contexts 682 (see Section 2.4.1.2). 684 In such a case, the endpoint needs to prevent the re-use of a nonce 685 with the same AEAD key, and to handle incoming replayed messages. 687 2.4.1.1. Reboot and Total Loss 689 In case a loss of the Sender Context and/or of the Recipient Contexts 690 is detected (e.g. following a reboot), the endpoint MUST NOT protect 691 further messages using this Security Context to avoid reusing an AEAD 692 nonce with the same AEAD key. 694 In particular, before resuming its operations in the group, the 695 endpoint MUST retrieve new Security Context parameters from the Group 696 Manager (see Section 2.4.3) and use them to derive a new Sender 697 Context (see Section 2.2). Since this includes a newly derived 698 Sender Key, the server will not reuse the same pair (key, nonce), 699 even when using the Partial IV of (old re-injected) requests to build 700 the AEAD nonce for protecting the corresponding responses. 702 From then on, the endpoint MUST use the latest installed Sender 703 Context to protect outgoing messages. Also, newly created Recipient 704 Contexts will have a Replay Window which is initialized as valid. 706 If not able to establish an updated Sender Context, e.g. because of 707 lack of connectivity with the Group Manager, the endpoint MUST NOT 708 protect further messages using the current Security Context and MUST 709 NOT accept incoming messages from other group members, as currently 710 unable to detect possible replays. 712 2.4.1.2. Overflow of Recipient Contexts 714 After reaching the maximum amount of Recipient Contexts, an endpoint 715 will experience an overflow when installing a new Recipient Context, 716 as it requires to first delete an existing one (see Section 2.2). 718 Every time this happens, the Replay Window of the new Recipient 719 Context is initialized as not valid. Therefore, the endpoint MUST 720 take the following actions, before accepting request messages from 721 the client associated to the new Recipient Context. 723 If it is not configured as silent server, the endpoint MUST either: 725 o Retrieve new Security Context parameters from the Group Manager 726 and derive a new Sender Context, as defined in Section 2.4.1.1; or 728 o When receiving a first request to process with the new Recipient 729 Context, use the approach specified in Appendix E and based on the 730 Echo Option for CoAP [I-D.ietf-core-echo-request-tag], if 731 supported. In particular, the endpoint MUST use its Partial IV 732 when generating the AEAD nonce and MUST include the Partial IV in 733 the response message conveying the Echo Option. If the endpoint 734 supports the CoAP Echo Option, it is RECOMMENDED to take this 735 approach. 737 If it is configured exclusively as silent server, the endpoint MUST 738 wait for the next group rekeying to occur, in order to derive a new 739 Security Context and re-initialize the Replay Window of each 740 Recipient Contexts as valid. 742 2.4.2. Exhaustion of Sender Sequence Number 744 An endpoint can eventually exhaust the Sender Sequence Number, which 745 is incremented for each new outgoing message including a Partial IV. 746 This is the case for group requests, Observe notifications [RFC7641] 747 and, optionally, any other response. 749 Implementations MUST be able to detect an exhaustion of Sender 750 Sequence Number, after the endpoint has consumed the largest usable 751 value. If an implementation's integers support wrapping addition, 752 the implementation MUST treat Sender Sequence Number as exhausted 753 when a wrap-around is detected. 755 Upon exhausting the Sender Sequence Numbers, the endpoint MUST NOT 756 use this Security Context to protect further messages including a 757 Partial IV. 759 The endpoint SHOULD inform the Group Manager, retrieve new Security 760 Context parameters from the Group Manager (see Section 2.4.3), and 761 use them to derive a new Sender Context (see Section 2.2). 763 From then on, the endpoint MUST use its latest installed Sender 764 Context to protect outgoing messages. 766 2.4.3. Retrieving New Security Context Parameters 768 The Group Manager can assist an endpoint with an incomplete Sender 769 Context to retrieve missing data of the Security Context and thereby 770 become fully operational in the group again. The two main options 771 for the Group Manager are described in this section: i) assignment of 772 a new Sender ID to the endpoint (see Section 2.4.3.1); and ii) 773 establishment of a new Security Context for the group (see 774 Section 2.4.3.2). The update of the Replay Window in each of the 775 Recipient Contexts is discussed in Section 6.1. 777 As group membership changes, or as group members get new Sender IDs 778 (see Section 2.4.3.1) so do the relevant Recipient IDs that the other 779 endpoints need to keep track of. As a consequence, group members may 780 end up retaining stale Recipient Contexts, that are no longer useful 781 to verify incoming secure messages. 783 The Recipient ID ('kid') SHOULD NOT be considered as a persistent and 784 reliable indicator of a group member. Such an indication can be 785 achieved only by using that member's public key, when verifying 786 countersignatures of received messages (in group mode), or when 787 verifying messages integrity-protected with pairwise keying material 788 derived from asymmetric keys (in pairwise mode). 790 Furthermore, applications MAY define policies to: i) delete 791 (long-)unused Recipient Contexts and reduce the impact on storage 792 space; as well as ii) check with the Group Manager that a public key 793 is currently the one associated to a 'kid' value, after a number of 794 consecutive failed verifications. 796 2.4.3.1. New Sender ID for the Endpoint 798 The Group Manager may assign a new Sender ID to an endpoint, while 799 leaving the Gid, Master Secret and Master Salt unchanged in the 800 group. In this case, the Group Manager MUST assign a Sender ID that 801 has never been assigned before in the group under the current Gid 802 value. 804 Having retrieved the new Sender ID, and potentially other missing 805 data of the immutable Security Context, the endpoint can derive a new 806 Sender Context (see Section 2.2). When doing so, the endpoint resets 807 the Sender Sequence Number in its Sender Context to 0, and derives a 808 new Sender Key. This is in turn used to possibly derive new Pairwise 809 Sender Keys. 811 From then on, the endpoint MUST use its latest installed Sender 812 Context to protect outgoing messages. 814 The assignment of a new Sender ID may be the result of different 815 processes. The endpoint may request a new Sender ID, e.g. because of 816 exhaustion of Sender Sequence Numbers (see Section 2.4.2). An 817 endpoint may request to re-join the group, e.g. because of losing its 818 mutable Security Context (see Section 2.4.1), and is provided with a 819 new Sender ID together with the latest immutable Security Context. 821 For the other group members, the Recipient Context corresponding to 822 the old Sender ID becomes stale (see Section 3.1). 824 2.4.3.2. New Security Context for the Group 826 The Group Manager may establish a new Security Context for the group 827 (see Section 3.1). The Group Manager does not necessarily establish 828 a new Security Context for the group if one member has an outdated 829 Security Context (see Section 2.4.3.1), unless that was already 830 planned or required for other reasons. 832 All the group members need to acquire new Security Context parameters 833 from the Group Manager. Once having acquired new Security Context 834 parameters, each group member performs the following actions. 836 o From then on, it MUST NOT use the current Security Context to 837 start processing new messages for the considered group. 839 o It completes any ongoing message processing for the considered 840 group. 842 o It derives and install a new Security Context. In particular: 844 * It re-derives the keying material stored in its Sender Context 845 and Recipient Contexts (see Section 2.2). The Master Salt used 846 for the re-derivations is the updated Master Salt parameter if 847 provided by the Group Manager, or the empty byte string 848 otherwise. 850 * It resets to 0 its Sender Sequence Number in its Sender 851 Context. 853 * It re-initializes the Replay Window of each Recipient Context. 855 * It resets to 0 the sequence number of each ongoing observation 856 where it is an observer client and that it wants to keep 857 active. 859 From then on, it can resume processing new messages for the 860 considered group. In particular: 862 o It MUST use its latest installed Sender Context to protect 863 outgoing messages. 865 o It SHOULD use its latest installed Recipient Contexts to process 866 incoming messages, unless application policies admit to 867 temporarily retain and use the old, recent, Security Context (see 868 Section 10.4.1). 870 The distribution of a new Gid and Master Secret may result in 871 temporarily misaligned Security Contexts among group members. In 872 particular, this may result in a group member not being able to 873 process messages received right after a new Gid and Master Secret 874 have been distributed. A discussion on practical consequences and 875 possible ways to address them, as well as on how to handle the old 876 Security Context, is provided in Section 10.4. 878 3. The Group Manager 880 As with OSCORE, endpoints communicating with Group OSCORE need to 881 establish the relevant Security Context. Group OSCORE endpoints need 882 to acquire OSCORE input parameters, information about the group(s) 883 and about other endpoints in the group(s). This specification is 884 based on the existence of an entity called Group Manager which is 885 responsible for the group, but does not mandate how the Group Manager 886 interacts with the group members. The responsibilities of the Group 887 Manager are compiled in Section 3.2. 889 It is RECOMMENDED to use a Group Manager as described in 890 [I-D.ietf-ace-key-groupcomm-oscore], where the join process is based 891 on the ACE framework for authentication and authorization in 892 constrained environments [I-D.ietf-ace-oauth-authz]. 894 The Group Manager assigns unique Group Identifiers (Gids) to 895 different groups under its control, as well as unique Sender IDs (and 896 thereby Recipient IDs) to the members of those groups. According to 897 a hierarchical approach, the Gid value assigned to a group is 898 associated to a dedicated space for the values of Sender ID and 899 Recipient ID of the members of that group. 901 The Group Manager MUST NOT reassign a Gid value to the same group, 902 and MUST NOT reassign a Sender ID within the same group under the 903 same Gid value. 905 In addition, the Group Manager maintains records of the public keys 906 of endpoints in a group, and provides information about the group and 907 its members to other group members and selected roles. Upon nodes' 908 joining, the Group Manager collects such public keys and MUST verify 909 proof-of-possession of the respective private key. 911 An endpoint acquires group data such as the Gid and OSCORE input 912 parameters including its own Sender ID from the Group Manager, and 913 provides information about its public key to the Group Manager, for 914 example upon joining the group. 916 A group member can retrieve from the Group Manager the public key and 917 other information associated to another member of the group, with 918 which it can generate the corresponding Recipient Context. In 919 particular, the requested public key is provided together with the 920 Sender ID of the associated group member. An application can 921 configure a group member to asynchronously retrieve information about 922 Recipient Contexts, e.g. by Observing [RFC7641] a resource at the 923 Group Manager to get updates on the group membership. 925 The Group Manager MAY serve additional entities acting as signature 926 checkers, e.g. intermediary gateways. These entities do not join a 927 group as members, but can retrieve public keys of group members from 928 the Group Manager, in order to verify counter signatures of group 929 messages. A signature checker MUST be authorized for retrieving 930 public keys of members in a specific group from the Group Manager. 931 To this end, the same method mentioned above based on the ACE 932 framework [I-D.ietf-ace-oauth-authz] can be used. 934 3.1. Management of Group Keying Material 936 In order to establish a new Security Context for a group, a new Group 937 Identifier (Gid) for that group and a new value for the Master Secret 938 parameter MUST be generated. When distributing the new Gid and 939 Master Secret, the Group Manager MAY distribute also a new value for 940 the Master Salt parameter, and should preserve the current value of 941 the Sender ID of each group member. 943 The Group Manager MUST NOT reassign a Gid value to the same group. 944 That is, every group can have a given Gid at most once during its 945 lifetime. An example of Gid format supporting this operation is 946 provided in Appendix C. 948 The Group Manager MUST NOT reassign a previously used Sender ID 949 ('kid') with the same Gid, Master Secret and Master Salt. That is, 950 the Group Manager MUST NOT reassign a Sender ID value within a same 951 group under the same Gid value (see Section 2.4.3.1). Within this 952 restriction, the Group Manager can assign a Sender ID used under an 953 old Gid value, thus avoiding Sender ID values to irrecoverably grow 954 in size. 956 Even when an endpoint joining a group is recognized as a current 957 member of that group, e.g. through the ongoing secure communication 958 association, the Group Manager MUST assign a new Sender ID different 959 than the one currently used by the endpoint in the group, unless the 960 group is rekeyed first and a new Gid value is established. 962 Figure 2 overviews the different keying material components, 963 considering their relation and possible reuse across group rekeying. 965 Components changed in lockstep * Changing a kid does not 966 upon a group rekeying need changing the Group ID 967 +----------------------------+ 968 | | * A kid is not reassigned 969 | Master Group |<--> kid1 under the same Group ID 970 | Secret <---> o <---> ID | 971 | ^ |<--> kid2 * Upon changing the Group ID, 972 | | | every current kid should 973 | | |<--> kid3 be preserved for efficient 974 | v | key rollover 975 | Master Salt | ... ... 976 | (optional) | * After changing Group ID, an 977 | | unused kid can be assigned 978 +----------------------------+ 980 Figure 2: Relations among keying material components. 982 If required by the application (see Appendix A.1), it is RECOMMENDED 983 to adopt a group key management scheme, and securely distribute a new 984 value for the Gid and for the Master Secret parameter of the group's 985 Security Context, before a new joining endpoint is added to the group 986 or after a currently present endpoint leaves the group. This is 987 necessary to preserve backward security and forward security in the 988 group, if the application requires it. 990 The specific approach used to distribute new group data is out of the 991 scope of this document. However, it is RECOMMENDED that the Group 992 Manager supports the distribution of the new Gid and Master Secret 993 parameter to the group according to the Group Rekeying Process 994 described in [I-D.ietf-ace-key-groupcomm-oscore]. 996 3.2. Responsibilities of the Group Manager 998 The Group Manager is responsible for performing the following tasks: 1000 1. Creating and managing OSCORE groups. This includes the 1001 assignment of a Gid to every newly created group, as well as 1002 ensuring uniqueness of Gids within the set of its OSCORE groups. 1004 2. Defining policies for authorizing the joining of its OSCORE 1005 groups. 1007 3. Handling the join process to add new endpoints as group members. 1009 4. Establishing the Common Context part of the Security Context, 1010 and providing it to authorized group members during the join 1011 process, together with the corresponding Sender Context. 1013 5. Updating the Gid of its OSCORE groups, upon renewing the 1014 respective Security Context. This includes ensuring that the 1015 same Gid value is not reassigned to the same group. 1017 6. Generating and managing Sender IDs within its OSCORE groups, as 1018 well as assigning and providing them to new endpoints during the 1019 join process, or to current group members upon request of 1020 renewal or re-joining. 1022 This includes ensuring that each Sender ID: is unique within 1023 each of the OSCORE groups; and is not reassigned within the same 1024 group under the same Gid value, i.e. not even to a current group 1025 member re-joining the same group without a rekeying happening 1026 first. 1028 7. Defining communication policies for each of its OSCORE groups, 1029 and signaling them to new endpoints during the join process. 1031 8. Renewing the Security Context of an OSCORE group upon membership 1032 change, by revoking and renewing common security parameters and 1033 keying material (rekeying). 1035 9. Providing the management keying material that a new endpoint 1036 requires to participate in the rekeying process, consistently 1037 with the key management scheme used in the group joined by the 1038 new endpoint. 1040 10. Acting as key repository, in order to handle the public keys of 1041 the members of its OSCORE groups, and providing such public keys 1042 to other members of the same group upon request. The actual 1043 storage of public keys may be entrusted to a separate secure 1044 storage device or service. 1046 11. Validating that the format and parameters of public keys of 1047 group members are consistent with the countersignature algorithm 1048 and related parameters used in the respective OSCORE group. 1050 The Group Manager described in [I-D.ietf-ace-key-groupcomm-oscore] 1051 provides these functionalities. 1053 4. The COSE Object 1055 Building on Section 5 of [RFC8613], this section defines how to use 1056 COSE [I-D.ietf-cose-rfc8152bis-struct] to wrap and protect data in 1057 the original message. OSCORE uses the untagged COSE_Encrypt0 1058 structure with an Authenticated Encryption with Associated Data 1059 (AEAD) algorithm. Unless otherwise specified, the following 1060 modifications apply for both the group mode and the pairwise mode of 1061 Group OSCORE. 1063 4.1. Counter Signature 1065 When protecting a message in group mode, the 'unprotected' field MUST 1066 additionally include the following parameter: 1068 o COSE_CounterSignature0: its value is set to the counter signature 1069 of the COSE object, computed by the sender as described in 1070 Sections 3.2 and 3.3 of [I-D.ietf-cose-countersign], by using its 1071 private key and according to the Counter Signature Algorithm and 1072 Counter Signature Parameters in the Security Context. 1074 In particular, the Countersign_structure contains the context text 1075 string "CounterSignature0", the external_aad as defined in 1076 Section 4.3 of this specification, and the ciphertext of the COSE 1077 object as payload. 1079 4.2. The 'kid' and 'kid context' parameters 1081 The value of the 'kid' parameter in the 'unprotected' field of 1082 response messages MUST be set to the Sender ID of the endpoint 1083 transmitting the message, if the request was protected in group mode. 1084 That is, unlike in [RFC8613], the 'kid' parameter is always present 1085 in responses to a request that was protected in group mode. 1087 The value of the 'kid context' parameter in the 'unprotected' field 1088 of requests messages MUST be set to the ID Context, i.e. the Group 1089 Identifier value (Gid) of the group. That is, unlike in [RFC8613], 1090 the 'kid context' parameter is always present in requests. 1092 4.3. external_aad 1094 The external_aad of the Additional Authenticated Data (AAD) is 1095 different compared to OSCORE, and is defined in this section. 1097 The same external_aad structure is used in group mode and pairwise 1098 mode for encryption (see Section 5.3 of 1099 [I-D.ietf-cose-rfc8152bis-struct]), as well as in group mode for 1100 signing (see Section 4.4 of [I-D.ietf-cose-rfc8152bis-struct]). 1102 In particular, the external_aad includes also the counter signature 1103 algorithm and related signature parameters, the value of the 'kid 1104 context' in the COSE object of the request, and the OSCORE option of 1105 the protected message. 1107 external_aad = bstr .cbor aad_array 1109 aad_array = [ 1110 oscore_version : uint, 1111 algorithms : [alg_aead : int / tstr, 1112 alg_countersign : int / tstr, 1113 par_countersign : [countersign_alg_capab, 1114 countersign_key_type_capab]], 1115 request_kid : bstr, 1116 request_piv : bstr, 1117 options : bstr, 1118 request_kid_context : bstr, 1119 OSCORE_option: bstr 1120 ] 1122 Figure 3: external_aad 1124 Compared with Section 5.4 of [RFC8613], the aad_array has the 1125 following differences. 1127 o The 'algorithms' array additionally includes: 1129 * 'alg_countersign', which specifies Counter Signature Algorithm 1130 from the Common Context (see Section 2.1.2). This parameter 1131 MUST encode the value of Counter Signature Algorithm as a CBOR 1132 integer or text string, consistently with the "Value" field in 1133 the "COSE Algorithms" Registry for this counter signature 1134 algorithm. 1136 * 'par_countersign', which specifies the CBOR array Counter 1137 Signature Parameters from the Common Context (see 1138 Section 2.1.3). In particular: 1140 + 'countersign_alg_capab' is the array of COSE capabilities 1141 for the countersignature algorithm indicated in 1142 'alg_countersign'. This is the first element of the CBOR 1143 array Counter Signature Parameters from the Common Context. 1145 + 'countersign_key_type_capab' is the array of COSE 1146 capabilities for the COSE key type used by the 1147 countersignature algorithm indicated in 'alg_countersign'. 1148 This is the second element of the CBOR array Counter 1149 Signature Parameters from the Common Context. 1151 This format is consistent with every counter signature 1152 algorithm currently considered in 1153 [I-D.ietf-cose-rfc8152bis-algs], i.e. with algorithms that have 1154 only the COSE key type as their COSE capability. Appendix H 1155 describes how 'par_countersign' can be generalized for possible 1156 future registered algorithms having a different set of COSE 1157 capabilities. 1159 o The new element 'request_kid_context' contains the value of the 1160 'kid context' in the COSE object of the request (see Section 4.2). 1162 In case Observe [RFC7641] is used, this enables endpoints to 1163 safely keep an observation active beyond a possible change of Gid, 1164 i.e. of ID Context, following a group rekeying (see Section 3.1). 1165 In fact, it ensures that every notification cryptographically 1166 matches with only one observation request, rather than with 1167 multiple ones that were protected with different keying material 1168 but share the same 'request_kid' and 'request_piv' values. 1170 o The new element 'OSCORE_option', containing the value of the 1171 OSCORE Option present in the protected message, encoded as a 1172 binary string. This prevents the attack described in Section 10.6 1173 when using the group mode, as further explained in Section 10.6.2. 1175 Note for implementation: this construction requires the OSCORE 1176 option of the message to be generated and finalized before 1177 computing the ciphertext of the COSE_Encrypt0 object (when using 1178 the group mode or the pairwise mode) and before calculating the 1179 counter signature (when using the group mode). Also, the 1180 aad_array needs to be large enough to contain the largest possible 1181 OSCORE option. 1183 5. OSCORE Header Compression 1185 The OSCORE header compression defined in Section 6 of [RFC8613] is 1186 used, with the following differences. 1188 o The payload of the OSCORE message SHALL encode the ciphertext of 1189 the COSE_Encrypt0 object. In the group mode, the ciphertext above 1190 is concatenated with the value of the COSE_CounterSignature0 of 1191 the COSE object, computed as described in Section 4.1. 1193 o This specification defines the usage of the sixth least 1194 significant bit, called "Group Flag", in the first byte of the 1195 OSCORE option containing the OSCORE flag bits. This flag bit is 1196 specified in Section 11.1. 1198 o The Group Flag MUST be set to 1 if the OSCORE message is protected 1199 using the group mode (see Section 8). 1201 o The Group Flag MUST be set to 0 if the OSCORE message is protected 1202 using the pairwise mode (see Section 9). The Group Flag MUST also 1203 be set to 0 for ordinary OSCORE messages processed according to 1204 [RFC8613]. 1206 5.1. Examples of Compressed COSE Objects 1208 This section covers a list of OSCORE Header Compression examples of 1209 Group OSCORE used in group mode (see Section 5.1.1) or in pairwise 1210 mode (see Section 5.1.2). 1212 The examples assume that the COSE_Encrypt0 object is set (which means 1213 the CoAP message and cryptographic material is known). Note that the 1214 examples do not include the full CoAP unprotected message or the full 1215 Security Context, but only the input necessary to the compression 1216 mechanism, i.e. the COSE_Encrypt0 object. The output is the 1217 compressed COSE object as defined in Section 5 and divided into two 1218 parts, since the object is transported in two CoAP fields: OSCORE 1219 option and payload. 1221 The examples assume that the plaintext (see Section 5.3 of [RFC8613]) 1222 is 6 bytes long, and that the AEAD tag is 8 bytes long, hence 1223 resulting in a ciphertext which is 14 bytes long. When using the 1224 group mode, the COSE_CounterSignature0 byte string as described in 1225 Section 4 is assumed to be 64 bytes long. 1227 5.1.1. Examples in Group Mode 1229 o Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 1230 0x25, Partial IV = 5 and kid context = 0x44616c. 1232 * Before compression (96 bytes): 1234 [ 1235 h'', 1236 { 4:h'25', 6:h'05', 10:h'44616c', 11:h'de9e ... f1' }, 1237 h'aea0155667924dff8a24e4cb35b9' 1238 ] 1240 * After compression (85 bytes): 1242 Flag byte: 0b00111001 = 0x39 (1 byte) 1244 Option Value: 0x39 05 03 44 61 6c 25 (7 bytes) 1246 Payload: 0xaea0155667924dff8a24e4cb35b9 de9e ... f1 1247 (14 bytes + size of the counter signature) 1249 o Response with ciphertext = 0x60b035059d9ef5667c5a0710823b, kid = 1250 0x52 and no Partial IV. 1252 * Before compression (88 bytes): 1254 [ 1255 h'', 1256 { 4:h'52', 11:h'ca1e ... b3' }, 1257 h'60b035059d9ef5667c5a0710823b' 1258 ] 1260 * After compression (80 bytes): 1262 Flag byte: 0b00101000 = 0x28 (1 byte) 1264 Option Value: 0x28 52 (2 bytes) 1266 Payload: 0x60b035059d9ef5667c5a0710823b ca1e ... b3 1267 (14 bytes + size of the counter signature) 1269 5.1.2. Examples in Pairwise Mode 1271 o Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 1272 0x25, Partial IV = 5 and kid context = 0x44616c. 1274 * Before compression (29 bytes): 1276 [ 1277 h'', 1278 { 4:h'25', 6:h'05', 10:h'44616c' }, 1279 h'aea0155667924dff8a24e4cb35b9' 1280 ] 1282 * After compression (21 bytes): 1284 Flag byte: 0b00011001 = 0x19 (1 byte) 1286 Option Value: 0x19 05 03 44 61 6c 25 (7 bytes) 1288 Payload: 0xaea0155667924dff8a24e4cb35b9 (14 bytes) 1290 o Response with ciphertext = 0x60b035059d9ef5667c5a0710823b and no 1291 Partial IV. 1293 * Before compression (18 bytes): 1295 [ 1296 h'', 1297 {}, 1298 h'60b035059d9ef5667c5a0710823b' 1299 ] 1301 * After compression (14 bytes): 1303 Flag byte: 0b00000000 = 0x00 (1 byte) 1305 Option Value: 0x (0 bytes) 1307 Payload: 0x60b035059d9ef5667c5a0710823b (14 bytes) 1309 6. Message Binding, Sequence Numbers, Freshness and Replay Protection 1311 The requirements and properties described in Section 7 of [RFC8613] 1312 also apply to Group OSCORE. In particular, Group OSCORE provides 1313 message binding of responses to requests, which enables absolute 1314 freshness of responses that are not notifications, relative freshness 1315 of requests and notification responses, and replay protection of 1316 requests. In addition, the following holds for Group OSCORE. 1318 6.1. Update of Replay Window 1320 Sender Sequence Numbers seen by a server as Partial IV values in 1321 request messages can spontaneously increase at a fast pace, for 1322 example when a client exchanges unicast messages with other servers 1323 using the Group OSCORE Security Context. As in OSCORE [RFC8613], a 1324 server always needs to accept such increases and accordingly updates 1325 the Replay Window in each of its Recipient Contexts. 1327 As discussed in Section 2.4.1, a newly created Recipient Context 1328 would have an invalid Replay Window, if its installation has required 1329 to delete another Recipient Context. Hence, the server is not able 1330 to verify if a request from the client associated to the new 1331 Recipient Context is a replay. When this happens, the server MUST 1332 validate the Replay Window of the new Recipient Context, before 1333 accepting messages from the associated client (see Section 2.4.1). 1335 Furthermore, when the Group Manager establishes a new Security 1336 Context for the group (see Section 2.4.3.2), every server re- 1337 initializes the Replay Window in each of its Recipient Contexts. 1339 6.2. Message Freshness 1341 When receiving a request from a client for the first time, the server 1342 is not synchronized with the client's Sender Sequence Number, i.e. it 1343 is not able to verify if that request is fresh. This applies to a 1344 server that has just joined the group, with respect to already 1345 present clients, and recurs as new clients are added as group 1346 members. 1348 During its operations in the group, the server may also lose 1349 synchronization with a client's Sender Sequence Number. This can 1350 happen, for instance, if the server has rebooted or has deleted its 1351 previously synchronized version of the Recipient Context for that 1352 client (see Section 2.4.1). 1354 If the application requires message freshness, e.g. according to 1355 time- or event-based policies, the server has to (re-)synchronize 1356 with a client's Sender Sequence Number before delivering request 1357 messages from that client to the application. To this end, the 1358 server can use the approach in Appendix E based on the Echo Option 1359 for CoAP [I-D.ietf-core-echo-request-tag], as a variant of the 1360 approach defined in Appendix B.1.2 of [RFC8613] applicable to Group 1361 OSCORE. 1363 7. Message Reception 1365 Upon receiving a protected message, a recipient endpoint retrieves a 1366 Security Context as in [RFC8613]. An endpoint MUST be able to 1367 distinguish between a Security Context to process OSCORE messages as 1368 in [RFC8613] and a Group OSCORE Security Context to process Group 1369 OSCORE messages as defined in this specification. 1371 To this end, an endpoint can take into account the different 1372 structure of the Security Context defined in Section 2, for example 1373 based on the presence of Counter Signature Algorithm in the Common 1374 Context. Alternatively implementations can use an additional 1375 parameter in the Security Context, to explicitly signal that it is 1376 intended for processing Group OSCORE messages. 1378 If either of the following two conditions holds, a recipient endpoint 1379 MUST discard the incoming protected message: 1381 o The Group Flag is set to 0, and the recipient endpoint retrieves a 1382 Security Context which is both valid to process the message and 1383 also associated to an OSCORE group, but the endpoint does not 1384 support the pairwise mode. 1386 o The Group Flag is set to 1, and the recipient endpoint can not 1387 retrieve a Security Context which is both valid to process the 1388 message and also associated to an OSCORE group. 1390 As per Section 6.1 of [RFC8613], this holds also when retrieving a 1391 Security Context which is valid but not associated to an OSCORE 1392 group. Future specifications may define how to process incoming 1393 messages protected with a Security Contexts as in [RFC8613], when 1394 the Group Flag bit is set to 1. 1396 Otherwise, if a Security Context associated to an OSCORE group and 1397 valid to process the message is retrieved, the recipient endpoint 1398 processes the message with Group OSCORE, using the group mode (see 1399 Section 8) if the Group Flag is set to 1, or the pairwise mode (see 1400 Section 9) if the Group Flag is set to 0. 1402 Note that, if the Group Flag is set to 0, and the recipient endpoint 1403 retrieves a Security Context which is valid to process the message 1404 but is not associated to an OSCORE group, then the message is 1405 processed according to [RFC8613]. 1407 8. Message Processing in Group Mode 1409 When using the group mode, messages are protected and processed as 1410 specified in [RFC8613], with the modifications described in this 1411 section. The security objectives of the group mode are discussed in 1412 Appendix A.2. The group mode MUST be supported. 1414 During all the steps of the message processing, an endpoint MUST use 1415 the same Security Context for the considered group. That is, an 1416 endpoint MUST NOT install a new Security Context for that group (see 1417 Section 2.4.3.2) until the message processing is completed. 1419 The group mode MUST be used to protect group requests intended for 1420 multiple recipients or for the whole group. This includes both 1421 requests directly addressed to multiple recipients, e.g. sent by the 1422 client over multicast, as well as requests sent by the client over 1423 unicast to a proxy, that forwards them to the intended recipients 1424 over multicast [I-D.ietf-core-groupcomm-bis]. 1426 As per [RFC7252][I-D.ietf-core-groupcomm-bis], group requests sent 1427 over multicast MUST be Non-Confirmable, and thus are not 1428 retransmitted by the CoAP messaging layer. Instead, applications 1429 should store such outgoing messages for a predefined, sufficient 1430 amount of time, in order to correctly perform possible 1431 retransmissions at the application layer. According to Section 5.2.3 1432 of [RFC7252], responses to Non-Confirmable group requests SHOULD also 1433 be Non-Confirmable, but endpoints MUST be prepared to receive 1434 Confirmable responses in reply to a Non-Confirmable group request. 1435 Confirmable group requests are acknowledged in non-multicast 1436 environments, as specified in [RFC7252]. 1438 Furthermore, endpoints in the group locally perform error handling 1439 and processing of invalid messages according to the same principles 1440 adopted in [RFC8613]. However, a recipient MUST stop processing and 1441 silently reject any message which is malformed and does not follow 1442 the format specified in Section 4 of this specification, or which is 1443 not cryptographically validated in a successful way. In either case, 1444 it is RECOMMENDED that the recipient does not send back any error 1445 message. This prevents servers from replying with multiple error 1446 messages to a client sending a group request, so avoiding the risk of 1447 flooding and possibly congesting the network. 1449 8.1. Protecting the Request 1451 A client transmits a secure group request as described in Section 8.1 1452 of [RFC8613], with the following modifications. 1454 o In step 2, the Additional Authenticated Data is modified as 1455 described in Section 4 of this document. 1457 o In step 4, the encryption of the COSE object is modified as 1458 described in Section 4 of this document. The encoding of the 1459 compressed COSE object is modified as described in Section 5 of 1460 this document. In particular, the Group Flag MUST be set to 1. 1462 o In step 5, the counter signature is computed and the format of the 1463 OSCORE message is modified as described in Section 4 and Section 5 1464 of this document. In particular, the payload of the OSCORE 1465 message includes also the counter signature. 1467 8.1.1. Supporting Observe 1469 If Observe [RFC7641] is supported, the following holds for each newly 1470 started observation. 1472 o If the client intends to keep the observation active beyond a 1473 possible change of Sender ID, the client MUST store the value of 1474 the 'kid' parameter from the original Observe request, and retain 1475 it for the whole duration of the observation. Even in case the 1476 client is individually rekeyed and receives a new Sender ID from 1477 the Group Manager (see Section 2.4.3.1), the client MUST NOT 1478 update the stored value associated to a particular Observe 1479 request. 1481 o If the client intends to keep the observation active beyond a 1482 possible change of ID Context following a group rekeying (see 1483 Section 3.1), then the following applies. 1485 * The client MUST store the value of the 'kid context' parameter 1486 from the original Observe request, and retain it for the whole 1487 duration of the observation. Upon establishing a new Security 1488 Context with a new Gid as ID Context (see Section 2.4.3.2), the 1489 client MUST NOT update the stored value associated to a 1490 particular Observe request. 1492 * The client MUST store an invariant identifier of the group, 1493 which is immutable even in case the Security Context of the 1494 group is re-established. For example, this invariant 1495 identifier can be the "group name" in 1496 [I-D.ietf-ace-key-groupcomm-oscore], where it is used for 1497 joining the group and retrieving the current group keying 1498 material from the Group Manager. 1500 After a group rekeying, such an invariant information makes it 1501 simpler for the observer client to retrieve the current group 1502 keying material from the Group Manager, in case the client has 1503 missed both the rekeying messages and the first observe 1504 notification protected with the new Security Context (see 1505 Section 8.3.1). 1507 8.2. Verifying the Request 1509 Upon receiving a secure group request with the Group Flag set to 1, 1510 following the procedure in Section 7, a server proceeds as described 1511 in Section 8.2 of [RFC8613], with the following modifications. 1513 o In step 2, the decoding of the compressed COSE object follows 1514 Section 5 of this document. In particular: 1516 * If the server discards the request due to not retrieving a 1517 Security Context associated to the OSCORE group, the server MAY 1518 respond with a 4.01 (Unauthorized) error message. When doing 1519 so, the server MAY set an Outer Max-Age option with value zero, 1520 and MAY include a descriptive string as diagnostic payload. 1522 * If the received 'kid context' matches an existing ID Context 1523 (Gid) but the received 'kid' does not match any Recipient ID in 1524 this Security Context, then the server MAY create a new 1525 Recipient Context for this Recipient ID and initialize it 1526 according to Section 3 of [RFC8613], and also retrieve the 1527 associated public key. Such a configuration is application 1528 specific. If the application does not specify dynamic 1529 derivation of new Recipient Contexts, then the server SHALL 1530 stop processing the request. 1532 o In step 4, the Additional Authenticated Data is modified as 1533 described in Section 4 of this document. 1535 o In step 6, the server also verifies the counter signature using 1536 the public key of the client from the associated Recipient 1537 Context. In particular: 1539 * If the server does not have the public key of the client yet, 1540 the server MUST stop processing the request and MAY respond 1541 with a 5.03 (Service Unavailable) response. The response MAY 1542 include a Max-Age Option, indicating to the client the number 1543 of seconds after which to retry. If the Max-Age Option is not 1544 present, a retry time of 60 seconds will be assumed by the 1545 client, as default value defined in Section 5.10.5 of 1546 [RFC7252]. 1548 * If the signature verification fails, the server SHALL stop 1549 processing the request and MAY respond with a 4.00 (Bad 1550 Request) response. The server MAY set an Outer Max-Age option 1551 with value zero. The diagnostic payload MAY contain a string, 1552 which, if present, MUST be "Decryption failed" as if the 1553 decryption had failed. Furthermore, the Replay Window MUST be 1554 updated only if both the signature verification and the 1555 decryption succeed. 1557 o Additionally, if the used Recipient Context was created upon 1558 receiving this group request and the message is not verified 1559 successfully, the server MAY delete that Recipient Context. Such 1560 a configuration, which is specified by the application, mitigates 1561 attacks that aim at overloading the server's storage. 1563 A server SHOULD NOT process a request if the received Recipient ID 1564 ('kid') is equal to its own Sender ID in its own Sender Context. For 1565 an example where this is not fulfilled, see Section 7.2.1 in 1566 [I-D.tiloca-core-observe-multicast-notifications]. 1568 8.2.1. Supporting Observe 1570 If Observe [RFC7641] is supported, the following holds for each newly 1571 started observation. 1573 o The server MUST store the value of the 'kid' parameter from the 1574 original Observe request, and retain it for the whole duration of 1575 the observation. The server MUST NOT update the stored value of a 1576 'kid' parameter associated to a particular Observe request, even 1577 in case the observer client is individually rekeyed and starts 1578 using a new Sender ID received from the Group Manager (see 1579 Section 2.4.3.1). 1581 o The server MUST store the value of the 'kid context' parameter 1582 from the original Observe request, and retain it for the whole 1583 duration of the observation, beyond a possible change of ID 1584 Context following a group rekeying (see Section 3.1). That is, 1585 upon establishing a new Security Context with a new Gid as ID 1586 Context (see Section 2.4.3.2), the server MUST NOT update the 1587 stored value associated to the ongoing observation. 1589 8.3. Protecting the Response 1591 If a server generates a CoAP message in response to a Group OSCORE 1592 request, then the server SHALL follow the description in Section 8.3 1593 of [RFC8613], with the modifications described in this section. 1595 Note that the server always protects a response with the Sender 1596 Context from its latest Security Context, and that establishing a new 1597 Security Context resets the Sender Sequence Number to 0 (see 1598 Section 3.1). 1600 o In step 2, the Additional Authenticated Data is modified as 1601 described in Section 4 of this document. 1603 o In step 3, if the server is using a different Security Context for 1604 the response compared to what was used to verify the request (see 1605 Section 3.1), then the server MUST include its Sender Sequence 1606 Number as Partial IV in the response and use it to build the AEAD 1607 nonce to protect the response. This prevents the AEAD nonce from 1608 the request from being reused. 1610 o In step 4, the encryption of the COSE object is modified as 1611 described in Section 4 of this document. The encoding of the 1612 compressed COSE object is modified as described in Section 5 of 1613 this document. In particular, the Group Flag MUST be set to 1. 1614 If the server is using a different ID Context (Gid) for the 1615 response compared to what was used to verify the request (see 1616 Section 3.1), then the new ID Context MUST be included in the 'kid 1617 context' parameter of the response. 1619 o In step 5, the counter signature is computed and the format of the 1620 OSCORE message is modified as described in Section 5 of this 1621 document. In particular, the payload of the OSCORE message 1622 includes also the counter signature. 1624 8.3.1. Supporting Observe 1626 If Observe [RFC7641] is supported, the following holds when 1627 protecting notifications for an ongoing observation. 1629 o The server MUST use the stored value of the 'kid' parameter from 1630 the original Observe request (see Section 8.2.1), as value for the 1631 'request_kid' parameter in the external_aad structure (see 1632 Section 4.3). 1634 o The server MUST use the stored value of the 'kid context' 1635 parameter from the original Observe request (see Section 8.2.1), 1636 as value for the 'request_kid_context' parameter in the 1637 external_aad structure (see Section 4.3). 1639 Furthermore, the server may have ongoing observations started by 1640 Observe requests protected with an old Security Context. After 1641 completing the establishment of a new Security Context, the server 1642 MUST protect the following notifications with the Sender Context of 1643 the new Security Context. 1645 For each ongoing observation, the server can help the client to 1646 synchronize, by including also the 'kid context' parameter in 1647 notifications following a group rekeying, with value set to the ID 1648 Context (Gid) of the new Security Context. 1650 If there is a known upper limit to the duration of a group rekeying, 1651 the server SHOULD include the 'kid context' parameter during that 1652 time. Otherwise, the server SHOULD include it until the Max-Age has 1653 expired for the last notification sent before the installation of the 1654 new Security Context. 1656 8.4. Verifying the Response 1658 Upon receiving a secure response message with the Group Flag set to 1659 1, following the procedure in Section 7, the client proceeds as 1660 described in Section 8.4 of [RFC8613], with the following 1661 modifications. 1663 Note that a client may receive a response protected with a Security 1664 Context different from the one used to protect the corresponding 1665 group request, and that, upon the establishment of a new Security 1666 Context, the client re-initializes its Replay Windows in its 1667 Recipient Contexts (see Section 3.1). 1669 o In step 2, the decoding of the compressed COSE object is modified 1670 as described in Section 5 of this document. In particular, a 1671 'kid' may not be present, if the response is a reply to a request 1672 protected in pairwise mode. In such a case, the client assumes 1673 the response 'kid' to be exactly the one of the server to which 1674 the request protected in pairwise mode was intended for. 1676 If the response 'kid context' matches an existing ID Context (Gid) 1677 but the received/assumed 'kid' does not match any Recipient ID in 1678 this Security Context, then the client MAY create a new Recipient 1679 Context for this Recipient ID and initialize it according to 1680 Section 3 of [RFC8613], and also retrieve the associated public 1681 key. If the application does not specify dynamic derivation of 1682 new Recipient Contexts, then the client SHALL stop processing the 1683 response. 1685 o In step 3, the Additional Authenticated Data is modified as 1686 described in Section 4 of this document. 1688 o In step 5, the client also verifies the counter signature using 1689 the public key of the server from the associated Recipient 1690 Context. If the verification fails, the same steps are taken as 1691 if the decryption had failed. 1693 o Additionally, if the used Recipient Context was created upon 1694 receiving this response and the message is not verified 1695 successfully, the client MAY delete that Recipient Context. Such 1696 a configuration, which is specified by the application, mitigates 1697 attacks that aim at overloading the client's storage. 1699 8.4.1. Supporting Observe 1701 If Observe [RFC7641] is supported, the following holds when verifying 1702 notifications for an ongoing observation. 1704 o The client MUST use the stored value of the 'kid' parameter from 1705 the original Observe request (see Section 8.1.1), as value for the 1706 'request_kid' parameter in the external_aad structure (see 1707 Section 4.3). 1709 o The client MUST use the stored value of the 'kid context' 1710 parameter from the original Observe request (see Section 8.1.1), 1711 as value for the 'request_kid_context' parameter in the 1712 external_aad structure (see Section 4.3). 1714 This ensures that the client can correctly verify notifications, even 1715 in case it is individually rekeyed and starts using a new Sender ID 1716 received from the Group Manager (see Section 2.4.3.1), as well as 1717 when it installs a new Security Context with a new ID Context (Gid) 1718 following a group rekeying (see Section 3.1). 1720 9. Message Processing in Pairwise Mode 1722 When using the pairwise mode of Group OSCORE, messages are protected 1723 and processed as in [RFC8613], with the modifications described in 1724 this section. The security objectives of the pairwise mode are 1725 discussed in Appendix A.2. 1727 The pairwise mode takes advantage of an existing Security Context for 1728 the group mode to establish a Security Context shared exclusively 1729 with any other member. In order to use the pairwise mode, the 1730 signature scheme of the group mode MUST support a combined signature 1731 and encryption scheme. This can be, for example, signature using 1732 ECDSA, and encryption using AES-CCM with a key derived with ECDH. 1734 The pairwise mode does not support the use of additional entities 1735 acting as verifiers of source authentication and integrity of group 1736 messages, such as intermediary gateways (see Section 3). 1738 The pairwise mode MAY be supported. An endpoint implementing only a 1739 silent server does not support the pairwise mode. 1741 If the signature algorithm used in the group supports ECDH (e.g., 1742 ECDSA, EdDSA), the pairwise mode MUST be supported by endpoints that 1743 use the CoAP Echo Option [I-D.ietf-core-echo-request-tag] and/or 1744 block-wise transfers [RFC7959], for instance for responses after the 1745 first block-wise request, which possibly targets all servers in the 1746 group and includes the CoAP Block2 option (see Section 3.7 of 1747 [I-D.ietf-core-groupcomm-bis]). This prevents the attack described 1748 in Section 10.7, which leverages requests sent over unicast to a 1749 single group member and protected with the group mode. 1751 Senders cannot use the pairwise mode to protect a message intended 1752 for multiple recipients. In fact, the pairwise mode is defined only 1753 between two endpoints and the keying material is thus only available 1754 to one recipient. 1756 However, a sender can use the pairwise mode to protect a message sent 1757 to (but not intended for) multiple recipients, if interested in a 1758 response from only one of them. For instance, this is useful to 1759 support the address discovery service defined in Section 9.1, when a 1760 single 'kid' value is indicated in the payload of a request sent to 1761 multiple recipients, e.g. over multicast. 1763 The Group Manager MAY indicate that the group uses also the pairwise 1764 mode, as part of the group data provided to candidate group members 1765 when joining the group. 1767 9.1. Pre-Conditions 1769 In order to protect an outgoing message in pairwise mode, the sender 1770 needs to know the public key and the Recipient ID for the recipient 1771 endpoint, as stored in the Recipient Context associated to that 1772 endpoint (see Section 2.3.3). 1774 Furthermore, the sender needs to know the individual address of the 1775 recipient endpoint. This information may not be known at any given 1776 point in time. For instance, right after having joined the group, a 1777 client may know the public key and Recipient ID for a given server, 1778 but not the addressing information required to reach it with an 1779 individual, one-to-one request. 1781 To make addressing information of individual endpoints available, 1782 servers in the group MAY expose a resource to which a client can send 1783 a group request targeting a set of servers, identified by their 'kid' 1784 values specified in the request payload. The specified set may be 1785 empty, hence identifying all the servers in the group. Further 1786 details of such an interface are out of scope for this document. 1788 9.2. Main Differences from OSCORE 1790 The pairwise mode protects messages between two members of a group, 1791 essentially following [RFC8613], but with the following notable 1792 differences. 1794 o The 'kid' and 'kid context' parameters of the COSE object are used 1795 as defined in Section 4.2 of this document. 1797 o The external_aad defined in Section 4.3 of this document is used 1798 for the encryption process. 1800 o The Pairwise Sender/Recipient Keys used as Sender/Recipient keys 1801 are derived as defined in Section 2.3 of this document. 1803 9.3. Protecting the Request 1805 When using the pairwise mode, the request is protected as defined in 1806 Section 8.1 of [RFC8613], with the differences summarized in 1807 Section 9.2 of this document. The following difference also applies. 1809 o If Observe [RFC7641] is supported, what defined in Section 8.1.1 1810 of this document holds. 1812 9.4. Verifying the Request 1814 Upon receiving a request with the Group Flag set to 0, following the 1815 procedure in Section 7, the server MUST process it as defined in 1816 Section 8.2 of [RFC8613], with the differences summarized in 1817 Section 9.2 of this document. The following differences also apply. 1819 o If the server discards the request due to not retrieving a 1820 Security Context associated to the OSCORE group or to not 1821 supporting the pairwise mode, the server MAY respond with a 4.01 1822 (Unauthorized) error message or a 4.02 (Bad Option) error message, 1823 respectively. When doing so, the server MAY set an Outer Max-Age 1824 option with value zero, and MAY include a descriptive string as 1825 diagnostic payload. 1827 o If a new Recipient Context is created for this Recipient ID, new 1828 Pairwise Sender/Recipient Keys are also derived (see 1829 Section 2.3.1). The new Pairwise Sender/Recipient Keys are 1830 deleted if the Recipient Context is deleted as a result of the 1831 message not being successfully verified. 1833 o If Observe [RFC7641] is supported, what defined in Section 8.2.1 1834 of this document holds. 1836 9.5. Protecting the Response 1838 When using the pairwise mode, a response is protected as defined in 1839 Section 8.3 of [RFC8613], with the differences summarized in 1840 Section 9.2 of this document. The following differences also apply. 1842 o As discussed in Section 2.4.3.1, the server can obtain a new 1843 Sender ID from the Group Manager. In such a case, the server can 1844 help the client to synchronize, by including the 'kid' parameter 1845 in a response protected in pairwise mode, even when the request 1846 was also protected in pairwise mode. 1848 That is, when responding to a request protected in pairwise mode, 1849 the server SHOULD include the 'kid' parameter in a response 1850 protected in pairwise mode, if it is replying to that client for 1851 the first time since the assignment of its new Sender ID. 1853 o If Observe [RFC7641] is supported, what defined in Section 8.3.1 1854 of this document holds. 1856 9.6. Verifying the Response 1858 Upon receiving a response with the Group Flag set to 0, following the 1859 procedure in Section 7, the client MUST process it as defined in 1860 Section 8.4 of [RFC8613], with the differences summarized in 1861 Section 9.2 of this document. The following differences also apply. 1863 o If a new Recipient Context is created for this Recipient ID, new 1864 Pairwise Sender/Recipient Keys are also derived (see 1865 Section 2.3.1). The new Pairwise Sender/Recipient Keys are 1866 deleted if the Recipient Context is deleted as a result of the 1867 message not being successfully verified. 1869 o If Observe [RFC7641] is supported, what defined in Section 8.4.1 1870 of this document holds. 1872 10. Security Considerations 1874 The same threat model discussed for OSCORE in Appendix D.1 of 1875 [RFC8613] holds for Group OSCORE. In addition, when using the group 1876 mode, source authentication of messages is explicitly ensured by 1877 means of counter signatures, as discussed in Section 10.1. 1879 The same considerations on supporting Proxy operations discussed for 1880 OSCORE in Appendix D.2 of [RFC8613] hold for Group OSCORE. 1882 The same considerations on protected message fields for OSCORE 1883 discussed in Appendix D.3 of [RFC8613] hold for Group OSCORE. 1885 The same considerations on uniqueness of (key, nonce) pairs for 1886 OSCORE discussed in Appendix D.4 of [RFC8613] hold for Group OSCORE. 1887 This is further discussed in Section 10.2 of this document. 1889 The same considerations on unprotected message fields for OSCORE 1890 discussed in Appendix D.5 of [RFC8613] hold for Group OSCORE, with 1891 the following differences. First, the 'kid context' of request 1892 messages is part of the Additional Authenticated Data, thus safely 1893 enabling to keep observations active beyond a possible change of ID 1894 Context (Gid), following a group rekeying (see Section 4.3). Second, 1895 the counter signature included in a Group OSCORE message protected in 1896 group mode is computed also over the value of the OSCORE option, 1897 which is also part of the Additional Authenticated Data used in the 1898 signing process. This is further discussed in Section 10.6 of this 1899 document. 1901 As discussed in Section 6.2.3 of [I-D.ietf-core-groupcomm-bis], Group 1902 OSCORE addresses security attacks against CoAP listed in Sections 1903 11.2-11.6 of [RFC7252], especially when run over IP multicast. 1905 The rest of this section first discusses security aspects to be taken 1906 into account when using Group OSCORE. Then it goes through aspects 1907 covered in the security considerations of OSCORE (see Section 12 of 1908 [RFC8613]), and discusses how they hold when Group OSCORE is used. 1910 10.1. Group-level Security 1912 The group mode described in Section 8 relies on commonly shared group 1913 keying material to protect communication within a group. This has 1914 the following implications. 1916 o Messages are encrypted at a group level (group-level data 1917 confidentiality), i.e. they can be decrypted by any member of the 1918 group, but not by an external adversary or other external 1919 entities. 1921 o The AEAD algorithm provides only group authentication, i.e. it 1922 ensures that a message sent to a group has been sent by a member 1923 of that group, but not necessarily by the alleged sender. This is 1924 why source authentication of messages sent to a group is ensured 1925 through a counter signature, which is computed by the sender using 1926 its own private key and then appended to the message payload. 1928 Instead, the pairwise mode described in Section 9 protects messages 1929 by using pairwise symmetric keys, derived from the static-static 1930 Diffie-Hellman shared secret computed from the asymmetric keys of the 1931 sender and recipient endpoint (see Section 2.3). Therefore, in the 1932 pairwise mode, the AEAD algorithm provides both pairwise data- 1933 confidentiality and source authentication of messages, without using 1934 counter signatures. 1936 The long-term storing of the Diffie-Hellman shared secret is a 1937 potential security issue. In fact, if the shared secret of two group 1938 members is leaked, a third group member can exploit it to impersonate 1939 any of those two group members, by deriving and using their pairwise 1940 key. The possibility of such leakage should be contemplated, as more 1941 likely to happen than the leakage of a private key, which could be 1942 rather protected at a significantly higher level than generic memory, 1943 e.g. by using a Trusted Platform Module. Therefore, there is a 1944 trade-off between the maximum amount of time a same shared secret is 1945 stored and the frequency of its re-computing. 1947 Note that, even if an endpoint is authorized to be a group member and 1948 to take part in group communications, there is a risk that it behaves 1949 inappropriately. For instance, it can forward the content of 1950 messages in the group to unauthorized entities. However, in many use 1951 cases, the devices in the group belong to a common authority and are 1952 configured by a commissioner (see Appendix B), which results in a 1953 practically limited risk and enables a prompt detection/reaction in 1954 case of misbehaving. 1956 10.2. Uniqueness of (key, nonce) 1958 The proof for uniqueness of (key, nonce) pairs in Appendix D.4 of 1959 [RFC8613] is also valid in group communication scenarios. That is, 1960 given an OSCORE group: 1962 o Uniqueness of Sender IDs within the group is enforced by the Group 1963 Manager, which never reassigns the same Sender ID within the same 1964 group under the same Gid value. 1966 o The case A in Appendix D.4 of [RFC8613] concerns all group 1967 requests and responses including a Partial IV (e.g. Observe 1968 notifications). In this case, same considerations from [RFC8613] 1969 apply here as well. 1971 o The case B in Appendix D.4 of [RFC8613] concerns responses not 1972 including a Partial IV (e.g. single response to a group request). 1973 In this case, same considerations from [RFC8613] apply here as 1974 well. 1976 As a consequence, each message encrypted/decrypted with the same 1977 Sender Key is processed by using a different (ID_PIV, PIV) pair. 1978 This means that nonces used by any fixed encrypting endpoint are 1979 unique. Thus, each message is processed with a different (key, 1980 nonce) pair. 1982 10.3. Management of Group Keying Material 1984 The approach described in this specification should take into account 1985 the risk of compromise of group members. In particular, this 1986 document specifies that a key management scheme for secure revocation 1987 and renewal of Security Contexts and group keying material should be 1988 adopted. 1990 [I-D.ietf-ace-key-groupcomm-oscore] provides a simple rekeying scheme 1991 for renewing the Security Context in a group. 1993 Alternative rekeying schemes which are more scalable with the group 1994 size may be needed in dynamic, large-scale groups where endpoints can 1995 join and leave at any time, in order to limit the impact on 1996 performance due to the Security Context and keying material update. 1998 10.4. Update of Security Context and Key Rotation 2000 A group member can receive a message shortly after the group has been 2001 rekeyed, and new security parameters and keying material have been 2002 distributed by the Group Manager. 2004 This may result in a client using an old Security Context to protect 2005 a request, and a server using a different new Security Context to 2006 protect a corresponding response. As a consequence, clients may 2007 receive a response protected with a Security Context different from 2008 the one used to protect the corresponding request. 2010 In particular, a server may first get a request protected with the 2011 old Security Context, then install the new Security Context, and only 2012 after that produce a response to send back to the client. In such a 2013 case, as specified in Section 8.3, the server MUST protect the 2014 potential response using the new Security Context. Specifically, the 2015 server MUST include its Sender Sequence Number as Partial IV in the 2016 response and use it to build the AEAD nonce to protect the response. 2017 This prevents the AEAD nonce from the request from being reused with 2018 the new Security Context. 2020 The client will process that response using the new Security Context, 2021 provided that it has installed the new security parameters and keying 2022 material before the message processing. 2024 In case block-wise transfer [RFC7959] is used, the same 2025 considerations from Section 7.2 of [I-D.ietf-ace-key-groupcomm] hold. 2027 Furthermore, as described below, a group rekeying may temporarily 2028 result in misaligned Security Contexts between the sender and 2029 recipient of a same message. 2031 10.4.1. Late Update on the Sender 2033 In this case, the sender protects a message using the old Security 2034 Context, i.e. before having installed the new Security Context. 2035 However, the recipient receives the message after having installed 2036 the new Security Context, and is thus unable to correctly process it. 2038 A possible way to ameliorate this issue is to preserve the old, 2039 recent, Security Context for a maximum amount of time defined by the 2040 application. By doing so, the recipient can still try to process the 2041 received message using the old retained Security Context as a second 2042 attempt. This makes particular sense when the recipient is a client, 2043 that would hence be able to process incoming responses protected with 2044 the old, recent, Security Context used to protect the associated 2045 group request. Instead, a recipient server would better and more 2046 simply discard an incoming group request which is not successfully 2047 processed with the new Security Context. 2049 This tolerance preserves the processing of secure messages throughout 2050 a long-lasting key rotation, as group rekeying processes may likely 2051 take a long time to complete, especially in large scale groups. On 2052 the other hand, a former (compromised) group member can abusively 2053 take advantage of this, and send messages protected with the old 2054 retained Security Context. Therefore, a conservative application 2055 policy should not admit the retention of old Security Contexts. 2057 10.4.2. Late Update on the Recipient 2059 In this case, the sender protects a message using the new Security 2060 Context, but the recipient receives that message before having 2061 installed the new Security Context. Therefore, the recipient would 2062 not be able to correctly process the message and hence discards it. 2064 If the recipient installs the new Security Context shortly after that 2065 and the sender endpoint retransmits the message, the former will 2066 still be able to receive and correctly process the message. 2068 In any case, the recipient should actively ask the Group Manager for 2069 an updated Security Context according to an application-defined 2070 policy, for instance after a given number of unsuccessfully decrypted 2071 incoming messages. 2073 10.5. Collision of Group Identifiers 2075 In case endpoints are deployed in multiple groups managed by 2076 different non-synchronized Group Managers, it is possible for Group 2077 Identifiers of different groups to coincide. 2079 This does not impair the security of the AEAD algorithm. In fact, as 2080 long as the Master Secret is different for different groups and this 2081 condition holds over time, AEAD keys are different among different 2082 groups. 2084 The entity assigning an IP multicast address may help limiting the 2085 chances to experience such collisions of Group Identifiers. In 2086 particular, it may allow the Group Managers of groups using the same 2087 IP multicast address to share their respective list of assigned Group 2088 Identifiers currently in use. 2090 10.6. Cross-group Message Injection 2092 A same endpoint is allowed to and would likely use the same public/ 2093 private key pair in multiple OSCORE groups, possibly administered by 2094 different Group Managers. 2096 When a sender endpoint sends a message protected in pairwise mode to 2097 a recipient endpoint in an OSCORE group, a malicious group member may 2098 attempt to inject the message to a different OSCORE group also 2099 including the same endpoints (see Section 10.6.1). 2101 This practically relies on altering the content of the OSCORE option, 2102 and having the same MAC in the ciphertext still correctly validating, 2103 which has a success probability depending on the size of the MAC. 2105 As discussed in Section 10.6.2, the attack is practically infeasible 2106 if the message is protected in group mode, thanks to the counter 2107 signature also bound to the OSCORE option through the Additional 2108 Authenticated Data used in the signing process (see Section 4.3). 2110 10.6.1. Attack Description 2112 Let us consider: 2114 o Two OSCORE groups G1 and G2, with ID Context (Group ID) Gid1 and 2115 Gid2, respectively. Both G1 and G2 use the AEAD cipher AES-CCM- 2116 16-64-128, i.e. the MAC of the ciphertext is 8 bytes in size. 2118 o A sender endpoint X which is member of both G1 and G2, and uses 2119 the same public/private key pair in both groups. The endpoint X 2120 has Sender ID Sid1 in G1 and Sender ID Sid2 in G2. The pairs 2121 (Sid1, Gid1) and (Sid2, Gid2) identify the same public key of X in 2122 G1 and G2, respectively. 2124 o A recipient endpoint Y which is member of both G1 and G2, and uses 2125 the same public/private key pair in both groups. The endpoint Y 2126 has Sender ID Sid3 in G1 and Sender ID Sid4 in G2. The pairs 2127 (Sid3, Gid1) and (Sid4, Gid2) identify the same public key of Y in 2128 G1 and G2, respectively. 2130 o A malicious endpoint Z is also member of both G1 and G2. Hence, Z 2131 is able to derive the Sender Keys used by X in G1 and G2. 2133 When X sends a message M1 addressed to Y in G1 and protected in 2134 pairwise mode, Z can intercept M1, and attempt to forge a valid 2135 message M2 to be injected in G2, making it appear as still sent by X 2136 to Y and valid to be accepted. 2138 More in detail, Z intercepts and stops message M1, and forges a 2139 message M2 by changing the value of the OSCORE option from M1 as 2140 follows: the 'kid context' is set to G2 (rather than G1); and the 2141 'kid' is set to Sid2 (rather than Sid1). Then, Z injects message M2 2142 as addressed to Y in G2. 2144 Upon receiving M2, there is a probability equal to 2^-64 that Y 2145 successfully verifies the same unchanged MAC by using the Pairwise 2146 Recipient Key associated to X in G2. 2148 Note that Z does not know the pairwise keys of X and Y, since it does 2149 not know and is not able to compute their shared Diffie-Hellman 2150 secret. Therefore, Z is not able to check offline if a performed 2151 forgery is actually valid, before sending the forged message to G2. 2153 10.6.2. Attack Prevention in Group Mode 2155 When a Group OSCORE message is protected with the group mode, the 2156 counter signature is computed also over the value of the OSCORE 2157 option, which is part of the Additional Authenticated Data used in 2158 the signing process (see Section 4.3). 2160 That is, other than over the ciphertext, the countersignature is 2161 computed over: the ID Context (Gid) and the Partial IV, which are 2162 always present in group requests; as well as the Sender ID of the 2163 message originator, which is always present in group requests as well 2164 as in responses to requests protected in group mode. 2166 Since the signing process takes as input also the ciphertext of the 2167 COSE_Encrypt0 object, the countersignature is bound not only to the 2168 intended OSCORE group, hence to the triplet (Master Secret, Master 2169 Salt, ID Context), but also to a specific Sender ID in that group and 2170 to its specific symmetric key used for AEAD encryption, hence to the 2171 quartet (Master Secret, Master Salt, ID Context, Sender ID). 2173 This makes it practically infeasible to perform the attack described 2174 in Section 10.6.1, since it would require the adversary to 2175 additionally forge a valid countersignature that replaces the 2176 original one in the forged message M2. 2178 If the countersignature did not cover the OSCORE option, the attack 2179 would still be possible against response messages protected in group 2180 mode, since the same unchanged countersignature from message M1 would 2181 be also valid in message M2. 2183 Also, the following attack simplifications would hold, since Z is 2184 able to derive the Sender/Recipient Keys of X and Y in G1 and G2. 2185 That is, Z can also set a convenient Partial IV in the response, 2186 until the same unchanged MAC is successfully verified by using G2 as 2187 'request_kid_context', Sid2 as 'request_kid', and the symmetric key 2188 associated to X in G2. 2190 Since the Partial IV is 5 bytes in size, this requires 2^40 2191 operations to test all the Partial IVs, which can be done in real- 2192 time. The probability that a single given message M1 can be used to 2193 forge a response M2 for a given request would be equal to 2^-24, 2194 since there are more MAC values (8 bytes in size) than Partial IV 2195 values (5 bytes in size). 2197 Note that, by changing the Partial IV as discussed above, any member 2198 of G1 would also be able to forge a valid signed response message M2 2199 to be injected in the same group G1. 2201 10.7. Group OSCORE for Unicast Requests 2203 If a request is intended to be sent over unicast as addressed to a 2204 single group member, it is NOT RECOMMENDED for the client to protect 2205 the request by using the group mode as defined in Section 8.1. 2207 This does not include the case where the client sends a request over 2208 unicast to a proxy, to be forwarded to multiple intended recipients 2209 over multicast [I-D.ietf-core-groupcomm-bis]. In this case, the 2210 client MUST protect the request with the group mode, even though it 2211 is sent to the proxy over unicast (see Section 8). 2213 If the client uses the group mode with its own Sender Key to protect 2214 a unicast request to a group member, an on-path adversary can, right 2215 then or later on, redirect that request to one/many different group 2216 member(s) over unicast, or to the whole OSCORE group over multicast. 2217 By doing so, the adversary can induce the target group member(s) to 2218 perform actions intended for one group member only. Note that the 2219 adversary can be external, i.e. (s)he does not need to also be a 2220 member of the OSCORE group. 2222 This is due to the fact that the client is not able to indicate the 2223 single intended recipient in a way which is secure and possible to 2224 process for Group OSCORE on the server side. In particular, Group 2225 OSCORE does not protect network addressing information such as the IP 2226 address of the intended recipient server. It follows that the 2227 server(s) receiving the redirected request cannot assert whether that 2228 was the original intention of the client, and would thus simply 2229 assume so. 2231 The impact of such an attack depends especially on the REST method of 2232 the request, i.e. the Inner CoAP Code of the OSCORE request message. 2233 In particular, safe methods such as GET and FETCH would trigger 2234 (several) unintended responses from the targeted server(s), while not 2235 resulting in destructive behavior. On the other hand, non safe 2236 methods such as PUT, POST and PATCH/iPATCH would result in the target 2237 server(s) taking active actions on their resources and possible 2238 cyber-physical environment, with the risk of destructive consequences 2239 and possible implications for safety. 2241 A client can instead use the pairwise mode as defined in Section 9.3, 2242 in order to protect a request sent to a single group member by using 2243 pairwise keying material (see Section 2.3). This prevents the attack 2244 discussed above by construction, as only the intended server is able 2245 to derive the pairwise keying material used by the client to protect 2246 the request. A client supporting the pairwise mode SHOULD use it to 2247 protect requests sent to a single group member over unicast, instead 2248 of using the group mode. For an example where this is not fulfilled, 2249 see Section 7.2.1 in 2250 [I-D.tiloca-core-observe-multicast-notifications]. 2252 With particular reference to block-wise transfers [RFC7959], 2253 Section 3.7 of [I-D.ietf-core-groupcomm-bis] points out that, while 2254 an initial request including the CoAP Block2 option can be sent over 2255 multicast, any other request in a transfer has to occur over unicast, 2256 individually addressing the servers in the group. 2258 Additional considerations are discussed in Appendix E, with respect 2259 to requests including a CoAP Echo Option 2260 [I-D.ietf-core-echo-request-tag] that has to be sent over unicast, as 2261 a challenge-response method for servers to achieve synchronization of 2262 clients' Sender Sequence Number. 2264 10.8. End-to-end Protection 2266 The same considerations from Section 12.1 of [RFC8613] hold for Group 2267 OSCORE. 2269 Additionally, (D)TLS and Group OSCORE can be combined for protecting 2270 message exchanges occurring over unicast. However, it is not 2271 possible to combine (D)TLS and Group OSCORE for protecting message 2272 exchanges where messages are (also) sent over multicast. 2274 10.9. Master Secret 2276 Group OSCORE derives the Security Context using the same construction 2277 as OSCORE, and by using the Group Identifier of a group as the 2278 related ID Context. Hence, the same required properties of the 2279 Security Context parameters discussed in Section 3.3 of [RFC8613] 2280 hold for this document. 2282 With particular reference to the OSCORE Master Secret, it has to be 2283 kept secret among the members of the respective OSCORE group and the 2284 Group Manager responsible for that group. Also, the Master Secret 2285 must have a good amount of randomness, and the Group Manager can 2286 generate it offline using a good random number generator. This 2287 includes the case where the Group Manager rekeys the group by 2288 generating and distributing a new Master Secret. Randomness 2289 requirements for security are described in [RFC4086]. 2291 10.10. Replay Protection 2293 As in OSCORE [RFC8613], also Group OSCORE relies on Sender Sequence 2294 Numbers included in the COSE message field 'Partial IV' and used to 2295 build AEAD nonces. 2297 Note that the Partial IV of an endpoint does not necessarily grow 2298 monotonically. For instance, upon exhaustion of the endpoint Sender 2299 Sequence Number, the Partial IV also gets exhausted. As discussed in 2300 Section 2.4.3, this results either in the endpoint being individually 2301 rekeyed and getting a new Sender ID, or in the establishment of a new 2302 Security Context in the group. Therefore, uniqueness of (key, nonce) 2303 pairs (see Section 10.2) is preserved also when a new Security 2304 Context is established. 2306 Since one-to-many communication such as multicast usually involves 2307 unreliable transports, the simplification of the Replay Window to a 2308 size of 1 suggested in Section 7.4 of [RFC8613] is not viable with 2309 Group OSCORE, unless exchanges in the group rely only on unicast 2310 messages. 2312 As discussed in Section 6.1, a Replay Window may be initialized as 2313 not valid, following the loss of mutable Security Context 2314 Section 2.4.1. In particular, Section 2.4.1.1 and Section 2.4.1.2 2315 define measures that endpoints need to take in such a situation, 2316 before resuming to accept incoming messages from other group members. 2318 10.11. Message Freshness 2320 As discussed in Section 6.2, a server may not be able to assert 2321 whether an incoming request is fresh, in case it does not have or has 2322 lost synchronization with the client's Sender Sequence Number. 2324 If freshness is relevant for the application, the server may 2325 (re-)synchronize with the client's Sender Sequence Number at any 2326 time, by using the approach described in Appendix E and based on the 2327 CoAP Echo Option [I-D.ietf-core-echo-request-tag], as a variant of 2328 the approach defined in Appendix B.1.2 of [RFC8613] applicable to 2329 Group OSCORE. 2331 10.12. Client Aliveness 2333 Building on Section 12.5 of [RFC8613], a server may use the CoAP Echo 2334 Option [I-D.ietf-core-echo-request-tag] to verify the aliveness of 2335 the client that originated a received request, by using the approach 2336 described in Appendix E of this specification. 2338 10.13. Cryptographic Considerations 2340 The same considerations from Section 12.6 of [RFC8613] about the 2341 maximum Sender Sequence Number hold for Group OSCORE. 2343 As discussed in Section 2.4.2, an endpoint that experiences an 2344 exhaustion of its own Sender Sequence Numbers MUST NOT protect 2345 further messages including a Partial IV, until it has derived a new 2346 Sender Context. This prevents the endpoint to reuse the same AEAD 2347 nonces with the same Sender Key. 2349 In order to renew its own Sender Context, the endpoint SHOULD inform 2350 the Group Manager, which can either renew the whole Security Context 2351 by means of group rekeying, or provide only that endpoint with a new 2352 Sender ID value. In either case, the endpoint derives a new Sender 2353 Context, and in particular a new Sender Key. 2355 Additionally, the same considerations from Section 12.6 of [RFC8613] 2356 hold for Group OSCORE, about building the AEAD nonce and the secrecy 2357 of the Security Context parameters. 2359 The EdDSA signature algorithm and the elliptic curve Ed25519 2360 [RFC8032] are mandatory to implement. For endpoints that support the 2361 pairwise mode, the ECDH-SS + HKDF-256 algorithm specified in 2362 Section 6.3.1 of [I-D.ietf-cose-rfc8152bis-algs] and the X25519 curve 2363 [RFC7748] are also mandatory to implement. 2365 Constrained IoT devices may alternatively represent Montgomery curves 2366 and (twisted) Edwards curves [RFC7748] in the short-Weierstrass form 2367 Wei25519, with which the algorithms ECDSA25519 and ECDH25519 can be 2368 used for signature operations and Diffie-Hellman secret calculation, 2369 respectively [I-D.ietf-lwig-curve-representations]. 2371 For many constrained IoT devices, it is problematic to support more 2372 than one signature algorithm or multiple whole cipher suites. As a 2373 consequence, some deployments using, for instance, ECDSA with NIST 2374 P-256 may not support the mandatory signature algorithm but that 2375 should not be an issue for local deployments. 2377 The derivation of pairwise keys defined in Section 2.3.1 is 2378 compatible with ECDSA and EdDSA asymmetric keys, but is not 2379 compatible with RSA asymmetric keys. The security of using the same 2380 key pair for Diffie-Hellman and for signing is demonstrated in 2381 [Degabriele]. 2383 10.14. Message Segmentation 2385 The same considerations from Section 12.7 of [RFC8613] hold for Group 2386 OSCORE. 2388 10.15. Privacy Considerations 2390 Group OSCORE ensures end-to-end integrity protection and encryption 2391 of the message payload and all options that are not used for proxy 2392 operations. In particular, options are processed according to the 2393 same class U/I/E that they have for OSCORE. Therefore, the same 2394 privacy considerations from Section 12.8 of [RFC8613] hold for Group 2395 OSCORE. 2397 Furthermore, the following privacy considerations hold about the 2398 OSCORE option, which may reveal information on the communicating 2399 endpoints. 2401 o The 'kid' parameter, which is intended to help a recipient 2402 endpoint to find the right Recipient Context, may reveal 2403 information about the Sender Endpoint. When both a request and 2404 the corresponding responses include the 'kid' parameter, this may 2405 reveal information about both a client sending a request and all 2406 the possibly replying servers sending their own individual 2407 response. 2409 o The 'kid context' parameter, which is intended to help a recipient 2410 endpoint to find the right Security Context, reveals information 2411 about the sender endpoint. In particular, it reveals that the 2412 sender endpoint is a member of a particular OSCORE group, whose 2413 current Group ID is indicated in the 'kid context' parameter. 2415 When receiving a group request, each of the recipient endpoints can 2416 reply with a response that includes its Sender ID as 'kid' parameter. 2417 All these responses will be matchable with the request through the 2418 Token. Thus, even if these responses do not include a 'kid context' 2419 parameter, it becomes possible to understand that the responder 2420 endpoints are in the same group of the requester endpoint. 2422 Furthermore, using the mechanisms described in Appendix E to achieve 2423 Sender Sequence Number synchronization with a client may reveal when 2424 a server device goes through a reboot. This can be mitigated by the 2425 server device storing the precise state of the Replay Window of each 2426 known client on a clean shutdown. 2428 Finally, the mechanism described in Section 10.5 to prevent 2429 collisions of Group Identifiers from different Group Managers may 2430 reveal information about events in the respective OSCORE groups. In 2431 particular, a Group Identifier changes when the corresponding group 2432 is rekeyed. Thus, Group Managers might use the shared list of Group 2433 Identifiers to infer the rate and patterns of group membership 2434 changes triggering a group rekeying, e.g. due to newly joined members 2435 or evicted (compromised) members. In order to alleviate this privacy 2436 concern, it should be hidden from the Group Managers which exact 2437 Group Manager has currently assigned which Group Identifiers in its 2438 OSCORE groups. 2440 11. IANA Considerations 2442 Note to RFC Editor: Please replace "[This Document]" with the RFC 2443 number of this specification and delete this paragraph. 2445 This document has the following actions for IANA. 2447 11.1. OSCORE Flag Bits Registry 2449 IANA is asked to add the following value entry to the "OSCORE Flag 2450 Bits" subregistry defined in Section 13.7 of [RFC8613] as part of the 2451 "CoRE Parameters" registry. 2453 +--------------+------------+-----------------------------+-----------+ 2454 | Bit Position | Name | Description | Reference | 2455 +--------------+------------+-----------------------------+-----------+ 2456 | 2 | Group Flag | For using a Group OSCORE | [This | 2457 | | | Security Context, set to 1 | Document] | 2458 | | | if the message is protected | | 2459 | | | with the group mode | | 2460 +--------------+------------+-----------------------------+-----------+ 2462 12. References 2464 12.1. Normative References 2466 [COSE.Algorithms] 2467 IANA, "COSE Algorithms", 2468 . 2471 [COSE.Key.Types] 2472 IANA, "COSE Key Types", 2473 . 2476 [I-D.ietf-core-groupcomm-bis] 2477 Dijk, E., Wang, C., and M. Tiloca, "Group Communication 2478 for the Constrained Application Protocol (CoAP)", draft- 2479 ietf-core-groupcomm-bis-03 (work in progress), February 2480 2021. 2482 [I-D.ietf-cose-countersign] 2483 Schaad, J. and R. Housley, "CBOR Object Signing and 2484 Encryption (COSE): Countersignatures", draft-ietf-cose- 2485 countersign-02 (work in progress), December 2020. 2487 [I-D.ietf-cose-rfc8152bis-algs] 2488 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2489 Initial Algorithms", draft-ietf-cose-rfc8152bis-algs-12 2490 (work in progress), September 2020. 2492 [I-D.ietf-cose-rfc8152bis-struct] 2493 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2494 Structures and Process", draft-ietf-cose-rfc8152bis- 2495 struct-15 (work in progress), February 2021. 2497 [NIST-800-56A] 2498 Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. 2499 Davis, "Recommendation for Pair-Wise Key-Establishment 2500 Schemes Using Discrete Logarithm Cryptography - NIST 2501 Special Publication 800-56A, Revision 3", April 2018, 2502 . 2505 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2506 Requirement Levels", BCP 14, RFC 2119, 2507 DOI 10.17487/RFC2119, March 1997, 2508 . 2510 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 2511 "Randomness Requirements for Security", BCP 106, RFC 4086, 2512 DOI 10.17487/RFC4086, June 2005, 2513 . 2515 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2516 Application Protocol (CoAP)", RFC 7252, 2517 DOI 10.17487/RFC7252, June 2014, 2518 . 2520 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 2521 for Security", RFC 7748, DOI 10.17487/RFC7748, January 2522 2016, . 2524 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 2525 Signature Algorithm (EdDSA)", RFC 8032, 2526 DOI 10.17487/RFC8032, January 2017, 2527 . 2529 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2530 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2531 May 2017, . 2533 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2534 "Object Security for Constrained RESTful Environments 2535 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 2536 . 2538 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 2539 Representation (CBOR)", STD 94, RFC 8949, 2540 DOI 10.17487/RFC8949, December 2020, 2541 . 2543 12.2. Informative References 2545 [Degabriele] 2546 Degabriele, J., Lehmann, A., Paterson, K., Smart, N., and 2547 M. Strefler, "On the Joint Security of Encryption and 2548 Signature in EMV", December 2011, 2549 . 2551 [I-D.ietf-ace-key-groupcomm] 2552 Palombini, F. and M. Tiloca, "Key Provisioning for Group 2553 Communication using ACE", draft-ietf-ace-key-groupcomm-11 2554 (work in progress), February 2021. 2556 [I-D.ietf-ace-key-groupcomm-oscore] 2557 Tiloca, M., Park, J., and F. Palombini, "Key Management 2558 for OSCORE Groups in ACE", draft-ietf-ace-key-groupcomm- 2559 oscore-10 (work in progress), February 2021. 2561 [I-D.ietf-ace-oauth-authz] 2562 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 2563 H. Tschofenig, "Authentication and Authorization for 2564 Constrained Environments (ACE) using the OAuth 2.0 2565 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-37 2566 (work in progress), February 2021. 2568 [I-D.ietf-core-echo-request-tag] 2569 Amsuess, C., Mattsson, J., and G. Selander, "CoAP: Echo, 2570 Request-Tag, and Token Processing", draft-ietf-core-echo- 2571 request-tag-12 (work in progress), January 2021. 2573 [I-D.ietf-lwig-curve-representations] 2574 Struik, R., "Alternative Elliptic Curve Representations", 2575 draft-ietf-lwig-curve-representations-20 (work in 2576 progress), February 2021. 2578 [I-D.ietf-lwig-security-protocol-comparison] 2579 Mattsson, J., Palombini, F., and M. Vucinic, "Comparison 2580 of CoAP Security Protocols", draft-ietf-lwig-security- 2581 protocol-comparison-05 (work in progress), November 2020. 2583 [I-D.ietf-tls-dtls13] 2584 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 2585 Datagram Transport Layer Security (DTLS) Protocol Version 2586 1.3", draft-ietf-tls-dtls13-41 (work in progress), 2587 February 2021. 2589 [I-D.mattsson-cfrg-det-sigs-with-noise] 2590 Mattsson, J., Thormarker, E., and S. Ruohomaa, 2591 "Deterministic ECDSA and EdDSA Signatures with Additional 2592 Randomness", draft-mattsson-cfrg-det-sigs-with-noise-02 2593 (work in progress), March 2020. 2595 [I-D.somaraju-ace-multicast] 2596 Somaraju, A., Kumar, S., Tschofenig, H., and W. Werner, 2597 "Security for Low-Latency Group Communication", draft- 2598 somaraju-ace-multicast-02 (work in progress), October 2599 2016. 2601 [I-D.tiloca-core-observe-multicast-notifications] 2602 Tiloca, M., Hoeglund, R., Amsuess, C., and F. Palombini, 2603 "Observe Notifications as CoAP Multicast Responses", 2604 draft-tiloca-core-observe-multicast-notifications-05 (work 2605 in progress), February 2021. 2607 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 2608 "Transmission of IPv6 Packets over IEEE 802.15.4 2609 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 2610 . 2612 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2613 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2614 . 2616 [RFC6282] Hui, J., Ed. and P. Thubert, "Compression Format for IPv6 2617 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 2618 DOI 10.17487/RFC6282, September 2011, 2619 . 2621 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 2622 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 2623 January 2012, . 2625 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2626 Constrained-Node Networks", RFC 7228, 2627 DOI 10.17487/RFC7228, May 2014, 2628 . 2630 [RFC7641] Hartke, K., "Observing Resources in the Constrained 2631 Application Protocol (CoAP)", RFC 7641, 2632 DOI 10.17487/RFC7641, September 2015, 2633 . 2635 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2636 the Constrained Application Protocol (CoAP)", RFC 7959, 2637 DOI 10.17487/RFC7959, August 2016, 2638 . 2640 Appendix A. Assumptions and Security Objectives 2642 This section presents a set of assumptions and security objectives 2643 for the approach described in this document. The rest of this 2644 section refers to three types of groups: 2646 o Application group, i.e. a set of CoAP endpoints that share a 2647 common pool of resources. 2649 o Security group, as defined in Section 1.1 of this specification. 2650 There can be a one-to-one or a one-to-many relation between 2651 security groups and application groups, and vice versa. 2653 o CoAP group, i.e. a set of CoAP endpoints where each endpoint is 2654 configured to receive one-to-many CoAP requests, e.g. sent to the 2655 group's associated IP multicast address and UDP port as defined in 2656 [I-D.ietf-core-groupcomm-bis]. An endpoint may be a member of 2657 multiple CoAP groups. There can be a one-to-one or a one-to-many 2658 relation between application groups and CoAP groups. Note that a 2659 device sending a CoAP request to a CoAP group is not necessarily 2660 itself a member of that group: it is a member only if it also has 2661 a CoAP server endpoint listening to requests for this CoAP group, 2662 sent to the associated IP multicast address and port. In order to 2663 provide secure group communication, all members of a CoAP group as 2664 well as all further endpoints configured only as clients sending 2665 CoAP (multicast) requests to the CoAP group have to be member of a 2666 security group. There can be a one-to-one or a one-to-many 2667 relation between security groups and CoAP groups, and vice versa. 2669 A.1. Assumptions 2671 The following points are assumed to be already addressed and are out 2672 of the scope of this document. 2674 o Multicast communication topology: this document considers both 2675 1-to-N (one sender and multiple recipients) and M-to-N (multiple 2676 senders and multiple recipients) communication topologies. The 2677 1-to-N communication topology is the simplest group communication 2678 scenario that would serve the needs of a typical Low-power and 2679 Lossy Network (LLN). Examples of use cases that benefit from 2680 secure group communication are provided in Appendix B. 2682 In a 1-to-N communication model, only a single client transmits 2683 data to the CoAP group, in the form of request messages; in an 2684 M-to-N communication model (where M and N do not necessarily have 2685 the same value), M clients transmit data to the CoAP group. 2686 According to [I-D.ietf-core-groupcomm-bis], any possible proxy 2687 entity is supposed to know about the clients. Also, every client 2688 expects and is able to handle multiple response messages 2689 associated to a same request sent to the CoAP group. 2691 o Group size: security solutions for group communication should be 2692 able to adequately support different and possibly large security 2693 groups. The group size is the current number of members in a 2694 security group. In the use cases mentioned in this document, the 2695 number of clients (normally the controlling devices) is expected 2696 to be much smaller than the number of servers (i.e. the controlled 2697 devices). A security solution for group communication that 2698 supports 1 to 50 clients would be able to properly cover the group 2699 sizes required for most use cases that are relevant for this 2700 document. The maximum group size is expected to be in the range 2701 of 2 to 100 devices. Security groups larger than that should be 2702 divided into smaller independent groups. 2704 o Communication with the Group Manager: an endpoint must use a 2705 secure dedicated channel when communicating with the Group 2706 Manager, also when not registered as a member of the security 2707 group. 2709 o Provisioning and management of Security Contexts: a Security 2710 Context must be established among the members of the security 2711 group. A secure mechanism must be used to generate, revoke and 2712 (re-)distribute keying material, communication policies and 2713 security parameters in the security group. The actual 2714 provisioning and management of the Security Context is out of the 2715 scope of this document. 2717 o Multicast data security ciphersuite: all members of a security 2718 group must agree on a ciphersuite to provide authenticity, 2719 integrity and confidentiality of messages in the group. The 2720 ciphersuite is specified as part of the Security Context. 2722 o Backward security: a new device joining the security group should 2723 not have access to any old Security Contexts used before its 2724 joining. This ensures that a new member of the security group is 2725 not able to decrypt confidential data sent before it has joined 2726 the security group. The adopted key management scheme should 2727 ensure that the Security Context is updated to ensure backward 2728 confidentiality. The actual mechanism to update the Security 2729 Context and renew the group keying material in the security group 2730 upon a new member's joining has to be defined as part of the group 2731 key management scheme. 2733 o Forward security: entities that leave the security group should 2734 not have access to any future Security Contexts or message 2735 exchanged within the security group after their leaving. This 2736 ensures that a former member of the security group is not able to 2737 decrypt confidential data sent within the security group anymore. 2738 Also, it ensures that a former member is not able to send 2739 protected messages to the security group anymore. The actual 2740 mechanism to update the Security Context and renew the group 2741 keying material in the security group upon a member's leaving has 2742 to be defined as part of the group key management scheme. 2744 A.2. Security Objectives 2746 The approach described in this document aims at fulfilling the 2747 following security objectives: 2749 o Data replay protection: group request messages or response 2750 messages replayed within the security group must be detected. 2752 o Data confidentiality: messages sent within the security group 2753 shall be encrypted. 2755 o Group-level data confidentiality: the group mode provides group- 2756 level data confidentiality since messages are encrypted at a group 2757 level, i.e. in such a way that they can be decrypted by any member 2758 of the security group, but not by an external adversary or other 2759 external entities. 2761 o Pairwise data confidentiality: the pairwise mode especially 2762 provides pairwise data confidentiality, since messages are 2763 encrypted using pairwise keying material shared between any two 2764 group members, hence they can be decrypted only by the intended 2765 single recipient. 2767 o Source message authentication: messages sent within the security 2768 group shall be authenticated. That is, it is essential to ensure 2769 that a message is originated by a member of the security group in 2770 the first place, and in particular by a specific, identifiable 2771 member of the security group. 2773 o Message integrity: messages sent within the security group shall 2774 be integrity protected. That is, it is essential to ensure that a 2775 message has not been tampered with, either by a group member, or 2776 by an external adversary or other external entities which are not 2777 members of the security group. 2779 o Message ordering: it must be possible to determine the ordering of 2780 messages coming from a single sender. In accordance with OSCORE 2781 [RFC8613], this results in providing absolute freshness of 2782 responses that are not notifications, as well as relative 2783 freshness of group requests and notification responses. It is not 2784 required to determine ordering of messages from different senders. 2786 Appendix B. List of Use Cases 2788 Group Communication for CoAP [I-D.ietf-core-groupcomm-bis] provides 2789 the necessary background for multicast-based CoAP communication, with 2790 particular reference to low-power and lossy networks (LLNs) and 2791 resource constrained environments. The interested reader is 2792 encouraged to first read [I-D.ietf-core-groupcomm-bis] to understand 2793 the non-security related details. This section discusses a number of 2794 use cases that benefit from secure group communication, and refers to 2795 the three types of groups from Appendix A. Specific security 2796 requirements for these use cases are discussed in Appendix A. 2798 o Lighting control: consider a building equipped with IP-connected 2799 lighting devices, switches, and border routers. The lighting 2800 devices acting as servers are organized into application groups 2801 and CoAP groups, according to their physical location in the 2802 building. For instance, lighting devices in a room or corridor 2803 can be configured as members of a single application group and 2804 corresponding CoAP group. Those lighting devices together with 2805 the switches acting as clients in the same room or corridor can be 2806 configured as members of the corresponding security group. 2807 Switches are then used to control the lighting devices by sending 2808 on/off/dimming commands to all lighting devices in the CoAP group, 2809 while border routers connected to an IP network backbone (which is 2810 also multicast-enabled) can be used to interconnect routers in the 2811 building. Consequently, this would also enable logical groups to 2812 be formed even if devices with a role in the lighting application 2813 may be physically in different subnets (e.g. on wired and wireless 2814 networks). Connectivity between lighting devices may be realized, 2815 for instance, by means of IPv6 and (border) routers supporting 2816 6LoWPAN [RFC4944][RFC6282]. Group communication enables 2817 synchronous operation of a set of connected lights, ensuring that 2818 the light preset (e.g. dimming level or color) of a large set of 2819 luminaires are changed at the same perceived time. This is 2820 especially useful for providing a visual synchronicity of light 2821 effects to the user. As a practical guideline, events within a 2822 200 ms interval are perceived as simultaneous by humans, which is 2823 necessary to ensure in many setups. Devices may reply back to the 2824 switches that issue on/off/dimming commands, in order to report 2825 about the execution of the requested operation (e.g. OK, failure, 2826 error) and their current operational status. In a typical 2827 lighting control scenario, a single switch is the only entity 2828 responsible for sending commands to a set of lighting devices. In 2829 more advanced lighting control use cases, a M-to-N communication 2830 topology would be required, for instance in case multiple sensors 2831 (presence or day-light) are responsible to trigger events to a set 2832 of lighting devices. Especially in professional lighting 2833 scenarios, the roles of client and server are configured by the 2834 lighting commissioner, and devices strictly follow those roles. 2836 o Integrated building control: enabling Building Automation and 2837 Control Systems (BACSs) to control multiple heating, ventilation 2838 and air-conditioning units to predefined presets. Controlled 2839 units can be organized into application groups and CoAP groups in 2840 order to reflect their physical position in the building, e.g. 2841 devices in the same room can be configured as members of a single 2842 application group and corresponding CoAP group. As a practical 2843 guideline, events within intervals of seconds are typically 2844 acceptable. Controlled units are expected to possibly reply back 2845 to the BACS issuing control commands, in order to report about the 2846 execution of the requested operation (e.g. OK, failure, error) 2847 and their current operational status. 2849 o Software and firmware updates: software and firmware updates often 2850 comprise quite a large amount of data. This can overload a Low- 2851 power and Lossy Network (LLN) that is otherwise typically used to 2852 deal with only small amounts of data, on an infrequent base. 2853 Rather than sending software and firmware updates as unicast 2854 messages to each individual device, multicasting such updated data 2855 to a larger set of devices at once displays a number of benefits. 2856 For instance, it can significantly reduce the network load and 2857 decrease the overall time latency for propagating this data to all 2858 devices. Even if the complete whole update process itself is 2859 secured, securing the individual messages is important, in case 2860 updates consist of relatively large amounts of data. In fact, 2861 checking individual received data piecemeal for tampering avoids 2862 that devices store large amounts of partially corrupted data and 2863 that they detect tampering hereof only after all data has been 2864 received. Devices receiving software and firmware updates are 2865 expected to possibly reply back, in order to provide a feedback 2866 about the execution of the update operation (e.g. OK, failure, 2867 error) and their current operational status. 2869 o Parameter and configuration update: by means of multicast 2870 communication, it is possible to update the settings of a set of 2871 similar devices, both simultaneously and efficiently. Possible 2872 parameters are related, for instance, to network load management 2873 or network access controls. Devices receiving parameter and 2874 configuration updates are expected to possibly reply back, to 2875 provide a feedback about the execution of the update operation 2876 (e.g. OK, failure, error) and their current operational status. 2878 o Commissioning of Low-power and Lossy Network (LLN) systems: a 2879 commissioning device is responsible for querying all devices in 2880 the local network or a selected subset of them, in order to 2881 discover their presence, and be aware of their capabilities, 2882 default configuration, and operating conditions. Queried devices 2883 displaying similarities in their capabilities and features, or 2884 sharing a common physical location can be configured as members of 2885 a single application group and corresponding CoAP group. Queried 2886 devices are expected to reply back to the commissioning device, in 2887 order to notify their presence, and provide the requested 2888 information and their current operational status. 2890 o Emergency multicast: a particular emergency related information 2891 (e.g. natural disaster) is generated and multicast by an emergency 2892 notifier, and relayed to multiple devices. The latter may reply 2893 back to the emergency notifier, in order to provide their feedback 2894 and local information related to the ongoing emergency. This kind 2895 of setups should additionally rely on a fault tolerance multicast 2896 algorithm, such as Multicast Protocol for Low-Power and Lossy 2897 Networks (MPL). 2899 Appendix C. Example of Group Identifier Format 2901 This section provides an example of how the Group Identifier (Gid) 2902 can be specifically formatted. That is, the Gid can be composed of 2903 two parts, namely a Group Prefix and a Group Epoch. 2905 For each group, the Group Prefix is constant over time and is 2906 uniquely defined in the set of all the groups associated to the same 2907 Group Manager. The choice of the Group Prefix for a given group's 2908 Security Context is application specific. The size of the Group 2909 Prefix directly impact on the maximum number of distinct groups under 2910 the same Group Manager. 2912 The Group Epoch is set to 0 upon the group's initialization, and is 2913 incremented by 1 each time new keying material, together with a new 2914 Gid, is distributed to the group in order to establish a new Security 2915 Context (see Section 3.1). 2917 As an example, a 3-byte Gid can be composed of: i) a 1-byte Group 2918 Prefix '0xb1' interpreted as a raw byte string; and ii) a 2-byte 2919 Group Epoch interpreted as an unsigned integer ranging from 0 to 2920 65535. Then, after having established the Common Context 61532 times 2921 in the group, its Gid will assume value '0xb1f05c'. 2923 Using an immutable Group Prefix for a group assumes that enough time 2924 elapses before all possible Group Epoch values are used, since the 2925 Group Manager never reassigns the same Gid to the same group. Thus, 2926 the expected highest rate for addition/removal of group members and 2927 consequent group rekeying should be taken into account for a proper 2928 dimensioning of the Group Epoch size. 2930 As discussed in Section 10.5, if endpoints are deployed in multiple 2931 groups managed by different non-synchronized Group Managers, it is 2932 possible that Group Identifiers of different groups coincide at some 2933 point in time. In this case, a recipient has to handle coinciding 2934 Group Identifiers, and has to try using different Security Contexts 2935 to process an incoming message, until the right one is found and the 2936 message is correctly verified. Therefore, it is favorable that Group 2937 Identifiers from different Group Managers have a size that result in 2938 a small probability of collision. How small this probability should 2939 be is up to system designers. 2941 Appendix D. Set-up of New Endpoints 2943 An endpoint joins a group by explicitly interacting with the 2944 responsible Group Manager. When becoming members of a group, 2945 endpoints are not required to know how many and what endpoints are in 2946 the same group. 2948 Communications between a joining endpoint and the Group Manager rely 2949 on the CoAP protocol and must be secured. Specific details on how to 2950 secure communications between joining endpoints and a Group Manager 2951 are out of the scope of this document. 2953 The Group Manager must verify that the joining endpoint is authorized 2954 to join the group. To this end, the Group Manager can directly 2955 authorize the joining endpoint, or expect it to provide authorization 2956 evidence previously obtained from a trusted entity. Further details 2957 about the authorization of joining endpoints are out of scope. 2959 In case of successful authorization check, the Group Manager 2960 generates a Sender ID assigned to the joining endpoint, before 2961 proceeding with the rest of the join process. That is, the Group 2962 Manager provides the joining endpoint with the keying material and 2963 parameters to initialize the Security Context (see Section 2). The 2964 actual provisioning of keying material and parameters to the joining 2965 endpoint is out of the scope of this document. 2967 It is RECOMMENDED that the join process adopts the approach described 2968 in [I-D.ietf-ace-key-groupcomm-oscore] and based on the ACE framework 2969 for Authentication and Authorization in constrained environments 2970 [I-D.ietf-ace-oauth-authz]. 2972 Appendix E. Challenge-Response Synchronization 2974 This section describes a possible approach that a server endpoint can 2975 use to synchronize with Sender Sequence Numbers of client endpoints 2976 in the group. In particular, the server performs a challenge- 2977 response exchange with a client, by using the Echo Option for CoAP 2978 described in Section 2 of [I-D.ietf-core-echo-request-tag] and 2979 according to Appendix B.1.2 of [RFC8613]. 2981 That is, upon receiving a request from a particular client for the 2982 first time, the server processes the message as described in this 2983 specification, but, even if valid, does not deliver it to the 2984 application. Instead, the server replies to the client with an 2985 OSCORE protected 4.01 (Unauthorized) response message, including only 2986 the Echo Option and no diagnostic payload. The Echo option value 2987 SHOULD NOT be reused; when it is reused, it MUST be highly unlikely 2988 to have been used with this client recently. Since this response is 2989 protected with the Security Context used in the group, the client 2990 will consider the response valid upon successfully decrypting and 2991 verifying it. 2993 The server stores the Echo Option value included therein, together 2994 with the pair (gid,kid), where 'gid' is the Group Identifier of the 2995 OSCORE group and 'kid' is the Sender ID of the client in the group, 2996 as specified in the 'kid context' and 'kid' fields of the OSCORE 2997 Option of the request, respectively. After a group rekeying has been 2998 completed and a new Security Context has been established in the 2999 group, which results also in a new Group Identifier (see 3000 Section 3.1), the server MUST delete all the stored Echo values 3001 associated to members of that group. 3003 Upon receiving a 4.01 (Unauthorized) response that includes an Echo 3004 Option and originates from a verified group member, the client sends 3005 a request as a unicast message addressed to the same server, echoing 3006 the Echo Option value. The client MUST NOT send the request 3007 including the Echo Option over multicast. 3009 If the signature algorithm used in the group supports ECDH (e.g. 3010 ECDSA, EdDSA), the client MUST use the pairwise mode of Group OSCORE 3011 to protect the request, as described in Section 9.3. Note that, as 3012 defined in Section 9, members of such a group and that use the Echo 3013 Option MUST support the pairwise mode. 3015 The client does not necessarily resend the same group request, but 3016 can instead send a more recent one, if the application permits it. 3017 This makes it possible for the client to not retain previously sent 3018 group requests for full retransmission, unless the application 3019 explicitly requires otherwise. In either case, the client uses a 3020 fresh Sender Sequence Number value from its own Sender Context. If 3021 the client stores group requests for possible retransmission with the 3022 Echo Option, it should not store a given request for longer than a 3023 preconfigured time interval. Note that the unicast request echoing 3024 the Echo Option is correctly treated and processed as a message, 3025 since the 'kid context' field including the Group Identifier of the 3026 OSCORE group is still present in the OSCORE Option as part of the 3027 COSE object (see Section 4). 3029 Upon receiving the unicast request including the Echo Option, the 3030 server performs the following verifications. 3032 o If the server does not store an Echo Option value for the pair 3033 (gid,kid), it considers: i) the time t1 when it has established 3034 the Security Context used to protect the received request; and ii) 3035 the time t2 when the request has been received. Since a valid 3036 request cannot be older than the Security Context used to protect 3037 it, the server verifies that (t2 - t1) is less than the largest 3038 amount of time acceptable to consider the request fresh. 3040 o If the server stores an Echo Option value for the pair (gid,kid) 3041 associated to that same client in the same group, the server 3042 verifies that the option value equals that same stored value 3043 previously sent to that client. 3045 If the verifications above fail, the server MUST NOT process the 3046 request further and MAY send a 4.01 (Unauthorized) response including 3047 an Echo Option. 3049 If the verifications above are successful and the Replay Window has 3050 not been set yet, the server updates its Replay Window to mark the 3051 current Sender Sequence Number from the latest received request as 3052 seen (but all newer ones as new), and delivers the message as fresh 3053 to the application. Otherwise, it discards the verification result 3054 and treats the message as fresh or as a replay, according to the 3055 existing Replay Window. 3057 A server should not deliver requests from a given client to the 3058 application until one valid request from that same client has been 3059 verified as fresh, as conveying an echoed Echo Option 3060 [I-D.ietf-core-echo-request-tag]. Also, a server may perform the 3061 challenge-response described above at any time, if synchronization 3062 with Sender Sequence Numbers of clients is lost, for instance after a 3063 device reboot. A client has to be always ready to perform the 3064 challenge-response based on the Echo Option in case a server starts 3065 it. 3067 It is the role of the server application to define under what 3068 circumstances Sender Sequence Numbers lose synchronization. This can 3069 include experiencing a "large enough" gap D = (SN2 - SN1), between 3070 the Sender Sequence Number SN1 of the latest accepted group request 3071 from a client and the Sender Sequence Number SN2 of a group request 3072 just received from that client. However, a client may send several 3073 unicast requests to different group members as protected with the 3074 pairwise mode (see Section 9.3), which may result in the server 3075 experiencing the gap D in a relatively short time. This would induce 3076 the server to perform more challenge-response exchanges than actually 3077 needed. 3079 To ameliorate this, the server may rather rely on a trade-off between 3080 the Sender Sequence Number gap D and a time gap T = (t2 - t1), where 3081 t1 is the time when the latest group request from a client was 3082 accepted and t2 is the time when the latest group request from that 3083 client has been received, respectively. Then, the server can start a 3084 challenge-response when experiencing a time gap T larger than a 3085 given, preconfigured threshold. Also, the server can start a 3086 challenge-response when experiencing a Sender Sequence Number gap D 3087 greater than a different threshold, computed as a monotonically 3088 increasing function of the currently experienced time gap T. 3090 The challenge-response approach described in this appendix provides 3091 an assurance of absolute message freshness. However, it can result 3092 in an impact on performance which is undesirable or unbearable, 3093 especially in large groups where many endpoints at the same time 3094 might join as new members or lose synchronization. 3096 Note that endpoints configured as silent servers are not able to 3097 perform the challenge-response described above, as they do not store 3098 a Sender Context to secure the 4.01 (Unauthorized) response to the 3099 client. Therefore, silent servers should adopt alternative 3100 approaches to achieve and maintain synchronization with sender 3101 sequence numbers of clients. 3103 Since requests including the Echo Option are sent over unicast, a 3104 server can be a victim of the attack discussed in Section 10.7, when 3105 such requests are protected with the group mode of Group OSCORE, as 3106 described in Section 8.1. 3108 Instead, protecting requests with the Echo Option by using the 3109 pairwise mode of Group OSCORE as described in Section 9.3 prevents 3110 the attack in Section 10.7. In fact, only the exact server involved 3111 in the Echo exchange is able to derive the correct pairwise key used 3112 by the client to protect the request including the Echo Option. 3114 In either case, an internal on-path adversary would not be able to 3115 mix up the Echo Option value of two different unicast requests, sent 3116 by a same client to any two different servers in the group. In fact, 3117 if the group mode was used, this would require the adversary to forge 3118 the client's countersignature in both such requests. As a 3119 consequence, each of the two servers remains able to selectively 3120 accept a request with the Echo Option only if it is waiting for that 3121 exact integrity-protected Echo Option value, and is thus the intended 3122 recipient. 3124 Appendix F. No Verification of Signatures in Group Mode 3126 There are some application scenarios using group communication that 3127 have particularly strict requirements. One example of this is the 3128 requirement of low message latency in non-emergency lighting 3129 applications [I-D.somaraju-ace-multicast]. For those applications 3130 which have tight performance constraints and relaxed security 3131 requirements, it can be inconvenient for some endpoints to verify 3132 digital signatures in order to assert source authenticity of received 3133 messages protected with the group mode. In other cases, the 3134 signature verification can be deferred or only checked for specific 3135 actions. For instance, a command to turn a bulb on where the bulb is 3136 already on does not need the signature to be checked. In such 3137 situations, the counter signature needs to be included anyway as part 3138 of a message protected with the group mode, so that an endpoint that 3139 needs to validate the signature for any reason has the ability to do 3140 so. 3142 In this specification, it is NOT RECOMMENDED that endpoints do not 3143 verify the counter signature of received messages protected with the 3144 group mode. However, it is recognized that there may be situations 3145 where it is not always required. The consequence of not doing the 3146 signature validation in messages protected with the group mode is 3147 that security in the group is based only on the group-authenticity of 3148 the shared keying material used for encryption. That is, endpoints 3149 in the group would have evidence that the received message has been 3150 originated by a group member, although not specifically identifiable 3151 in a secure way. This can violate a number of security requirements, 3152 as the compromise of any element in the group means that the attacker 3153 has the ability to control the entire group. Even worse, the group 3154 may not be limited in scope, and hence the same keying material might 3155 be used not only for light bulbs but for locks as well. Therefore, 3156 extreme care must be taken in situations where the security 3157 requirements are relaxed, so that deployment of the system will 3158 always be done safely. 3160 Appendix G. Example Values with COSE Capabilities 3162 The table below provides examples of values for Counter Signature 3163 Parameters in the Common Context (see Section 2.1.3), for different 3164 values of Counter Signature Algorithm. 3166 +-------------------+---------------------------------------------+ 3167 | Counter Signature | Example Values for Counter | 3168 | Algorithm | Signature Parameters | 3169 +-------------------+---------------------------------------------+ 3170 | (-8) // EdDSA | [1], [1, 6] // 1: OKP ; 1: OKP, 6: Ed25519 | 3171 | (-8) // EdDSA | [1], [1, 7] // 1: OKP ; 1: OKP, 7: Ed448 | 3172 | (-7) // ES256 | [2], [2, 1] // 2: EC2 ; 2: EC2, 1: P-256 | 3173 | (-35) // ES384 | [2], [2, 2] // 2: EC2 ; 2: EC2, 2: P-384 | 3174 | (-36) // ES512 | [2], [2, 3] // 2: EC2 ; 2: EC2, 3: P-521 | 3175 | (-37) // PS256 | [3], [3] // 3: RSA ; 3: RSA | 3176 | (-38) // PS384 | [3], [3] // 3: RSA ; 3: RSA | 3177 | (-39) // PS512 | [3], [3] // 3: RSA ; 3: RSA | 3178 +-------------------+---------------------------------------------+ 3180 Figure 4: Examples of Counter Signature Parameters 3182 The table below provides examples of values for Secret Derivation 3183 Parameters in the Common Context (see Section 2.1.5), for different 3184 values of Secret Derivation Algorithm. 3186 +-----------------------+--------------------------------------------+ 3187 | Secret Derivation | Example Values for Secret | 3188 | Algorithm | Derivation Parameters | 3189 +-----------------------+--------------------------------------------+ 3190 | (-27) // ECDH-SS | [1], [1, 4] // 1: OKP ; 1: OKP, 4: X25519 | 3191 | // + HKDF-256 | | 3192 | (-27) // ECDH-SS | [1], [1, 5] // 1: OKP ; 1: OKP, 5: X448 | 3193 | // + HKDF-256 | | 3194 | (-27) // ECDH-SS | [2], [2, 1] // 2: EC2 ; 2: EC2, 1: P-256 | 3195 | // + HKDF-256 | | 3196 | (-27) // ECDH-SS | [2], [2, 2] // 2: EC2 ; 2: EC2, 2: P-384 | 3197 | // + HKDF-256 | | 3198 | (-27) // ECDH-SS | [2], [2, 3] // 2: EC2 ; 2: EC2, 3: P-512 | 3199 | // + HKDF-256 | | 3200 +-----------------------+--------------------------------------------+ 3202 Figure 5: Examples of Secret Derivation Parameters 3204 Appendix H. Parameter Extensibility for Future COSE Algorithms 3206 As defined in Section 8.1 of [I-D.ietf-cose-rfc8152bis-algs], future 3207 algorithms can be registered in the "COSE Algorithms" Registry 3208 [COSE.Algorithms] as specifying none or multiple COSE capabilities. 3210 To enable the seamless use of such future registered algorithms, this 3211 section defines a general, agile format for parameters of the 3212 Security Context (see Section 2.1.3 and Section 2.1.5) and for 3213 related elements of the external_aad structure (see Section 4.3). 3215 If any of the currently registered COSE algorithms is considered, 3216 using this general format yields the same structure defined in this 3217 document for the items above, thus ensuring retro-compatibility. 3219 H.1. Counter Signature Parameters 3221 The definition of Counter Signature Parameters in the Common Context 3222 (see Section 2.1.3) is generalized as follows. 3224 Counter Signature Parameters is a CBOR array CS_PARAMS including N+1 3225 elements, whose exact structure and value depend on the value of 3226 Counter Signature Algorithm. 3228 o The first element, i.e. CS_PARAMS[0], is the array of the N COSE 3229 capabilities for Counter Signature Algorithm, as specified for 3230 that algorithm in the "Capabilities" column of the "COSE 3231 Algorithms" Registry [COSE.Algorithms] (see Section 8.1 of 3232 [I-D.ietf-cose-rfc8152bis-algs]). 3234 o Each following element CS_PARAMS[i], i.e. with index i > 0, is the 3235 array of COSE capabilities for the algorithm capability specified 3236 in CS_PARAMS[0][i-1]. 3238 For example, if CS_PARAMS[0][0] specifies the key type as 3239 capability of the algorithm, then CS_PARAMS[1] is the array of 3240 COSE capabilities for the COSE key type associated to Counter 3241 Signature Algorithm, as specified for that key type in the 3242 "Capabilities" column of the "COSE Key Types" Registry 3243 [COSE.Key.Types] (see Section 8.2 of 3244 [I-D.ietf-cose-rfc8152bis-algs]). 3246 H.2. Secret Derivation Parameters 3248 The definition of Secret Derivation Parameters in the Common Context 3249 (see Section 2.1.5) is generalized as follows. 3251 Secret Derivation Parameters is a CBOR array SD_PARAMS including N+1 3252 elements, whose exact structure and value depend on the value of 3253 Secret Derivation Algorithm. 3255 o The first element, i.e. SD_PARAMS[0], is the array of the N COSE 3256 capabilities for Secret Derivation Algorithm, as specified for 3257 that algorithm in the "Capabilities" column of the "COSE 3258 Algorithms" Registry [COSE.Algorithms] (see Section 8.1 of 3259 [I-D.ietf-cose-rfc8152bis-algs]). 3261 o Each following element SD_PARAMS[i], i.e. with index i > 0, is the 3262 array of COSE capabilities for the algorithm capability specified 3263 in SD_PARAMS[0][i-1]. 3265 For example, if SD_PARAMS[0][0] specifies the key type as 3266 capability of the algorithm, then SD_PARAMS[1] is the array of 3267 COSE capabilities for the COSE key type associated to Secret 3268 Derivation Algorithm, as specified for that key type in the 3269 "Capabilities" column of the "COSE Key Types" Registry 3270 [COSE.Key.Types] (see Section 8.2 of 3271 [I-D.ietf-cose-rfc8152bis-algs]). 3273 H.3. 'par_countersign' in the external_aad 3275 The definition of the 'par_countersign' element in the 'algorithms' 3276 array of the external_aad structure (see Section 4.3) is generalized 3277 as follows. 3279 The 'par_countersign' element takes the CBOR array CS_PARAMS 3280 specified by Counter Signature Parameters in the Common Context (see 3281 Section 2.1.3), considering the format generalization in Appendix H. 3282 In particular: 3284 o The first element 'countersign_alg_capab' is the array of COSE 3285 capabilities for the countersignature algorithm indicated in 3286 'alg_countersign'. This is CS_PARAMS[0], i.e. the first element 3287 of the CBOR array CS_PARAMS specified by Counter Signature 3288 Parameters in the Common Context. 3290 o Each following element 'countersign_capab_i' (i = 1, ..., N) is 3291 the array of COSE capabilities for the algorithm capability 3292 specified in 'countersign_alg_capab'[i-1]. This algorithm 3293 capability is the element CS_PARAMS[0][i-1] of the CBOR array 3294 CS_PARAMS specified by Counter Signature Parameters in the Common 3295 Context. 3297 For example, if 'countersign_alg_capab'[i-1] specifies the key 3298 type as capability of the algorithm, then 'countersign_capab_i' is 3299 the array of COSE capabilities for the COSE key type associated to 3300 Counter Signature Algorithm, as specified for that key type in the 3301 "Capabilities" column of the "COSE Key Types" Registry 3302 [COSE.Key.Types] (see Section 8.2 of 3303 [I-D.ietf-cose-rfc8152bis-algs]). 3305 external_aad = bstr .cbor aad_array 3307 aad_array = [ 3308 oscore_version : uint, 3309 algorithms : [alg_aead : int / tstr, 3310 alg_countersign : int / tstr, 3311 par_countersign : [countersign_alg_capab, 3312 countersign_capab_1, 3313 countersign_capab_2, 3314 ..., 3315 countersign__capab_N]], 3316 request_kid : bstr, 3317 request_piv : bstr, 3318 options : bstr, 3319 request_kid_context : bstr, 3320 OSCORE_option: bstr 3321 ] 3323 countersign_alg_capab : [c_1 : any, c_2 : any, ..., c_N : any] 3325 Figure 6: external_aad with general 'par_countersign' 3327 Appendix I. Document Updates 3329 RFC EDITOR: PLEASE REMOVE THIS SECTION. 3331 I.1. Version -10 to -11 3333 o Loss of Recipient Contexts due to their overflow. 3335 o Added diagram on keying material components and their relation. 3337 o Distinction between anti-replay and freshness. 3339 o Preservation of Sender IDs over rekeying. 3341 o Clearer cause-effect about reset of SSN. 3343 o The GM provides public keys of group members with associated 3344 Sender IDs. 3346 o Removed 'par_countersign_key' from the external_aad. 3348 o One single format for the external_aad, both for encryption and 3349 signing. 3351 o Presence of 'kid' in responses to requests protected with the 3352 pairwise mode. 3354 o Inclusion of 'kid_context' in notifications following a group 3355 rekeying. 3357 o Pairwise mode presented with OSCORE as baseline. 3359 o Revised examples with signature values. 3361 o Decoupled growth of clients' Sender Sequence Numbers and loss of 3362 synchronization for server. 3364 o Sender IDs not recycled in the group under the same Gid. 3366 o Processing and description of the Group Flag bit in the OSCORE 3367 option. 3369 o Usage of the pairwise mode for multicast requests. 3371 o Clarifications on synchronization using the Echo option. 3373 o General format of context parameters and external_aad elements, 3374 supporting future registered COSE algorithms (new Appendix). 3376 o Fixes and editorial improvements. 3378 I.2. Version -09 to -10 3380 o Removed 'Counter Signature Key Parameters' from the Common 3381 Context. 3383 o New parameters in the Common Context covering the DH secret 3384 derivation. 3386 o New counter signature header parameter from draft-ietf-cose- 3387 countersign. 3389 o Stronger policies non non-recycling of Sender IDs and Gid. 3391 o The Sender Sequence Number is reset when establishing a new 3392 Security Context. 3394 o Added 'request_kid_context' in the aad_array. 3396 o The server can respond with 5.03 if the client's public key is not 3397 available. 3399 o The observer client stores an invariant identifier of the group. 3401 o Relaxed storing of original 'kid' for observer clients. 3403 o Both client and server store the 'kid_context' of the original 3404 observation request. 3406 o The server uses a fresh PIV if protecting the response with a 3407 Security Context different from the one used to protect the 3408 request. 3410 o Clarifications on MTI algorithms and curves. 3412 o Removed optimized requests. 3414 o Overall clarifications and editorial revision. 3416 I.3. Version -08 to -09 3418 o Pairwise keys are discarded after group rekeying. 3420 o Signature mode renamed to group mode. 3422 o The parameters for countersignatures use the updated COSE 3423 registries. Newly defined IANA registries have been removed. 3425 o Pairwise Flag bit renamed as Group Flag bit, set to 1 in group 3426 mode and set to 0 in pairwise mode. 3428 o Dedicated section on updating the Security Context. 3430 o By default, sender sequence numbers and replay windows are not 3431 reset upon group rekeying. 3433 o An endpoint implementing only a silent server does not support the 3434 pairwise mode. 3436 o Separate section on general message reception. 3438 o Pairwise mode moved to the document body. 3440 o Considerations on using the pairwise mode in non-multicast 3441 settings. 3443 o Optimized requests are moved as an appendix. 3445 o Normative support for the signature and pairwise mode. 3447 o Revised methods for synchronization with clients' sender sequence 3448 number. 3450 o Appendix with example values of parameters for countersignatures. 3452 o Clarifications and editorial improvements. 3454 I.4. Version -07 to -08 3456 o Clarified relation between pairwise mode and group communication 3457 (Section 1). 3459 o Improved definition of "silent server" (Section 1.1). 3461 o Clarified when a Recipient Context is needed (Section 2). 3463 o Signature checkers as entities supported by the Group Manager 3464 (Section 2.3). 3466 o Clarified that the Group Manager is under exclusive control of Gid 3467 and Sender ID values in a group, with Sender ID values under each 3468 Gid value (Section 2.3). 3470 o Mitigation policies in case of recycled 'kid' values 3471 (Section 2.4). 3473 o More generic exhaustion (not necessarily wrap-around) of sender 3474 sequence numbers (Sections 2.5 and 10.11). 3476 o Pairwise key considerations, as to group rekeying and Sender 3477 Sequence Numbers (Section 3). 3479 o Added reference to static-static Diffie-Hellman shared secret 3480 (Section 3). 3482 o Note for implementation about the external_aad for signing 3483 (Sectino 4.3.2). 3485 o Retransmission by the application for group requests over 3486 multicast as Non-Confirmable (Section 7). 3488 o A server MUST use its own Partial IV in a response, if protecting 3489 it with a different context than the one used for the request 3490 (Section 7.3). 3492 o Security considerations: encryption of pairwise mode as 3493 alternative to group-level security (Section 10.1). 3495 o Security considerations: added approach to reduce the chance of 3496 global collisions of Gid values from different Group Managers 3497 (Section 10.5). 3499 o Security considerations: added implications for block-wise 3500 transfers when using the signature mode for requests over unicast 3501 (Section 10.7). 3503 o Security considerations: (multiple) supported signature algorithms 3504 (Section 10.13). 3506 o Security considerations: added privacy considerations on the 3507 approach for reducing global collisions of Gid values 3508 (Section 10.15). 3510 o Updates to the methods for synchronizing with clients' sequence 3511 number (Appendix E). 3513 o Simplified text on discovery services supporting the pairwise mode 3514 (Appendix G.1). 3516 o Editorial improvements. 3518 I.5. Version -06 to -07 3520 o Updated abstract and introduction. 3522 o Clarifications of what pertains a group rekeying. 3524 o Derivation of pairwise keying material. 3526 o Content re-organization for COSE Object and OSCORE header 3527 compression. 3529 o Defined the Pairwise Flag bit for the OSCORE option. 3531 o Supporting CoAP Observe for group requests and responses. 3533 o Considerations on message protection across switching to new 3534 keying material. 3536 o New optimized mode based on pairwise keying material. 3538 o More considerations on replay protection and Security Contexts 3539 upon key renewal. 3541 o Security considerations on Group OSCORE for unicast requests, also 3542 as affecting the usage of the Echo option. 3544 o Clarification on different types of groups considered 3545 (application/security/CoAP). 3547 o New pairwise mode, using pairwise keying material for both 3548 requests and responses. 3550 I.6. Version -05 to -06 3552 o Group IDs mandated to be unique under the same Group Manager. 3554 o Clarifications on parameter update upon group rekeying. 3556 o Updated external_aad structures. 3558 o Dynamic derivation of Recipient Contexts made optional and 3559 application specific. 3561 o Optional 4.00 response for failed signature verification on the 3562 server. 3564 o Removed client handling of duplicated responses to multicast 3565 requests. 3567 o Additional considerations on public key retrieval and group 3568 rekeying. 3570 o Added Group Manager responsibility on validating public keys. 3572 o Updates IANA registries. 3574 o Reference to RFC 8613. 3576 o Editorial improvements. 3578 I.7. Version -04 to -05 3580 o Added references to draft-dijk-core-groupcomm-bis. 3582 o New parameter Counter Signature Key Parameters (Section 2). 3584 o Clarification about Recipient Contexts (Section 2). 3586 o Two different external_aad for encrypting and signing 3587 (Section 3.1). 3589 o Updated response verification to handle Observe notifications 3590 (Section 6.4). 3592 o Extended Security Considerations (Section 8). 3594 o New "Counter Signature Key Parameters" IANA Registry 3595 (Section 9.2). 3597 I.8. Version -03 to -04 3599 o Added the new "Counter Signature Parameters" in the Common Context 3600 (see Section 2). 3602 o Added recommendation on using "deterministic ECDSA" if ECDSA is 3603 used as counter signature algorithm (see Section 2). 3605 o Clarified possible asynchronous retrieval of keying material from 3606 the Group Manager, in order to process incoming messages (see 3607 Section 2). 3609 o Structured Section 3 into subsections. 3611 o Added the new 'par_countersign' to the aad_array of the 3612 external_aad (see Section 3.1). 3614 o Clarified non reliability of 'kid' as identity indicator for a 3615 group member (see Section 2.1). 3617 o Described possible provisioning of new Sender ID in case of 3618 Partial IV wrap-around (see Section 2.2). 3620 o The former signature bit in the Flag Byte of the OSCORE option 3621 value is reverted to reserved (see Section 4.1). 3623 o Updated examples of compressed COSE object, now with the sixth 3624 less significant bit in the Flag Byte of the OSCORE option value 3625 set to 0 (see Section 4.3). 3627 o Relaxed statements on sending error messages (see Section 6). 3629 o Added explicit step on computing the counter signature for 3630 outgoing messages (see Sections 6.1 and 6.3). 3632 o Handling of just created Recipient Contexts in case of 3633 unsuccessful message verification (see Sections 6.2 and 6.4). 3635 o Handling of replied/repeated responses on the client (see 3636 Section 6.4). 3638 o New IANA Registry "Counter Signature Parameters" (see 3639 Section 9.1). 3641 I.9. Version -02 to -03 3643 o Revised structure and phrasing for improved readability and better 3644 alignment with draft-ietf-core-object-security. 3646 o Added discussion on wrap-Around of Partial IVs (see Section 2.2). 3648 o Separate sections for the COSE Object (Section 3) and the OSCORE 3649 Header Compression (Section 4). 3651 o The countersignature is now appended to the encrypted payload of 3652 the OSCORE message, rather than included in the OSCORE Option (see 3653 Section 4). 3655 o Extended scope of Section 5, now titled " Message Binding, 3656 Sequence Numbers, Freshness and Replay Protection". 3658 o Clarifications about Non-Confirmable messages in Section 5.1 3659 "Synchronization of Sender Sequence Numbers". 3661 o Clarifications about error handling in Section 6 "Message 3662 Processing". 3664 o Compacted list of responsibilities of the Group Manager in 3665 Section 7. 3667 o Revised and extended security considerations in Section 8. 3669 o Added IANA considerations for the OSCORE Flag Bits Registry in 3670 Section 9. 3672 o Revised Appendix D, now giving a short high-level description of a 3673 new endpoint set-up. 3675 I.10. Version -01 to -02 3677 o Terminology has been made more aligned with RFC7252 and draft- 3678 ietf-core-object-security: i) "client" and "server" replace the 3679 old "multicaster" and "listener", respectively; ii) "silent 3680 server" replaces the old "pure listener". 3682 o Section 2 has been updated to have the Group Identifier stored in 3683 the 'ID Context' parameter defined in draft-ietf-core-object- 3684 security. 3686 o Section 3 has been updated with the new format of the Additional 3687 Authenticated Data. 3689 o Major rewriting of Section 4 to better highlight the differences 3690 with the message processing in draft-ietf-core-object-security. 3692 o Added Sections 7.2 and 7.3 discussing security considerations 3693 about uniqueness of (key, nonce) and collision of group 3694 identifiers, respectively. 3696 o Minor updates to Appendix A.1 about assumptions on multicast 3697 communication topology and group size. 3699 o Updated Appendix C on format of group identifiers, with practical 3700 implications of possible collisions of group identifiers. 3702 o Updated Appendix D.2, adding a pointer to draft-palombini-ace-key- 3703 groupcomm about retrieval of nodes' public keys through the Group 3704 Manager. 3706 o Minor updates to Appendix E.3 about Challenge-Response 3707 synchronization of sequence numbers based on the Echo option from 3708 draft-ietf-core-echo-request-tag. 3710 I.11. Version -00 to -01 3712 o Section 1.1 has been updated with the definition of group as 3713 "security group". 3715 o Section 2 has been updated with: 3717 * Clarifications on establishment/derivation of Security 3718 Contexts. 3720 * A table summarizing the the additional context elements 3721 compared to OSCORE. 3723 o Section 3 has been updated with: 3725 * Examples of request and response messages. 3727 * Use of CounterSignature0 rather than CounterSignature. 3729 * Additional Authenticated Data including also the signature 3730 algorithm, while not including the Group Identifier any longer. 3732 o Added Section 6, listing the responsibilities of the Group 3733 Manager. 3735 o Added Appendix A (former section), including assumptions and 3736 security objectives. 3738 o Appendix B has been updated with more details on the use cases. 3740 o Added Appendix C, providing an example of Group Identifier format. 3742 o Appendix D has been updated to be aligned with draft-palombini- 3743 ace-key-groupcomm. 3745 Acknowledgments 3747 The authors sincerely thank Christian Amsuess, Stefan Beck, Rolf 3748 Blom, Carsten Bormann, Esko Dijk, Klaus Hartke, Rikard Hoeglund, 3749 Richard Kelsey, Dave Robin, Jim Schaad, Ludwig Seitz, Peter van der 3750 Stok and Erik Thormarker for their feedback and comments. 3752 The work on this document has been partly supported by VINNOVA and 3753 the Celtic-Next project CRITISEC; the H2020 project SIFIS-Home (Grant 3754 agreement 952652); the SSF project SEC4Factory under the grant 3755 RIT17-0032; and the EIT-Digital High Impact Initiative ACTIVE. 3757 Authors' Addresses 3759 Marco Tiloca 3760 RISE AB 3761 Isafjordsgatan 22 3762 Kista SE-16440 Stockholm 3763 Sweden 3765 Email: marco.tiloca@ri.se 3767 Goeran Selander 3768 Ericsson AB 3769 Torshamnsgatan 23 3770 Kista SE-16440 Stockholm 3771 Sweden 3773 Email: goran.selander@ericsson.com 3775 Francesca Palombini 3776 Ericsson AB 3777 Torshamnsgatan 23 3778 Kista SE-16440 Stockholm 3779 Sweden 3781 Email: francesca.palombini@ericsson.com 3783 John Preuss Mattsson 3784 Ericsson AB 3785 Torshamnsgatan 23 3786 Kista SE-16440 Stockholm 3787 Sweden 3789 Email: john.mattsson@ericsson.com 3791 Jiye Park 3792 Universitaet Duisburg-Essen 3793 Schuetzenbahn 70 3794 Essen 45127 3795 Germany 3797 Email: ji-ye.park@uni-due.de