idnits 2.17.1 draft-ietf-core-oscore-groupcomm-09.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 : ---------------------------------------------------------------------------- ** There are 7 instances of too long lines in the document, the longest one being 1 character in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 23, 2020) is 1403 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 2876 -- Looks like a reference, but probably isn't: '6' on line 2875 -- Looks like a reference, but probably isn't: '2' on line 2878 -- Looks like a reference, but probably isn't: '3' on line 2881 == Outdated reference: A later version (-11) exists of draft-ietf-core-groupcomm-bis-00 == Outdated reference: A later version (-12) exists of draft-ietf-cose-rfc8152bis-algs-09 ** Downref: Normative reference to an Informational draft: draft-ietf-cose-rfc8152bis-algs (ref. 'I-D.ietf-cose-rfc8152bis-algs') == Outdated reference: A later version (-15) exists of draft-ietf-cose-rfc8152bis-struct-10 -- 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-07 == Outdated reference: A later version (-16) exists of draft-ietf-ace-key-groupcomm-oscore-07 == Outdated reference: A later version (-46) exists of draft-ietf-ace-oauth-authz-34 == Outdated reference: A later version (-14) exists of draft-ietf-core-echo-request-tag-09 == Outdated reference: A later version (-23) exists of draft-ietf-lwig-curve-representations-10 == Outdated reference: A later version (-07) exists of draft-ietf-lwig-security-protocol-comparison-04 == Outdated reference: A later version (-04) exists of draft-mattsson-cfrg-det-sigs-with-noise-02 == Outdated reference: A later version (-05) exists of draft-tiloca-core-observe-multicast-notifications-02 -- Obsolete informational reference (is this intentional?): RFC 6347 (Obsoleted by RFC 9147) Summary: 4 errors (**), 0 flaws (~~), 12 warnings (==), 8 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: December 25, 2020 F. Palombini 6 Ericsson AB 7 J. Park 8 Universitaet Duisburg-Essen 9 June 23, 2020 11 Group OSCORE - Secure Group Communication for CoAP 12 draft-ietf-core-oscore-groupcomm-09 14 Abstract 16 This document defines Group Object Security for Constrained RESTful 17 Environments (Group OSCORE), providing end-to-end security of CoAP 18 messages exchanged between members of a group, e.g. sent over IP 19 multicast. In particular, the described approach defines how OSCORE 20 is used in a group communication setting to provide source 21 authentication for CoAP group requests, sent by a client to multiple 22 servers, and for protection of the corresponding CoAP responses. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on December 25, 2020. 41 Copyright Notice 43 Copyright (c) 2020 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 59 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 60 2. Security Context . . . . . . . . . . . . . . . . . . . . . . 7 61 2.1. Common Context . . . . . . . . . . . . . . . . . . . . . 8 62 2.1.1. ID Context . . . . . . . . . . . . . . . . . . . . . 8 63 2.1.2. Counter Signature Algorithm . . . . . . . . . . . . . 9 64 2.1.3. Counter Signature Parameters . . . . . . . . . . . . 9 65 2.1.4. Counter Signature Key Parameters . . . . . . . . . . 10 66 2.2. Sender Context and Recipient Context . . . . . . . . . . 10 67 2.3. Pairwise Keys . . . . . . . . . . . . . . . . . . . . . . 11 68 2.3.1. Derivation of Pairwise Keys . . . . . . . . . . . . . 11 69 2.3.2. Usage of Sequence Numbers . . . . . . . . . . . . . . 12 70 2.3.3. Security Context for Pairwise Mode . . . . . . . . . 12 71 2.4. Update of Security Context . . . . . . . . . . . . . . . 13 72 2.4.1. Loss of Mutable Security Context . . . . . . . . . . 13 73 2.4.2. Exhaustion of Sender Sequence Numbers . . . . . . . . 13 74 2.4.3. Retrieving New Security Context Parameters . . . . . 14 75 3. The Group Manager . . . . . . . . . . . . . . . . . . . . . . 15 76 3.1. Management of Group Keying Material . . . . . . . . . . . 16 77 3.2. Responsibilities of the Group Manager . . . . . . . . . . 17 78 4. The COSE Object . . . . . . . . . . . . . . . . . . . . . . . 18 79 4.1. Counter Signature . . . . . . . . . . . . . . . . . . . . 18 80 4.2. The 'kid' and 'kid context' parameters . . . . . . . . . 19 81 4.3. external_aad . . . . . . . . . . . . . . . . . . . . . . 19 82 4.3.1. external_aad for Encryption . . . . . . . . . . . . . 19 83 4.3.2. external_aad for Signing . . . . . . . . . . . . . . 20 84 5. OSCORE Header Compression . . . . . . . . . . . . . . . . . . 21 85 5.1. Examples of Compressed COSE Objects . . . . . . . . . . . 21 86 5.1.1. Examples in Group Mode . . . . . . . . . . . . . . . 22 87 5.1.2. Examples in Pairwise Mode . . . . . . . . . . . . . . 23 88 6. Message Binding, Sequence Numbers, Freshness and Replay 89 Protection . . . . . . . . . . . . . . . . . . . . . . . . . 24 90 6.1. Update of Replay Window . . . . . . . . . . . . . . . . . 24 91 7. Message Reception . . . . . . . . . . . . . . . . . . . . . . 24 92 8. Message Processing in Group Mode . . . . . . . . . . . . . . 25 93 8.1. Protecting the Request . . . . . . . . . . . . . . . . . 26 94 8.1.1. Supporting Observe . . . . . . . . . . . . . . . . . 26 95 8.2. Verifying the Request . . . . . . . . . . . . . . . . . . 26 96 8.2.1. Supporting Observe . . . . . . . . . . . . . . . . . 27 98 8.3. Protecting the Response . . . . . . . . . . . . . . . . . 28 99 8.3.1. Supporting Observe . . . . . . . . . . . . . . . . . 28 100 8.4. Verifying the Response . . . . . . . . . . . . . . . . . 29 101 8.4.1. Supporting Observe . . . . . . . . . . . . . . . . . 30 102 9. Message Processing in Pairwise Mode . . . . . . . . . . . . . 30 103 9.1. Pre-Conditions . . . . . . . . . . . . . . . . . . . . . 31 104 9.2. Protecting the Request . . . . . . . . . . . . . . . . . 31 105 9.3. Verifying the Request . . . . . . . . . . . . . . . . . . 32 106 9.4. Protecting the Response . . . . . . . . . . . . . . . . . 32 107 9.5. Verifying the Response . . . . . . . . . . . . . . . . . 33 108 10. Security Considerations . . . . . . . . . . . . . . . . . . . 33 109 10.1. Group-level Security . . . . . . . . . . . . . . . . . . 34 110 10.2. Uniqueness of (key, nonce) . . . . . . . . . . . . . . . 35 111 10.3. Management of Group Keying Material . . . . . . . . . . 35 112 10.4. Update of Security Context and Key Rotation . . . . . . 36 113 10.4.1. Late Update on the Sender . . . . . . . . . . . . . 36 114 10.4.2. Late Update on the Recipient . . . . . . . . . . . . 37 115 10.5. Collision of Group Identifiers . . . . . . . . . . . . . 37 116 10.6. Cross-group Message Injection . . . . . . . . . . . . . 38 117 10.6.1. Attack Description . . . . . . . . . . . . . . . . . 38 118 10.6.2. Attack Prevention in Group Mode . . . . . . . . . . 39 119 10.7. Group OSCORE for Unicast Requests . . . . . . . . . . . 40 120 10.8. End-to-end Protection . . . . . . . . . . . . . . . . . 41 121 10.9. Master Secret . . . . . . . . . . . . . . . . . . . . . 41 122 10.10. Replay Protection . . . . . . . . . . . . . . . . . . . 42 123 10.11. Client Aliveness . . . . . . . . . . . . . . . . . . . . 43 124 10.12. Cryptographic Considerations . . . . . . . . . . . . . . 43 125 10.13. Message Segmentation . . . . . . . . . . . . . . . . . . 44 126 10.14. Privacy Considerations . . . . . . . . . . . . . . . . . 44 127 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 45 128 11.1. OSCORE Flag Bits Registry . . . . . . . . . . . . . . . 45 129 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 45 130 12.1. Normative References . . . . . . . . . . . . . . . . . . 45 131 12.2. Informative References . . . . . . . . . . . . . . . . . 47 132 Appendix A. Assumptions and Security Objectives . . . . . . . . 49 133 A.1. Assumptions . . . . . . . . . . . . . . . . . . . . . . . 49 134 A.2. Security Objectives . . . . . . . . . . . . . . . . . . . 51 135 Appendix B. List of Use Cases . . . . . . . . . . . . . . . . . 52 136 Appendix C. Example of Group Identifier Format . . . . . . . . . 54 137 Appendix D. Set-up of New Endpoints . . . . . . . . . . . . . . 55 138 Appendix E. Examples of Synchronization Approaches . . . . . . . 56 139 E.1. Best-Effort Synchronization . . . . . . . . . . . . . . . 56 140 E.2. Baseline Synchronization . . . . . . . . . . . . . . . . 56 141 E.3. Challenge-Response Synchronization . . . . . . . . . . . 57 142 Appendix F. No Verification of Signatures in Group Mode . . . . 60 143 Appendix G. Optimized Request . . . . . . . . . . . . . . . . . 60 144 Appendix H. Example Values of Parameters for Countersignatures . 61 145 Appendix I. Document Updates . . . . . . . . . . . . . . . . . . 61 146 I.1. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 62 147 I.2. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 62 148 I.3. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 64 149 I.4. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 64 150 I.5. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 65 151 I.6. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 65 152 I.7. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 66 153 I.8. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 67 154 I.9. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 68 155 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 69 156 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 69 158 1. Introduction 160 The Constrained Application Protocol (CoAP) [RFC7252] is a web 161 transfer protocol specifically designed for constrained devices and 162 networks [RFC7228]. Group communication for CoAP 163 [I-D.ietf-core-groupcomm-bis] addresses use cases where deployed 164 devices benefit from a group communication model, for example to 165 reduce latencies, improve performance and reduce bandwidth 166 utilization. Use cases include lighting control, integrated building 167 control, software and firmware updates, parameter and configuration 168 updates, commissioning of constrained networks, and emergency 169 multicast (see Appendix B). This specification defines the security 170 protocol for Group communication for CoAP 171 [I-D.ietf-core-groupcomm-bis]. 173 Object Security for Constrained RESTful Environments (OSCORE) 174 [RFC8613] describes a security protocol based on the exchange of 175 protected CoAP messages. OSCORE builds on CBOR Object Signing and 176 Encryption (COSE) 177 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and 178 provides end-to-end encryption, integrity, replay protection and 179 binding of response to request between a sender and a recipient, 180 independent of transport also in the presence of intermediaries. To 181 this end, a CoAP message is protected by including its payload (if 182 any), certain options, and header fields in a COSE object, which 183 replaces the authenticated and encrypted fields in the protected 184 message. 186 This document defines Group OSCORE, providing the same end-to-end 187 security properties as OSCORE in the case where CoAP requests have 188 multiple recipients. In particular, the described approach defines 189 how OSCORE is used in a group communication setting to provide source 190 authentication for CoAP group requests, sent by a client to multiple 191 servers, and for protection of the corresponding CoAP responses. 193 Just like OSCORE, Group OSCORE is independent of transport layer and 194 works wherever CoAP does. Group communication for CoAP 195 [I-D.ietf-core-groupcomm-bis] uses UDP/IP multicast as the underlying 196 data transport. 198 As with OSCORE, it is possible to combine Group OSCORE with 199 communication security on other layers. One example is the use of 200 transport layer security, such as DTLS [RFC6347], between one client 201 and one proxy (and vice versa), or between one proxy and one server 202 (and vice versa), in order to protect the routing information of 203 packets from observers. Note that DTLS [RFC6347] does not define how 204 to secure messages sent over IP multicast. 206 Group OSCORE defines two modes of operation: 208 o In the group mode, Group OSCORE requests and responses are 209 digitally signed with the private key of the sender and the 210 signature is embedded in the protected CoAP message. The group 211 mode supports all COSE algorithms as well as signature 212 verification by intermediaries. This mode is defined in Section 8 213 and MUST be supported. 215 o In the pairwise mode, two group members exchange Group OSCORE 216 requests and responses over unicast, and the messages are 217 protected with symmetric keys. These symmetric keys are derived 218 from Diffie-Hellman shared secrets, calculated with the asymmetric 219 keys of the sender and recipient, allowing for shorter integrity 220 tags and therefore lower message overhead. This mode is OPTIONAL 221 to support as defined in Section 9. 223 Both modes provide source authentication of CoAP messages. The 224 application decides what mode to use, potentially on a per-message 225 basis. Such decision can be based, for instance, on pre-configured 226 policies or dynamic assessing of the target recipient and/or 227 resource, among other things. One important case is when requests 228 are protected with the group mode, and responses with the pairwise 229 mode, since this significantly reduces the overhead in case of many 230 responses to one request. 232 A special deployment of Group OSCORE is to use pairwise mode only. 233 For example, consider the case of a constrained-node network 234 [RFC7228] with a large number of CoAP endpoints and the objective to 235 establish secure communication between any pair of endpoints with a 236 small provisioning effort and message overhead. Since the total 237 number of security associations that needs to be established grows 238 with the square of the number of nodes, it is desirable to restrict 239 the provisioned keying material. Moreover, a key establishment 240 protocol would need to be executed for each security association. 242 One solution to this is to deploy Group OSCORE with the endpoints 243 being part of a group and use the pairwise mode. This solution 244 assumes a trusted third party called Group Manager (see Section 3), 245 but has the benefit of restricting the symmetric keying material 246 while distributing only the public key of each group member. After 247 that, a CoAP endpoint can locally derive the OSCORE Security Context 248 for the other endpoint and protect the CoAP communication with very 249 low overhead [I-D.ietf-lwig-security-protocol-comparison]. 251 1.1. Terminology 253 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 254 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 255 "OPTIONAL" in this document are to be interpreted as described in BCP 256 14 [RFC2119] [RFC8174] when, and only when, they appear in all 257 capitals, as shown here. 259 Readers are expected to be familiar with the terms and concepts 260 described in CoAP [RFC7252] including "endpoint", "client", "server", 261 "sender" and "recipient"; group communication for CoAP 262 [I-D.ietf-core-groupcomm-bis]; COSE and counter signatures 263 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs]. 265 Readers are also expected to be familiar with the terms and concepts 266 for protection and processing of CoAP messages through OSCORE, such 267 as "Security Context" and "Master Secret", defined in [RFC8613]. 269 Terminology for constrained environments, such as "constrained 270 device" and "constrained-node network", is defined in [RFC7228]. 272 This document refers also to the following terminology. 274 o Keying material: data that is necessary to establish and maintain 275 secure communication among endpoints. This includes, for 276 instance, keys and IVs [RFC4949]. 278 o Group: a set of endpoints that share group keying material and 279 security parameters (Common Context, see Section 2). Unless 280 specified otherwise, the term group used in this specification 281 refers thus to a "security group" (see Section 2.1 of 282 [I-D.ietf-core-groupcomm-bis]), not to be confused with "CoAP 283 group" or "application group". 285 o Group Manager: entity responsible for a group. Each endpoint in a 286 group communicates securely with the respective Group Manager, 287 which is neither required to be an actual group member nor to take 288 part in the group communication. The full list of 289 responsibilities of the Group Manager is provided in Section 3.2. 291 o Silent server: member of a group that never sends protected 292 responses in reply to requests. For CoAP group communications, 293 requests are normally sent without necessarily expecting a 294 response. A silent server may send unprotected responses, as 295 error responses reporting an OSCORE error. Note that an endpoint 296 can implement both a silent server and a client, i.e. the two 297 roles are independent. An endpoint acting only as a silent server 298 performs only Group OSCORE processing on incoming requests. 299 Silent servers maintain less keying material and in particular do 300 not have a Sender Context for the group. Since silent servers do 301 not have a Sender ID they cannot support pairwise mode. 303 o Group Identifier (Gid): identifier assigned to the group, unique 304 within the set of groups of a given Group Manager. 306 o Group request: CoAP request message sent by a client in the group 307 to all servers in that group. 309 o Source authentication: evidence that a received message in the 310 group originated from a specific identified group member. This 311 also provides assurance that the message was not tampered with by 312 anyone, be it a different legitimate group member or an endpoint 313 which is not a group member. 315 2. Security Context 317 This specification refers to a group as a set of endpoints sharing 318 keying material and security parameters for executing the Group 319 OSCORE protocol (see Section 1.1). Each endpoint which is member of 320 a group maintains a Security Context as defined in Section 3 of 321 [RFC8613], extended as follows (see Figure 1): 323 o One Common Context, shared by all the endpoints in the group. 324 Three new parameters are included in the Common Context: Counter 325 Signature Algorithm, Counter Signature Parameters and Counter 326 Signature Key Parameters, which all relate to the signature of the 327 message included in group mode (see Section 8). 329 o One Sender Context, extended with the endpoint's private key. The 330 private key is used to sign the message in group mode, and for 331 calculating the pairwise keys in pairwise mode (see Section 2.3). 332 If the pairwise mode is supported, the Sender Context is also 333 extended with the Pairwise Sender Keys associated to the other 334 endpoints (see Section 2.3). The Sender Context is omitted if the 335 endpoint is configured exclusively as silent server. 337 o One Recipient Context for each endpoint from which messages are 338 received. It is not necessary to maintain Recipient Contexts 339 associated to endpoints from which messages are not (expected to 340 be) received. The Recipient Context is extended with the public 341 key of the associated endpoint, used to verify the signature in 342 group mode and for calculating the pairwise keys in pairwise mode 343 (see Section 2.3). If the pairwise mode is supported, then the 344 Recipient Context is also extended with the Pairwise Recipient Key 345 associated to the other endpoint (see Section 2.3). 347 +-------------------+-----------------------------------------------+ 348 | Context Component | New Information Elements | 349 +-------------------+-----------------------------------------------+ 350 | | Counter Signature Algorithm | 351 | Common Context | Counter Signature Parameters | 352 | | Counter Signature Key Parameters | 353 +-------------------+-----------------------------------------------+ 354 | Sender Context | Endpoint's own private key | 355 | | *Pairwise Sender Keys for the other endpoints | 356 +-------------------+-----------------------------------------------+ 357 | Each | Public key of the other endpoint | 358 | Recipient Context | *Pairwise Recipient Key of the other endpoint | 359 +-------------------+-----------------------------------------------+ 361 Figure 1: Additions to the OSCORE Security Context. Optional 362 additions are labeled with an asterisk. 364 Further details about the Security Context of Group OSCORE are 365 provided in the remainder of this section. How the Security Context 366 is established by the group members is out of scope for this 367 specification, but if there is more than one Security Context 368 applicable to a message, then the endpoints MUST be able to tell 369 which Security Context was latest established. 371 The default setting for how to manage information about the group is 372 described in terms of a Group Manager (see Section 3). 374 2.1. Common Context 376 The Common Context may be acquired from the Group Manager (see 377 Section 3). The following sections define how the Common Context is 378 extended, compared to [RFC8613]. 380 2.1.1. ID Context 382 The ID Context parameter (see Sections 3.3 and 5.1 of [RFC8613]) in 383 the Common Context SHALL contain the Group Identifier (Gid) of the 384 group. The choice of the Gid format is application specific. An 385 example of specific formatting of the Gid is given in Appendix C. 387 The application needs to specify how to handle potential collisions 388 between Gids (see Section 10.5). 390 2.1.2. Counter Signature Algorithm 392 Counter Signature Algorithm identifies the digital signature 393 algorithm used to compute a counter signature on the COSE object (see 394 Section 5.2 of [I-D.ietf-cose-rfc8152bis-struct]). 396 This parameter is immutable once the Common Context is established. 397 Counter Signature Algorithm MUST take value from the "Value" column 398 of the "COSE Algorithms" Registry [COSE.Algorithms]. The value is 399 associated to a COSE key type, specified in the "Capabilities" column 400 of the Registry. COSE capabilities for algorithms are defined in 401 Section 8 of [I-D.ietf-cose-rfc8152bis-algs]. 403 The EdDSA signature algorithm Ed25519 [RFC8032] is mandatory to 404 implement. For endpoints that support the pairwise mode of Group 405 OSCORE, the X25519 function [RFC7748] is also mandatory to implement. 406 If elliptic curve signatures are used, it is RECOMMENDED to implement 407 deterministic signatures with additional randomness as specified in 408 [I-D.mattsson-cfrg-det-sigs-with-noise]. 410 2.1.3. Counter Signature Parameters 412 Counter Signature Parameters identifies the parameters associated to 413 the digital signature algorithm specified in Counter Signature 414 Algorithm. This parameter is immutable once the Common Context is 415 established. 417 This parameter is a CBOR array including the following two elements, 418 whose exact structure and value depend on the value of Counter 419 Signature Algorithm: 421 o The first element is the array of COSE capabilities for Counter 422 Signature Algorithm, as specified for that algorithm in the 423 "Capabilities" column of the "COSE Algorithms" Registry 424 [COSE.Algorithms] (see Section 8.2 of 425 [I-D.ietf-cose-rfc8152bis-algs]). 427 o The second element is the array of COSE capabilities for the COSE 428 key type associated to Counter Signature Algorithm, as specified 429 for that key type in the "Capabilities" column of the "COSE Key 430 Types" Registry [COSE.Key.Types] (see Section 8.1 of 431 [I-D.ietf-cose-rfc8152bis-algs]). 433 Examples of Counter Signature Parameters are in Appendix H. 435 2.1.4. Counter Signature Key Parameters 437 Counter Signature Key Parameters identifies the parameters associated 438 to the keys used with the digital signature algorithm specified in 439 Counter Signature Algorithm. This parameter is immutable once the 440 Common Context is established. 442 The exact structure and value of this parameter depends on the value 443 of Counter Signature Algorithm. In particular, this parameter takes 444 the same structure and value of the array of COSE capabilities for 445 the COSE key type associated to Counter Signature Algorithm, as 446 specified for that key type in the "Capabilities" column of the "COSE 447 Key Types" Registry [COSE.Key.Types] (see Section 8.1 of 448 [I-D.ietf-cose-rfc8152bis-algs]). 450 Examples of Counter Signature Key Parameters are in Appendix H. 452 2.2. Sender Context and Recipient Context 454 OSCORE specifies the derivation of Sender Context and Recipient 455 Context, specifically of Sender/Recipient Keys and Common IV, from a 456 set of input parameters (see Section 3.2 of [RFC8613]). This 457 derivation applies also to Group OSCORE, and the mandatory-to- 458 implement HKDF and AEAD algorithms are the same as in [RFC8613]. The 459 Sender ID SHALL be unique for each endpoint in a group with a fixed 460 Master Secret, Master Salt and Group Identifier (see Section 3.3 of 461 [RFC8613]). 463 For Group OSCORE the Sender Context and Recipient Context 464 additionally contain asymmetric keys, as described previously in 465 Section 2. The private/public key pair of the sender can, for 466 example, be generated by the endpoint or provisioned during 467 manufacturing. 469 With the exception of the public key of the sending endpoint, a 470 receiving endpoint can derive a complete security context from a 471 received Group OSCORE message and the Common Context. The public 472 keys in the Recipient Contexts can be accessed from the Group Manager 473 (see Section 3) upon joining the group. A public key can 474 alternatively be acquired from the Group Manager at a later time, for 475 example the first time a message is received from a particular 476 endpoint in the group (see Section 8.2 and Section 8.4). 478 For severely constrained devices, it may be not feasible to 479 simultaneously handle the ongoing processing of a recently received 480 message in parallel with the retrieval of the associated endpoint's 481 public key. Such devices can be configured to drop a received 482 message for which there is no (complete) Recipient Context, and 483 retrieve the public key in order to have it available to verify 484 subsequent messages from that endpoint. 486 2.3. Pairwise Keys 488 Certain signature schemes, such as EdDSA and ECDSA, support a secure 489 combined signature and encryption scheme. This section specifies the 490 derivation of "pairwise keys", for use in the pairwise mode of Group 491 OSCORE defined in Section 9. 493 2.3.1. Derivation of Pairwise Keys 495 Using the Group OSCORE Security Context (see Section 2), a group 496 member can derive AEAD keys to protect point-to-point communication 497 between itself and any other endpoint in the group. The same AEAD 498 algorithm as in the group mode is used. The key derivation of these 499 so-called pairwise keys follows the same construction as in 500 Section 3.2.1 of [RFC8613]: 502 Pairwise Recipient Key = HKDF(Recipient Key, Shared Secret, info, L) 503 Pairwise Sender Key = HKDF(Sender Key, Shared Secret, info, L) 505 where: 507 o The Pairwise Recipient Key is the AEAD key for receiving from 508 endpoint X. 510 o The Pairwise Sender Key is the AEAD key for sending to endpoint X. 512 o The Shared Secret is computed as a static-static Diffie-Hellman 513 shared secret [NIST-800-56A], where the endpoint uses its private 514 key and the public key of the other endpoint X. 516 o The Recipient Key and the public key are from the Recipient 517 Context associated to endpoint X. 519 o The Sender Key and private key are from the Sender Context. 521 o info and L are defined as in Section 3.2.1 of [RFC8613]. 523 If EdDSA asymmetric keys are used, the Edward coordinates are mapped 524 to Montgomery coordinates using the maps defined in Sections 4.1 and 525 4.2 of [RFC7748], before using the X25519 and X448 functions defined 526 in Section 5 of [RFC7748]. 528 After establishing a partially or completely new Security Context 529 (see Section 3.1 and Section 2.4), the old pairwise keys MUST be 530 deleted. Since new Sender/Recipient Keys are derived from the new 531 group keying material (see Section 2.2), every group member MUST use 532 the new Sender/Recipient Keys when deriving new pairwise keys. 534 As long as any two group members preserve the same asymmetric keys, 535 their Diffie-Hellman shared secret does not change across updates of 536 the group keying material. 538 2.3.2. Usage of Sequence Numbers 540 When using any of its Pairwise Sender Keys, a sender endpoint 541 including the 'Partial IV' parameter in the protected message MUST 542 use the current fresh value of the Sender Sequence Number from its 543 Sender Context (see Section 2.2). That is, the same Sender Sequence 544 Number space is used for all outgoing messages protected with Group 545 OSCORE, thus limiting both storage and complexity. 547 On the other hand, when combining group and pairwise communication 548 modes, this may result in the Partial IV values moving forward more 549 often. This can happen when a client engages in frequent or long 550 sequences of one-to-one exchanges with servers in the group, by 551 sending requests over unicast. 553 As a consequence, replay checks may be invoked more often on the 554 recipient side, where larger replay windows should be considered. 556 2.3.3. Security Context for Pairwise Mode 558 If the pairwise mode is supported, the pairwise keys are added to the 559 Security Context, as described at the beginning of Section 2. 561 The pairwise keys as well as the shared secrets used in their 562 derivation (see Section 2.3.1) may be stored in memory or recomputed 563 each time they are needed. The shared secret changes only when a 564 public/private key pair used for its derivation changes, which 565 results in the pairwise keys also changing. Additionally, the 566 pairwise keys change if the Sender ID changes or if a new Security 567 Context is established for the group (see Section 2.4.3). In order 568 to optimize protocol performance, an endpoint may store the derived 569 pairwise keys for easy retrieval. 571 In the pairwise mode, the Sender Context includes the Pairwise Sender 572 Keys for the other endpoints (see Figure 1). In order to identify 573 the right key to use, the Pairwise Sender Key for endpoint X may be 574 associated to the Recipient ID of endpoint X, as defined in the 575 Recipient Context (i.e. the Sender ID from the point of view of 576 endpoint X). In this way, the Recipient ID can be used to lookup for 577 the right Pairwise Sender Key. This association may be implemented in 578 different ways, e.g. by storing the pair (Recipient ID, Pairwise 579 Sender Key), or linking a Pairwise Sender Key to a Recipient Context. 581 2.4. Update of Security Context 583 The mutable parts of the Security Context are updated by the endpoint 584 when executing the security protocol, but may nevertheless become 585 outdated, e.g. due to loss of the mutable Security Context (see 586 Section 2.4.1) or exhaustion of Sender Sequence Numbers (see 587 Section 2.4.2). The endpoint MUST be able to detect a loss of 588 mutable security context (see Section 2.4.1). If an endpoint detects 589 a loss of mutable Sender Security Context, it MUST NOT protect 590 further messages using this Security Context to avoid reusing a nonce 591 with the same AEAD key. 593 It is RECOMMENDED that the immutable part of the Security Context is 594 stored in non-volatile memory, or that it can otherwise be reliably 595 accessed throughout the operation of the group, e.g. after device 596 reboot. However, also immutable parts of the Security Context may 597 need to be updated, for example due to scheduled key renewal, new or 598 re-joining members in the group, or the fact that the endpoint 599 changes Sender ID (see Section 2.4.3). 601 2.4.1. Loss of Mutable Security Context 603 An endpoint losing its mutable Security Context, e.g., due to reboot, 604 needs to prevent the re-use of Sender Sequence Numbers, and to handle 605 incoming replayed messages. Appendix B.1 of [RFC8613] describes 606 secure procedures for handling the loss of Sender Sequence Number and 607 the update of Replay Window. The procedure in Appendix B.1.1 of 608 [RFC8613] applies also to servers in Group OSCORE and is RECOMMENDED 609 to use. A variant of Appendix B.1.2 of [RFC8613] applicable to Group 610 OSCORE is specified in Appendix E.3 of this specification. 612 If an endpoint is not able to establish an updated Sender Security 613 Context, e.g. because of lack of connectivity with the Group Manager, 614 it MUST NOT protect further messages using this Security Context. 615 The endpoint SHOULD inform the Group Manager and retrieve new 616 Security Context parameters from the Group Manager (see 617 Section 2.4.3). 619 2.4.2. Exhaustion of Sender Sequence Numbers 621 An endpoint can eventually exhaust the Sender Sequence Numbers, which 622 are incremented for each new outgoing message including a Partial IV. 623 This is the case for group requests, Observe notifications [RFC7641] 624 and, optionally, any other response. 626 If an implementation's integers support wrapping addition, when a 627 wrap-around is detected the implementation MUST treat Sender Sequence 628 Numbers as exhausted. 630 Upon exhausting the Sender Sequence Numbers, the endpoint MUST NOT 631 protect further messages using this Security Context. The endpoint 632 SHOULD inform the Group Manager and retrieve new Security Context 633 parameters from the Group Manager (see Section 2.4.3). 635 2.4.3. Retrieving New Security Context Parameters 637 The Group Manager can assist an endpoint with an incomplete Sender 638 Security Context to retrieve missing data of the Security Context and 639 thereby become fully operational in the group again. The two main 640 options are described in this section: i) assignment of a new Sender 641 ID (see Section 2.4.3.1); and ii) establishment of a new Security 642 Context for the group (see Section 2.4.3.2). Update of Replay Window 643 in Recipient Contexts is discussed in Section 6.1. 645 As group membership changes, or as group members get new Sender IDs 646 (see Section 2.4.3.1) so do the relevant Recipient IDs that the other 647 endpoints need to keep track of. As a consequence, group members may 648 end up retaining stale Recipient Contexts, that are no longer useful 649 to verify incoming secure messages. 651 The Recipient ID ('kid') SHOULD NOT be considered as a persistent and 652 reliable indicator of a group member. Such an indication can be 653 achieved only by using that member's public key, when verifying 654 countersignatures of received messages (in group mode), or when 655 verifying messages integrity-protected with pairwise keying material 656 derived from asymmetric keys (in pairwise mode). 658 Furthermore, applications MAY define policies to: i) delete 659 (long-)unused Recipient Contexts and reduce the impact on storage 660 space; as well as ii) check with the Group Manager that a public key 661 is currently the one associated to a 'kid' value, after a number of 662 consecutive failed verifications. 664 2.4.3.1. New Sender ID for the Endpoint 666 The Group Manager may assign the endpoint a new Sender ID, leaving 667 the Gid, Master Secret and Master Salt unchanged. In this case the 668 Group Manager MUST assign an unused Sender ID. Having retrieved the 669 new Sender ID, and potentially other missing data of the immutable 670 Security Context, the endpoint can derive a new Sender Context (see 671 Section 2.2). The Sender Sequence Number is initialized to 0. 673 The assignment of a new Sender ID may be the result of different 674 processes. The endpoint may request a new Sender ID, e.g. because of 675 exhaustion of Sender Sequence Numbers (see Section 2.4.2). An 676 endpoint may request to re-join the group, e.g. because of losing its 677 mutable Security Context (see Section 2.4.1), and receive as response 678 a new Sender ID together with the latest immutable Security Context. 680 The Recipient Context of the other group members corresponding to the 681 old Sender ID becomes stale (see Section 3.1). 683 2.4.3.2. New Security Context for the Group 685 The Group Manager may establish a new Security Context for the group 686 (see Section 3.1). The Group Manager does not necessarily establish 687 a new Security Context for the group if one member has an outdated 688 Security Context (see Section 2.4.3.1), unless that was already 689 planned or required for other reasons. All endpoints in the group 690 need to acquire new Security Context parameters from the Group 691 Manager. 693 Having acquired new Security Context parameters, each member can re- 694 derive the keying material stored in its Sender Context and Recipient 695 Contexts (see Section 2.2). The Master Salt used for the re- 696 derivations is the updated Master Salt parameter if provided by the 697 Group Manager, or the empty byte string otherwise. Unless otherwise 698 specified by the application, a group member does not reset the 699 Sender Sequence Number in its Sender Context, and does not reset the 700 Replay Windows in its Recipient Contexts. From then on, each group 701 member MUST use its latest installed Sender Context to protect 702 outgoing messages. 704 The distribution of a new Gid and Master Secret may result in 705 temporarily misaligned Security Contexts among group members. In 706 particular, this may result in a group member not being able to 707 process messages received right after a new Gid and Master Secret 708 have been distributed. A discussion on practical consequences and 709 possible ways to address them, as well as on how to handle the old 710 Security Context, is provided in Section 10.4. 712 3. The Group Manager 714 As with OSCORE, endpoints communicating with Group OSCORE need to 715 establish the relevant Security Context. Group OSCORE endpoints need 716 to acquire OSCORE input parameters, information about the group(s) 717 and about other endpoints in the group(s). This specification is 718 based on the existence of an entity called Group Manager which is 719 responsible for the group, but does not mandate how the Group Manager 720 interacts with the group members. The responsibilities of the Group 721 Manager are compiled in Section 3.2. 723 It is RECOMMENDED to use a Group Manager as described in 724 [I-D.ietf-ace-key-groupcomm-oscore], where the join process is based 725 on the ACE framework for authentication and authorization in 726 constrained environments [I-D.ietf-ace-oauth-authz]. 728 The Group Manager assigns unique Group Identifiers (Gids) to 729 different groups under its control, as well as unique Sender IDs (and 730 thereby Recipient IDs) to the members of those groups. According to 731 a hierarchical approach, the Gid value assigned to a group is 732 associated to a dedicated space for the values of Sender ID and 733 Recipient ID of the members of that group. In addition, the Group 734 Manager maintains records of the public keys of endpoints in a group, 735 and provides information about the group and its members to other 736 members and selected roles. Upon nodes' joining, the Group Manager 737 collects such public keys and MUST verify proof-of-possession of the 738 respective private key. 740 An endpoint acquires group data such as the Gid and OSCORE input 741 parameters including its own Sender ID from the Group Manager, and 742 provides information about its public key to the Group Manager, for 743 example upon joining the group. 745 A group member can retrieve from the Group Manager the public key and 746 other information associated to another group member, with which it 747 can generate the corresponding Recipient Context. An application can 748 configure a group member to asynchronously retrieve information about 749 Recipient Contexts, e.g. by Observing [RFC7641] the Group Manager to 750 get updates on the group membership. 752 The Group Manager MAY serve additional entities acting as signature 753 checkers, e.g. intermediary gateways. These entities do not join a 754 group as members, but can retrieve public keys of group members from 755 the Group Manager, in order to verify counter signatures of group 756 messages. A signature checker MUST be authorized for retrieving 757 public keys of members in a specific group from the Group Manager. 758 To this end, the same method mentioned above based on the ACE 759 framework [I-D.ietf-ace-oauth-authz] can be used. 761 3.1. Management of Group Keying Material 763 In order to establish a new Security Context for a group, a new Group 764 Identifier (Gid) for that group and a new value for the Master Secret 765 parameter MUST be generated. An example of Gid format supporting 766 this operation is provided in Appendix C. When distributing the new 767 Gid and Master Secret, the Group Manager MAY distribute also a new 768 value for the Master Salt parameter, and SHOULD preserve the current 769 value of the Sender ID of each group member. 771 The Group Manager MUST NOT reassign a previously used Sender ID 772 ('kid') with the same Gid, Master Secret and Master Salt. Even if 773 Gid and Master Secret are renewed as described in this section, the 774 Group Manager SHOULD NOT reassign an endpoint's Sender ID ('kid') 775 within a same group, especially in the short term. 777 If required by the application (see Appendix A.1), it is RECOMMENDED 778 to adopt a group key management scheme, and securely distribute a new 779 value for the Gid and for the Master Secret parameter of the group's 780 Security Context, before a new joining endpoint is added to the group 781 or after a currently present endpoint leaves the group. This is 782 necessary to preserve backward security and forward security in the 783 group, if the application requires it. 785 The specific approach used to distribute new group data is out of the 786 scope of this document. However, it is RECOMMENDED that the Group 787 Manager supports the distribution of the new Gid and Master Secret 788 parameter to the group according to the Group Rekeying Process 789 described in [I-D.ietf-ace-key-groupcomm-oscore]. 791 3.2. Responsibilities of the Group Manager 793 The Group Manager is responsible for performing the following tasks: 795 1. Creating and managing OSCORE groups. This includes the 796 assignment of a Gid to every newly created group, as well as 797 ensuring uniqueness of Gids within the set of its OSCORE groups. 799 2. Defining policies for authorizing the joining of its OSCORE 800 groups. 802 3. Handling the join process to add new endpoints as group members. 804 4. Establishing the Common Context part of the Security Context, 805 and providing it to authorized group members during the join 806 process, together with the corresponding Sender Context. 808 5. Generating and managing Sender IDs within its OSCORE groups, as 809 well as assigning and providing them to new endpoints during the 810 join process. This includes ensuring uniqueness of Sender IDs 811 within each of its OSCORE groups. 813 6. Defining communication policies for each of its OSCORE groups, 814 and signalling them to new endpoints during the join process. 816 7. Renewing the Security Context of an OSCORE group upon membership 817 change, by revoking and renewing common security parameters and 818 keying material (rekeying). 820 8. Providing the management keying material that a new endpoint 821 requires to participate in the rekeying process, consistent with 822 the key management scheme used in the group joined by the new 823 endpoint. 825 9. Updating the Gid of its OSCORE groups, upon renewing the 826 respective Security Context. 828 10. Acting as key repository, in order to handle the public keys of 829 the members of its OSCORE groups, and providing such public keys 830 to other members of the same group upon request. The actual 831 storage of public keys may be entrusted to a separate secure 832 storage device. 834 11. Validating that the format and parameters of public keys of 835 group members are consistent with the countersignature algorithm 836 and related parameters used in the respective OSCORE group. 838 The Group Manager described in [I-D.ietf-ace-key-groupcomm-oscore] 839 provides these functionalities. 841 4. The COSE Object 843 Building on Section 5 of [RFC8613], this section defines how to use 844 COSE [I-D.ietf-cose-rfc8152bis-struct] to wrap and protect data in 845 the original message. OSCORE uses the untagged COSE_Encrypt0 846 structure with an Authenticated Encryption with Associated Data 847 (AEAD) algorithm. Unless otherwise specified, the following 848 modifications apply for both the group mode and the pairwise mode of 849 Group OSCORE. 851 4.1. Counter Signature 853 For the group mode only, the 'unprotected' field MUST additionally 854 include the following parameter: 856 o CounterSignature0: its value is set to the counter signature of 857 the COSE object, computed by the sender as described in 858 Section 5.2 of [I-D.ietf-cose-rfc8152bis-struct], by using the 859 private key and according to the Counter Signature Algorithm and 860 Counter Signature Parameters in the Security Context. In 861 particular, the Sig_structure contains the external_aad as defined 862 in Section 4.3.2 and the ciphertext of the COSE_Encrypt0 object as 863 payload. 865 4.2. The 'kid' and 'kid context' parameters 867 The value of the 'kid' parameter in the 'unprotected' field of 868 response messages MUST be set to the Sender ID of the endpoint 869 transmitting the message. That is, unlike in [RFC8613], the 'kid' 870 parameter is always present in all messages, both requests and 871 responses. 873 The value of the 'kid context' parameter in the 'unprotected' field 874 of requests messages MUST be set to the ID Context, i.e. the Group 875 Identifier value (Gid) of the group. That is, unlike in [RFC8613], 876 the 'kid context' parameter is always present in requests. 878 4.3. external_aad 880 The external_aad of the Additional Authenticated Data (AAD) is 881 different compared to OSCORE. In particular, there is one 882 external_aad used for encryption (both in group mode and pairwise 883 mode), and another external_aad used for signing (only in group 884 mode). 886 4.3.1. external_aad for Encryption 888 The external_aad for encryption (see Section 6.3 of 889 [I-D.ietf-cose-rfc8152bis-struct]), used both in group mode and 890 pairwise mode, includes also the counter signature algorithm and 891 related signature parameters, see Figure 2. 893 external_aad = bstr .cbor aad_array 895 aad_array = [ 896 oscore_version : uint, 897 algorithms : [alg_aead : int / tstr, 898 alg_countersign : int / tstr, 899 par_countersign : [countersign_alg_capab, 900 countersign_key_type_capab], 901 par_countersign_key : countersign_key_type_capab], 902 request_kid : bstr, 903 request_piv : bstr, 904 options : bstr 905 ] 907 Figure 2: external_aad for Encryption 909 Compared with Section 5.4 of [RFC8613], the 'algorithms' array in the 910 aad_array additionally includes: 912 o 'alg_countersign', which specifies Counter Signature Algorithm 913 from the Common Context (see Section 2.1.2). This parameter MUST 914 encode the value of Counter Signature Algorithm as a CBOR integer 915 or text string, consistently with the "Value" field in the "COSE 916 Algorithms" Registry for this counter signature algorithm. 918 o 'par_countersign', which specifies the CBOR array Counter 919 Signature Parameters from the Common Context (see Section 2.1.3). 920 In particular: 922 * 'countersign_alg_capab' is the array of COSE capabilities for 923 the countersignature algorithm indicated in 'alg_countersign'. 925 * 'countersign_key_type_capab' is the array of COSE capabilities 926 for the COSE key type used by the countersignature algorithm 927 indicated in 'alg_countersign'. 929 o 'par_countersign_key', which specifies Counter Signature Key 930 Parameters from the Common Context (see Section 2.1.4). In 931 particular, 'countersign_key_type_capab' is the array of COSE 932 capabilities for the COSE key type used by the countersignature 933 algorithm indicated in 'alg_countersign'. 935 4.3.2. external_aad for Signing 937 The external_aad for signing (see Section 4.4 of 938 [I-D.ietf-cose-rfc8152bis-struct]) used in group mode is identical to 939 the external_aad for encryption (see Section 4.3.1) with the addition 940 of the OSCORE option, see Figure 3. 942 external_aad = bstr .cbor aad_array 944 aad_array = [ 945 oscore_version : uint, 946 algorithms : [alg_aead : int / tstr, 947 alg_countersign : int / tstr, 948 par_countersign : [countersign_alg_capab, 949 countersign_key_type_capab], 950 par_countersign_key : countersign_key_type_capab], 951 request_kid : bstr, 952 request_piv : bstr, 953 options : bstr, 954 OSCORE_option: bstr 955 ] 957 Figure 3: external_aad for Signing 959 Compared with Section 5.4 of [RFC8613] the aad_array additionally 960 includes: 962 o the 'algorithms' array as defined in the external_aad for 963 encryption, see Section 4.3.1; 965 o the value of the OSCORE Option encoded as a binary string. 967 Note for implementation: this construction requires the OSCORE option 968 of the message to be generated before calculating the signature. 969 Also, the aad_array needs to be large enough to contain the largest 970 possible OSCORE option. 972 5. OSCORE Header Compression 974 The OSCORE header compression defined in Section 6 of [RFC8613] is 975 used, with the following differences. 977 o The payload of the OSCORE message SHALL encode the ciphertext of 978 the COSE object. In the group mode, the ciphertext above is 979 concatenated with the value of the CounterSignature0 of the COSE 980 object, computed as described in Section 4.1. 982 o This specification defines the usage of the sixth least 983 significant bit, called the "Group Flag", in the first byte of the 984 OSCORE option containing the OSCORE flag bits. This flag bit is 985 specified in Section 11.1. 987 o The Group Flag MUST be set to 1 if the OSCORE message is protected 988 using the group mode (see Section 8). 990 o The Group Flag MUST be set to 0 if the OSCORE message is protected 991 using the pairwise mode (see Section 9). The Group Flag MUST also 992 be set to 0 for ordinary OSCORE messages processed according to 993 [RFC8613]. 995 5.1. Examples of Compressed COSE Objects 997 This section covers a list of OSCORE Header Compression examples of 998 Group OSCORE used in group mode (see Section 5.1.1) or in pairwise 999 mode (see Section 5.1.2). 1001 The examples assume that the COSE_Encrypt0 object is set (which means 1002 the CoAP message and cryptographic material is known). Note that the 1003 examples do not include the full CoAP unprotected message or the full 1004 Security Context, but only the input necessary to the compression 1005 mechanism, i.e. the COSE_Encrypt0 object. The output is the 1006 compressed COSE object as defined in Section 5 and divided into two 1007 parts, since the object is transported in two CoAP fields: OSCORE 1008 option and payload. 1010 The examples assume that the plaintext (see Section 5.3 of [RFC8613]) 1011 is 6 bytes long, and that the AEAD tag is 8 bytes long, hence 1012 resulting in a ciphertext which is 14 bytes long. When using the 1013 group mode, COUNTERSIGN denotes the CounterSignature0 byte string as 1014 described in Section 4, and is 64 bytes long. 1016 5.1.1. Examples in Group Mode 1018 o Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 1019 0x25, Partial IV = 5 and kid context = 0x44616c 1021 Before compression (96 bytes): 1023 [ 1024 h'', 1025 { 4:h'25', 6:h'05', 10:h'44616c', 9:COUNTERSIGN }, 1026 h'aea0155667924dff8a24e4cb35b9' 1027 ] 1029 After compression (85 bytes): 1031 Flag byte: 0b00111001 = 0x39 1033 Option Value: 39 05 03 44 61 6c 25 (7 bytes) 1035 Payload: ae a0 15 56 67 92 4d ff 8a 24 e4 cb 35 b9 COUNTERSIGN 1036 (14 bytes + size of COUNTERSIGN) 1038 o Response with ciphertext = 0x60b035059d9ef5667c5a0710823b, kid = 1039 0x52 and no Partial IV. 1041 Before compression (88 bytes): 1043 [ 1044 h'', 1045 { 4:h'52', 9:COUNTERSIGN }, 1046 h'60b035059d9ef5667c5a0710823b' 1047 ] 1048 After compression (80 bytes): 1050 Flag byte: 0b00101000 = 0x28 1052 Option Value: 28 52 (2 bytes) 1054 Payload: 60 b0 35 05 9d 9e f5 66 7c 5a 07 10 82 3b COUNTERSIGN 1055 (14 bytes + size of COUNTERSIGN) 1057 5.1.2. Examples in Pairwise Mode 1059 o Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 1060 0x25, Partial IV = 5 and kid context = 0x44616c 1062 Before compression (32 bytes): 1064 [ 1065 h'', 1066 { 4:h'25', 6:h'05', 10:h'44616c' }, 1067 h'aea0155667924dff8a24e4cb35b9' 1068 ] 1070 After compression (21 bytes): 1072 Flag byte: 0b00011001 = 0x19 1074 Option Value: 19 05 03 44 61 6c 25 (7 bytes) 1076 Payload: ae a0 15 56 67 92 4d ff 8a 24 e4 cb 35 b9 (14 bytes) 1078 o Response with ciphertext = 0x60b035059d9ef5667c5a0710823b, kid = 1079 0x52 and no Partial IV. 1081 Before compression (24 bytes): 1083 [ 1084 h'', 1085 { 4:h'52'}, 1086 h'60b035059d9ef5667c5a0710823b' 1087 ] 1088 After compression (16 bytes): 1090 Flag byte: 0b00001000 = 0x08 1092 Option Value: 08 52 (2 bytes) 1094 Payload: 60 b0 35 05 9d 9e f5 66 7c 5a 07 10 82 3b (14 bytes) 1096 6. Message Binding, Sequence Numbers, Freshness and Replay Protection 1098 The requirements and properties described in Section 7 of [RFC8613] 1099 also apply to OSCORE used in group communication. In particular, 1100 Group OSCORE provides message binding of responses to requests, which 1101 enables absolute freshness of responses that are not notifications, 1102 relative freshness of requests and notification responses, and replay 1103 protection of requests. 1105 6.1. Update of Replay Window 1107 A new server joining a group may not be aware of the current Partial 1108 IVs (Sender Sequence Numbers of the clients). The first time the new 1109 server receives a request from a particular client, it is not able to 1110 verify if that request is a replay. The same holds when a server 1111 loses its mutable Security Context (see Section 2.4.1), for instance 1112 after a device reboot. 1114 The exact way to address this issue is application specific, and 1115 depends on the particular use case and its replay requirements. The 1116 list of methods to handle the update of a Replay Window is part of 1117 the group communication policy, and different servers can use 1118 different methods. 1120 Appendix E describes three possible approaches that can be considered 1121 to update a Replay Window. 1123 7. Message Reception 1125 Upon receiving a protected message, a recipient endpoint retrieves a 1126 Security Context as in [RFC8613]. An endpoint MUST be able to 1127 distinguish between a Security Context to process OSCORE messages as 1128 in [RFC8613] and a Security Context to process Group OSCORE messages 1129 as defined in this specification. 1131 To this end, an endpoint can take into account the different 1132 structure of the Security Context defined in Section 2, for example 1133 based on the presence of Counter Signature Algorithm in the Common 1134 Context. Alternatively implementations can use an additional 1135 parameter in the Security Context, to explicitly signal that it is 1136 intended for processing Group OSCORE messages. 1138 If any of the following two conditions holds, a recipient endpoint 1139 MUST discard the incoming protected message: 1141 o The Group Flag is set to 1, and the recipient endpoint can not 1142 retrieve a Security Context which is both valid to process the 1143 message and also associated to an OSCORE group. 1145 o The Group Flag is set to 0, and the recipient endpoint retrieves a 1146 Security Context which is both valid to process the message and 1147 also associated to an OSCORE group, but the endpoint does not 1148 support the pairwise mode. 1150 Otherwise, if a Security Context associated to an OSCORE group and 1151 valid to process the message is retrieved, the recipient endpoint 1152 processes the message with Group OSCORE, using the group mode (see 1153 Section 8) if the Group Flag is set to 1, or the pairwise mode (see 1154 Section 9) if the Group Flag is set to 0. 1156 Note that, if the Group Flag is set to 0, and the recipient endpoint 1157 retrieves a Security Context which is valid to process the message 1158 but is not associated to an OSCORE group, then the message is 1159 processed according to [RFC8613]. 1161 8. Message Processing in Group Mode 1163 When using the group mode, messages are protected and processed as 1164 specified in [RFC8613], with the modifications described in this 1165 section. The security objectives of the group mode are discussed in 1166 Appendix A.2. The group mode MUST be supported. 1168 The group mode MUST be used to protect group requests intended for 1169 multiple recipients or for the whole group. This includes both 1170 requests directly addressed to multiple recipients, e.g. sent by the 1171 client over multicast, as well as requests sent by the client over 1172 unicast to a proxy, that forwards them to the intended recipients 1173 over multicast [I-D.ietf-core-groupcomm-bis]. 1175 As per [RFC7252][I-D.ietf-core-groupcomm-bis], group requests sent 1176 over multicast MUST be Non-Confirmable, and thus cannot be 1177 retransmitted by the CoAP messaging layer. Instead, applications 1178 should store such outgoing messages for a pre-defined, sufficient 1179 amount of time, in order to correctly perform possible 1180 retransmissions at the application layer. According to Section 5.2.3 1181 of [RFC7252], responses to Non-Confirmable group requests SHOULD also 1182 be Non-Confirmable, but endpoints MUST be prepared to receive 1183 Confirmable responses in reply to a Non-Confirmable group request. 1184 Confirmable group requests are acknowledged in non-multicast 1185 environments, as specified in [RFC7252]. 1187 Furthermore, endpoints in the group locally perform error handling 1188 and processing of invalid messages according to the same principles 1189 adopted in [RFC8613]. However, a recipient MUST stop processing and 1190 silently reject any message which is malformed and does not follow 1191 the format specified in Section 4, or which is not cryptographically 1192 validated in a successful way. In either case, it is RECOMMENDED 1193 that the recipient does not send back any error message. This 1194 prevents servers from replying with multiple error messages to a 1195 client sending a group request, so avoiding the risk of flooding and 1196 possibly congesting the network. 1198 8.1. Protecting the Request 1200 A client transmits a secure group request as described in Section 8.1 1201 of [RFC8613], with the following modifications. 1203 o In step 2, the Additional Authenticated Data is modified as 1204 described in Section 4. 1206 o In step 4, the encryption of the COSE object is modified as 1207 described in Section 4. The encoding of the compressed COSE 1208 object is modified as described in Section 5. In particular, the 1209 Group Flag MUST be set to 1. 1211 o In step 5, the counter signature is computed and the format of the 1212 OSCORE message is modified as described in Section 4 and 1213 Section 5. In particular, the payload of the OSCORE message 1214 includes also the counter signature. 1216 8.1.1. Supporting Observe 1218 If Observe [RFC7641] is supported, for each newly started 1219 observation, the client MUST store the value of the 'kid' parameter 1220 from the original Observe request. 1222 The client MUST NOT update the stored value, even in case it is 1223 individually rekeyed and receives a new Sender ID from the Group 1224 Manager (see Section 2.4.3.1). 1226 8.2. Verifying the Request 1228 Upon receiving a secure group request with the Group Flag set to 1, 1229 following the procedure in Section 7, a server proceeds as described 1230 in Section 8.2 of [RFC8613], with the following modifications. 1232 o In step 2, the decoding of the compressed COSE object follows 1233 Section 5. In particular: 1235 * If the server discards the request due to not retrieving a 1236 Security Context associated to the OSCORE group, the server MAY 1237 respond with a 4.02 (Bad Option) error. When doing so, the 1238 server MAY set an Outer Max-Age option with value zero, and MAY 1239 include a descriptive string as diagnostic payload. 1241 * If the received 'kid context' matches an existing ID Context 1242 (Gid) but the received 'kid' does not match any Recipient ID in 1243 this Security Context, then the server MAY create a new 1244 Recipient Context for this Recipient ID and initialize it 1245 according to Section 3 of [RFC8613], and also retrieve the 1246 associated public key. Such a configuration is application 1247 specific. If the application does not specify dynamic 1248 derivation of new Recipient Contexts, then the server SHALL 1249 stop processing the request. 1251 o In step 4, the Additional Authenticated Data is modified as 1252 described in Section 4. 1254 o In step 6, the server also verifies the counter signature using 1255 the public key of the client from the associated Recipient 1256 Context. If the signature verification fails, the server SHALL 1257 stop processing the request and MAY respond with a 4.00 (Bad 1258 Request) response. If the verification fails, the same steps are 1259 taken as if the decryption had failed. In particular, the Replay 1260 Window is only updated if both the signature verification and the 1261 decryption succeed. 1263 o Additionally, if the used Recipient Context was created upon 1264 receiving this group request and the message is not verified 1265 successfully, the server MAY delete that Recipient Context. Such 1266 a configuration, which is specified by the application, mitigates 1267 attacks that aim at overloading the server's storage. 1269 A server SHOULD NOT process a request if the received Recipient ID 1270 ('kid') is equal to its own Sender ID in its own Sender Context. For 1271 an example where this is not fulfilled, see Section 5.2.1 in 1272 [I-D.tiloca-core-observe-multicast-notifications]. 1274 8.2.1. Supporting Observe 1276 If Observe [RFC7641] is supported, for each newly started 1277 observation, the server MUST store the value of the 'kid' parameter 1278 from the original Observe request. 1280 The server MUST NOT update the stored value of a 'kid' parameter 1281 associated to a particular Observe request, even in case the observer 1282 client is individually rekeyed and starts using a new Sender ID 1283 received from the Group Manager (see Section 2.4.3.1). 1285 8.3. Protecting the Response 1287 If a server generates a CoAP message in response to a Group OSCORE 1288 request, then the server SHALL follow the description in Section 8.3 1289 of [RFC8613], with the modifications described in this section. 1291 Note that the server always protects a response with the Sender 1292 Context from its latest Security Context, and that a new Security 1293 Context does not reset the Sender Sequence Number unless otherwise 1294 specified by the application (see Section 3.1). 1296 o In step 2, the Additional Authenticated Data is modified as 1297 described in Section 4. 1299 o In step 3, if the server is using a different Security Context for 1300 the response compared to what was used to verify the request (see 1301 Section 3.1), then the AEAD nonce from the request MUST NOT be 1302 used. 1304 o In step 4, the encryption of the COSE object is modified as 1305 described in Section 4. The encoding of the compressed COSE 1306 object is modified as described in Section 5. In particular, the 1307 Group Flag MUST be set to 1. If the server is using a different 1308 ID Context (Gid) for the response compared to what was used to 1309 verify the request (see Section 3.1), then the new ID Context MUST 1310 be included in the 'kid context' parameter of the response. 1312 o In step 5, the counter signature is computed and the format of the 1313 OSCORE message is modified as described in Section 5. In 1314 particular, the payload of the OSCORE message includes also the 1315 counter signature. 1317 8.3.1. Supporting Observe 1319 If Observe [RFC7641] is supported, the server may have ongoing 1320 observations, started by Observe requests protected with an old 1321 Security Context. 1323 After completing the establishment of a new Security Context, the 1324 server MUST protect the following notifications with the Sender 1325 Context of the new Security Context. 1327 For each ongoing observation, the server MUST include in the first 1328 notification protected with the new Security Context also the 'kid 1329 context' parameter, which is set to the ID Context (Gid) of the new 1330 Security Context. It is OPTIONAL for the server to include the ID 1331 Context (Gid) in the 'kid context' parameter also in further 1332 following notifications for those observations. 1334 Furthermore, for each ongoing observation, the server MUST use the 1335 stored value of the 'kid' parameter from the original Observe 1336 request, as value for the 'request_kid' parameter in the two 1337 external_aad structures (see Section 4.3.1 and Section 4.3.2), when 1338 protecting notifications for that observation. 1340 8.4. Verifying the Response 1342 Upon receiving a secure response message with the Group Flag set to 1343 1, following the procedure in Section 7, the client proceeds as 1344 described in Section 8.4 of [RFC8613], with the following 1345 modifications. 1347 Note that a client may receive a response protected with a Security 1348 Context different from the one used to protect the corresponding 1349 group request, and that, upon the establishment of a new Security 1350 Context, the client does not reset its own replay windows in its 1351 Recipient Contexts, unless otherwise specified by the application 1352 (see Section 3.1). 1354 o In step 2, the decoding of the compressed COSE object is modified 1355 as described in Section 5. If the received 'kid context' matches 1356 an existing ID Context (Gid) but the received 'kid' does not match 1357 any Recipient ID in this Security Context, then the client MAY 1358 create a new Recipient Context for this Recipient ID and 1359 initialize it according to Section 3 of [RFC8613], and also 1360 retrieve the associated public key. If the application does not 1361 specify dynamic derivation of new Recipient Contexts, then the 1362 client SHALL stop processing the response. 1364 o In step 3, the Additional Authenticated Data is modified as 1365 described in Section 4. 1367 o In step 5, the client also verifies the counter signature using 1368 the public key of the server from the associated Recipient 1369 Context. If the verification fails, the same steps are taken as 1370 if the decryption had failed. 1372 o Additionally, if the used Recipient Context was created upon 1373 receiving this response and the message is not verified 1374 successfully, the client MAY delete that Recipient Context. Such 1375 a configuration, which is specified by the application, mitigates 1376 attacks that aim at overloading the client's storage. 1378 8.4.1. Supporting Observe 1380 If Observe [RFC7641] is supported, for each ongoing observation, the 1381 client MUST use the stored value of the 'kid' parameter from the 1382 original Observe request, as value for the 'request_kid' parameter in 1383 the two external_aad structures (see Section 4.3.1 and 1384 Section 4.3.2), when verifying notifications for that observation. 1386 This ensures that the client can correctly verify notifications, even 1387 in case it is individually rekeyed and starts using a new Sender ID 1388 received from the Group Manager (see Section 2.4.3.1). 1390 9. Message Processing in Pairwise Mode 1392 When using the pairwise mode of Group OSCORE, messages are protected 1393 and processed as in Section 8, with the modifications described in 1394 this section. The security objectives of the pairwise mode are 1395 discussed in Appendix A.2. 1397 The pairwise mode takes advantage of an existing Security Context for 1398 the group mode to establish a Security Context shared exclusively 1399 with any other member. In order to use the pairwise mode, the 1400 signature scheme of the group mode MUST support a combined signature 1401 and encryption scheme. This can be, for example, signature using 1402 ECDSA, and encryption using AES-CCM with a key derived with ECDH. 1403 The pairwise mode does not support intermediary verification of 1404 source authentication or integrity. 1406 The pairwise mode MAY be supported. The pairwise mode MUST be 1407 supported by endpoints that use the CoAP Echo Option 1408 [I-D.ietf-core-echo-request-tag] and/or block-wise transfers 1409 [RFC7959], for instance for responses after the first block-wise 1410 request, possibly targeting all servers in the group and including 1411 the CoAP Block2 option (see Section 2.3.6 of 1412 [I-D.ietf-core-groupcomm-bis]). An endpoint implementing only a 1413 silent server does not support the pairwise mode. 1415 The pairwise mode protects messages between two members of a group, 1416 essentially following [RFC8613], but with the following notable 1417 differences: 1419 o The 'kid' and 'kid context' parameters of the COSE object are used 1420 as defined in Section 4.2. 1422 o The external_aad defined in Section 4.3.1 is used for the 1423 encryption process. 1425 o The Sender/Recipient Keys used in the pairwise mode are derived as 1426 defined in Section 2.3. 1428 Senders MUST NOT use the pairwise mode to protect a message intended 1429 for multiple recipients. The pairwise mode is defined only between 1430 two endpoints and the keying material is thus only available to one 1431 recipient. 1433 The Group Manager MAY indicate that the group uses also the pairwise 1434 mode, as part of the group communication policies signalled to 1435 candidate group members when joining the group. 1437 9.1. Pre-Conditions 1439 In order to protect an outgoing message in pairwise mode, the sender 1440 needs to know the public key and the Recipient ID for the recipient 1441 endpoint, as stored in the Recipient Context associated to that 1442 endpoint (see Pairwise Sender Context of Section 2.3.3). 1444 Furthermore, the sender needs to know the individual address of the 1445 recipient endpoint. This information may not be known at any given 1446 point in time. For instance, right after having joined the group, a 1447 client may know the public key and Recipient ID for a given server, 1448 but not the addressing information required to reach it with an 1449 individual, one-to-one request. 1451 To make addressing information of individual endpoints available, 1452 servers in the group MAY expose a resource to which a client can send 1453 a group request targeting a server or a set of servers, identified by 1454 their 'kid' value(s). The specified set may be empty, hence 1455 identifying all the servers in the group. Further details of such an 1456 interface are out of scope for this document. 1458 9.2. Protecting the Request 1460 When using the pairwise mode, the request is protected as defined in 1461 Section 8.1, with the following differences. 1463 o The Group Flag MUST be set to 0. 1465 o The Sender Key used is the Pairwise Sender Key (see Section 2.3). 1467 o The counter signature is not computed and therefore not included 1468 in the message. The payload of the protected request thus 1469 terminates with the encoded ciphertext of the COSE object, just as 1470 in [RFC8613]. 1472 Note that, just as in the group mode, the external_aad for encryption 1473 is generated as in Section 4.3.1, and the Partial IV is the current 1474 fresh value of the Sender Sequence Number (see Section 2.3.2). 1476 9.3. Verifying the Request 1478 Upon receiving a request with the Group Flag set to 0, following the 1479 procedure in Section 7, the server MUST process it as defined in 1480 Section 8.2, with the following differences. 1482 o If the server discards the request due to not retrieving a 1483 Security Context associated to the OSCORE group or to not 1484 supporting the pairwise mode, the server MAY respond with a 4.02 1485 (Bad Option) error. When doing so, the server MAY set an Outer 1486 Max-Age option with value zero, and MAY include a descriptive 1487 string as diagnostic payload. 1489 o If a new Recipient Context is created for this Recipient ID, new 1490 Pairwise Sender/Recipient Keys are also derived (see 1491 Section 2.3.1). The new Pairwise Sender/Recipient Keys are 1492 deleted if the Recipient Context is deleted as a result of the 1493 message not being successfully verified. 1495 o The Recipient Key used is the Pairwise Recipient Key (see 1496 Section 2.3). 1498 o No verification of counter signature occurs, as there is none 1499 included in the message. 1501 9.4. Protecting the Response 1503 When using the pairwise mode, a response is protected as defined in 1504 Section 8.3, with the following differences. 1506 o The Group Flag MUST be set to 0. 1508 o The Sender Key used is the Pairwise Sender Key (see Section 2.3). 1510 o The counter signature is not computed and therefore not included 1511 in the message. The payload of the protected response thus 1512 terminates with the encoded ciphertext of the COSE object, just as 1513 in [RFC8613]. 1515 9.5. Verifying the Response 1517 Upon receiving a response with the Group Flag set to 0, following the 1518 procedure in Section 7, the client MUST process it as defined in 1519 Section 8.4, with the following differences. 1521 o If a new Recipient Context is created for this Recipient ID, new 1522 Pairwise Sender/Recipient Keys are also derived (see 1523 Section 2.3.1). The new Pairwise Sender/Recipient Keys are 1524 deleted if the Recipient Context is deleted as a result of the 1525 message not being successfully verified. 1527 o The Recipient Key used is the Pairwise Recipient Key (see 1528 Section 2.3). 1530 o No verification of counter signature occurs, as there is none 1531 included in the message. 1533 10. Security Considerations 1535 The same threat model discussed for OSCORE in Appendix D.1 of 1536 [RFC8613] holds for Group OSCORE. In addition, when using the group 1537 mode, source authentication of messages is explicitly ensured by 1538 means of counter signatures, as discussed in Section 10.1. 1540 The same considerations on supporting Proxy operations discussed for 1541 OSCORE in Appendix D.2 of [RFC8613] hold for Group OSCORE. 1543 The same considerations on protected message fields for OSCORE 1544 discussed in Appendix D.3 of [RFC8613] hold for Group OSCORE. 1546 The same considerations on uniqueness of (key, nonce) pairs for 1547 OSCORE discussed in Appendix D.4 of [RFC8613] hold for Group OSCORE. 1548 This is further discussed in Section 10.2. 1550 The same considerations on unprotected message fields for OSCORE 1551 discussed in Appendix D.5 of [RFC8613] hold for Group OSCORE, with 1552 the following difference. The counter signature included in a Group 1553 OSCORE message protected in group mode is computed also over the 1554 value of the OSCORE option, which is part of the Additional 1555 Authenticated Data used in the signing process. This is further 1556 discussed in Section 10.6. 1558 As discussed in Section 6.2.3 of [I-D.ietf-core-groupcomm-bis], Group 1559 OSCORE addresses security attacks against CoAP listed in Sections 1560 11.2-11.6 of [RFC7252], especially when run over IP multicast. 1562 The rest of this section first discusses security aspects to be taken 1563 into account when using Group OSCORE. Then it goes through aspects 1564 covered in the security considerations of OSCORE (Section 12 of 1565 [RFC8613]), and discusses how they hold when Group OSCORE is used. 1567 10.1. Group-level Security 1569 The group mode described in Section 8 relies on commonly shared group 1570 keying material to protect communication within a group. This has 1571 the following implications. 1573 o Messages are encrypted at a group level (group-level data 1574 confidentiality), i.e. they can be decrypted by any member of the 1575 group, but not by an external adversary or other external 1576 entities. 1578 o The AEAD algorithm provides only group authentication, i.e. it 1579 ensures that a message sent to a group has been sent by a member 1580 of that group, but not by the alleged sender. This is why source 1581 authentication of messages sent to a group is ensured through a 1582 counter signature, which is computed by the sender using its own 1583 private key and then appended to the message payload. 1585 Instead, the pairwise mode described in Section 9 protects messages 1586 by using pairwise symmetric keys, derived from the static-static 1587 Diffie-Hellman shared secret computed from the asymmetric keys of the 1588 sender and recipient endpoint (see Section 2.3). Therefore, in the 1589 parwise mode, the AEAD algorithm provides both pairwise data- 1590 confidentiality and source authentication of messages, without using 1591 counter signatures. 1593 The long-term storing of the Diffie-Hellman shared secret is a 1594 potential security issue. In fact, if the shared secret of two group 1595 members is leaked, a third group member can exploit it to impersonate 1596 any of those two group members, by deriving and using their pairwise 1597 key. The possibility of such leakage should be contemplated, as more 1598 likely to happen than the leakage of a private key, which could be 1599 rather protected at a significantly higher level than generic memory, 1600 e.g. by using a Trusted Platform Module. Therefore, there is a 1601 trade-off between the maximum amount of time a same shared secret is 1602 stored and the frequency of its re-computing. 1604 Note that, even if an endpoint is authorized to be a group member and 1605 to take part in group communications, there is a risk that it behaves 1606 inappropriately. For instance, it can forward the content of 1607 messages in the group to unauthorized entities. However, in many use 1608 cases, the devices in the group belong to a common authority and are 1609 configured by a commissioner (see Appendix B), which results in a 1610 practically limited risk and enables a prompt detection/reaction in 1611 case of misbehaving. 1613 10.2. Uniqueness of (key, nonce) 1615 The proof for uniqueness of (key, nonce) pairs in Appendix D.4 of 1616 [RFC8613] is also valid in group communication scenarios. That is, 1617 given an OSCORE group: 1619 o Uniqueness of Sender IDs within the group is enforced by the Group 1620 Manager. 1622 o The case A in Appendix D.4 of [RFC8613] concerns all group 1623 requests and responses including a Partial IV (e.g. Observe 1624 notifications). In this case, same considerations from [RFC8613] 1625 apply here as well. 1627 o The case B in Appendix D.4 of [RFC8613] concerns responses not 1628 including a Partial IV (e.g. single response to a group request). 1629 In this case, same considerations from [RFC8613] apply here as 1630 well. 1632 As a consequence, each message encrypted/decrypted with the same 1633 Sender Key is processed by using a different (ID_PIV, PIV) pair. 1634 This means that nonces used by any fixed encrypting endpoint are 1635 unique. Thus, each message is processed with a different (key, 1636 nonce) pair. 1638 10.3. Management of Group Keying Material 1640 The approach described in this specification should take into account 1641 the risk of compromise of group members. In particular, this 1642 document specifies that a key management scheme for secure revocation 1643 and renewal of Security Contexts and group keying material should be 1644 adopted. 1646 [I-D.ietf-ace-key-groupcomm-oscore] provides a simple rekeying scheme 1647 for renewing the Security Context in a group. 1649 Alternative rekeying schemes which are more scalable with the group 1650 size may be needed in dynamic, large-scale, groups where endpoints 1651 can join and leave at any time, in order to limit the impact on 1652 performance due to the Security Context and keying material update. 1654 10.4. Update of Security Context and Key Rotation 1656 A group member can receive a message shortly after the group has been 1657 rekeyed, and new security parameters and keying material have been 1658 distributed by the Group Manager. 1660 This may result in a client using an old Security Context to protect 1661 a group request, and a server using a different new Security Context 1662 to protect a corresponding response. As a consequence, clients may 1663 receive a response protected with a Security Context different from 1664 the one used to protect the corresponding group request. 1666 In particular, a server may first get a group request protected with 1667 the old Security Context, then install the new Security Context, and 1668 only after that produce a response to send back to the client. In 1669 such a case, as specified in Section 8.3, the server MUST protect the 1670 potential response using the new Security Context. Specifically, the 1671 server MUST use its own Sender Sequence Number as Partial IV to 1672 protect that response, and not the Partial IV from the request, in 1673 order to prevent reuse of AEAD nonces in the new Security Context. 1675 The client will process that response using the new Security Context, 1676 provided that it has installed the new security parameters and keying 1677 material before the message reception. 1679 In case block-wise transfer [RFC7959] is used, the same 1680 considerations from Section 7.2 of [I-D.ietf-ace-key-groupcomm] hold. 1682 Furthermore, as described below, a group rekeying may temporarily 1683 result in misaligned Security Contexts between the sender and 1684 recipient of a same message. 1686 10.4.1. Late Update on the Sender 1688 In this case, the sender protects a message using the old Security 1689 Context, i.e. before having installed the new Security Context. 1690 However, the recipient receives the message after having installed 1691 the new Security Context, hence not being able to correctly process 1692 it. 1694 A possible way to ameliorate this issue is to preserve the old, 1695 recent, Security Context for a maximum amount of time defined by the 1696 application. By doing so, the recipient can still try to process the 1697 received message using the old retained Security Context as second 1698 attempt. This makes particular sense when the recipient is a client, 1699 that would hence be able to process incoming responses protected with 1700 the old, recent, Security Context used to protect the associated 1701 group request. Instead, a recipient server would better and more 1702 simply discard an incoming group request which is not successfully 1703 processed with the new Security Context. 1705 This tolerance preserves the processing of secure messages throughout 1706 a long-lasting key rotation, as group rekeying processes may likely 1707 take a long time to complete, especially in large scale groups. On 1708 the other hand, a former (compromised) group member can abusively 1709 take advantage of this, and send messages protected with the old 1710 retained Security Context. Therefore, a conservative application 1711 policy should not admit the retention of old Security Contexts. 1713 10.4.2. Late Update on the Recipient 1715 In this case, the sender protects a message using the new Security 1716 Context, but the recipient receives that message before having 1717 installed the new Security Context. Therefore, the recipient would 1718 not be able to correctly process the message and hence discards it. 1720 If the recipient installs the new Security Context shortly after that 1721 and the sender endpoint uses CoAP retransmissions, the former will 1722 still be able to receive and correctly process the message. 1724 In any case, the recipient should actively ask the Group Manager for 1725 an updated Security Context according to an application-defined 1726 policy, for instance after a given number of unsuccessfully decrypted 1727 incoming messages. 1729 10.5. Collision of Group Identifiers 1731 In case endpoints are deployed in multiple groups managed by 1732 different non-synchronized Group Managers, it is possible for Group 1733 Identifiers of different groups to coincide. 1735 This does not impair the security of the AEAD algorithm. In fact, as 1736 long as the Master Secret is different for different groups and this 1737 condition holds over time, AEAD keys are different among different 1738 groups. 1740 The entity assigning an IP multicast address may help limiting the 1741 chances to experience such collisions of Group Identifiers. In 1742 particular, it may allow the Group Managers of groups using the same 1743 IP multicast address to share their respective list of assigned Group 1744 Identifiers currently in use. 1746 10.6. Cross-group Message Injection 1748 A same endpoint is allowed to and would likely use the same public/ 1749 private key pair in multiple OSCORE groups, possibly administered by 1750 different Group Managers. 1752 When a sender endpoint sends a message protected in pairwise mode to 1753 a recipient endpoint in an OSCORE group, a malicious group member may 1754 attempt to inject the message to a different OSCORE group also 1755 including the same endpoints (see Section 10.6.1). 1757 This practically relies on altering the content of the OSCORE option, 1758 and having the same MAC in the ciphertext still correctly validating, 1759 which has a success probability depending on the size of the MAC. 1761 As discussed in Section 10.6.2, the attack is practically infeasible 1762 if the message is protected in group mode, since the counter 1763 signature is bound also to the OSCORE option, through the Additional 1764 Authenticated Data used in the signing process (see Section 4.3.2). 1766 10.6.1. Attack Description 1768 Let us consider: 1770 o Two OSCORE groups G1 and G2, with ID Context (Group ID) Gid1 and 1771 Gid2, respectively. Both G1 and G2 use the AEAD cipher AES-CCM- 1772 16-64-128, i.e. the MAC of the ciphertext is 8 bytes in size. 1774 o A sender endpoint X which is member of both G1 and G2, and uses 1775 the same public/private key pair in both groups. The endpoint X 1776 has Sender ID Sid1 in G1 and Sender ID Sid2 in G2. The pairs 1777 (Sid1, Gid1) and (Sid2, Gid2) identify the same public key of X in 1778 G1 and G2, respectively. 1780 o A recipient endpoint Y which is member of both G1 and G2, and uses 1781 the same public/private key pair in both groups. The endpoint Y 1782 has Sender ID Sid3 in G1 and Sender ID Sid4 in G2. The pairs 1783 (Sid3, Gid1) and (Sid4, Gid2) identify the same public key of Y in 1784 G1 and G2, respectively. 1786 o A malicious endpoint Z is also member of both G1 and G2. Hence, Z 1787 is able to derive the symmetric keys associated to X in G1 and G2. 1789 When X sends a message M1 addressed to Y in G1 and protected in 1790 pairwise mode, Z can intercept M1, and forge a valid message M2 to be 1791 injected in G2, making it appear as still sent by X to Y and valid to 1792 be accepted. 1794 More in detail, Z intercepts and stops message M1, and forges a 1795 message M2 by changing the value of the OSCORE option from M1 as 1796 follows: the 'kid context' is changed from G1 to G2; and the 'kid' is 1797 changed from Sid1 to Sid2. Then, Z injects message M2 as addressed 1798 to Y in G2. 1800 Upon receiving M2, there is a probability equal to 2^-64 that Y 1801 successfully verifies the same unchanged MAC by using Sid2 as 1802 'request_kid' and using the Pairwise Recipient Key associated to X in 1803 G2. 1805 Note that Z does not know the pairwise keys of X and Y, since it does 1806 not know and is not able to compute their shared Diffie-Hellman 1807 secret. Therefore, Z is not able to check offline if a performed 1808 forgery is actually valid, before sending the forged message to G2. 1810 10.6.2. Attack Prevention in Group Mode 1812 When a Group OSCORE message is protected with the group mode, the 1813 counter signature is computed also over the value of the OSCORE 1814 option, which is part of the Additional Authenticated Data used in 1815 the signing process (see Section 4.3.2). 1817 That is, the countersignature is computed also over: the ID Context 1818 (Group ID) and the Partial IV, which are always present in group 1819 requests; as well as the Sender ID of the message originator, which 1820 is always present in all group requests and responses. 1822 Since the signing process takes as input also the ciphertext of the 1823 COSE_Encrypt0 object, the countersignature is bound not only to the 1824 intended OSCORE group, hence to the triplet (Master Secret, Master 1825 Salt, ID Context), but also to a specific Sender ID in that group and 1826 to its specific symmetric key used for AEAD encryption, hence to the 1827 quartet (Master Secret, Master Salt, ID Context, Sender ID). 1829 This makes it practically infeasible to perform the attack described 1830 in Section 10.6.1, since it would require the adversary to 1831 additionally forge a valid countersignature that replaces the 1832 original one in the forged message M2. 1834 If the countersignature did not cover the OSCORE option, the attack 1835 would be possible also in group mode, since the same unchanged 1836 countersignature from messsage M1 would be also valid in message M2. 1837 Also, the following attack simplifications would hold, since Z is 1838 able to derive the Sender/Recipient Keys of X and Y in G1 and G2. 1840 o If M2 is used as a request, Z can check offline if a performed 1841 forgery is actually valid before sending the forged message to G2. 1843 That is, this attack would have a complexity of 2^64 offline 1844 calculations. 1846 o If M2 is used as a response, Z can also change the response 1847 Partial IV, until the same unchanged MAC is successfully verified 1848 by using Sid2 as 'request_kid' and the symmetric key associated to 1849 X in G2. Since the Partial IV is 5 bytes in size, this requires 1850 2^40 operations to test all the Partial IVs, which can be done in 1851 real-time. Also, the probability that a single given message M1 1852 can be used to forge a response M2 for a given request would be 1853 equal to 2^-24, since there are more MAC values (8 bytes in size) 1854 than Partial IV values (5 bytes in size). 1856 Note that, by changing the Partial IV as discussed above, any 1857 member of G1 would also be able to forge a valid signed response 1858 message M2 to be injected in G1. 1860 10.7. Group OSCORE for Unicast Requests 1862 With reference to the processing defined in Section 8.1 for the group 1863 mode and in Appendix G for the optimized request, it is NOT 1864 RECOMMENDED for a client to use the group mode for securing a request 1865 intended for a single group member and sent over unicast. 1867 This does not include the case where the client sends a request over 1868 unicast to a proxy, to be forwarded to multiple intended recipients 1869 over multicast [I-D.ietf-core-groupcomm-bis]. In this case, the 1870 client MUST protect the request with the group mode, even though it 1871 is sent to the proxy over unicast (see Section 8). 1873 If the client uses the group mode with its own Sender Key to protect 1874 a unicast request to a group member, an on-path adversary can, right 1875 then or later on, redirect that request to one/many different group 1876 member(s) over unicast, or to the whole OSCORE group over multicast. 1877 By doing so, the adversary can induce the target group member(s) to 1878 perform actions intended for one group member only. Note that the 1879 adversary can be external, i.e. (s)he does not need to also be a 1880 member of the OSCORE group. 1882 This is due to the fact that the client is not able to indicate the 1883 single intended recipient in a way which is secure and possible to 1884 process for Group OSCORE on the server side. In particular, Group 1885 OSCORE does not protect network addressing information such as the IP 1886 address of the intended recipient server. It follows that the 1887 server(s) receiving the redirected request cannot assert whether that 1888 was the original intention of the client, and would thus simply 1889 assume so. 1891 The impact of such an attack depends especially on the REST method of 1892 the request, i.e. the Inner CoAP Code of the OSCORE request message. 1893 In particular, safe methods such as GET and FETCH would trigger 1894 (several) unintended responses from the targeted server(s), while not 1895 resulting in destructive behavior. On the other hand, non safe 1896 methods such as PUT, POST and PATCH/iPATCH would result in the target 1897 server(s) taking active actions on their resources and possible 1898 cyber-physical environment, with the risk of destructive consequences 1899 and possible implications for safety. 1901 A client can instead use the pairwise mode defined in Section 9.2, in 1902 order to protect a request sent to a single group member by using 1903 pairwise keying material (see Section 2.3). This prevents the attack 1904 discussed above by construction, as only the intended server is able 1905 to derive the pairwise keying material used by the client to protect 1906 the request. A client supporting the pairwise mode SHOULD use it to 1907 protect requests sent to a single group member over unicast, instead 1908 of using the group mode. For an example where this is not fulfilled, 1909 see Section 5.2.1 in 1910 [I-D.tiloca-core-observe-multicast-notifications]. 1912 With particular reference to block-wise transfers [RFC7959], 1913 Section 2.3.6 of [I-D.ietf-core-groupcomm-bis] points out that, while 1914 an initial request including the CoAP Block2 option can be sent over 1915 multicast, any other request in a transfer has to occur over unicast, 1916 individually addressing the servers in the group. 1918 Additional considerations are discussed in Appendix E.3, with respect 1919 to requests including a CoAP Echo Option 1920 [I-D.ietf-core-echo-request-tag] that has to be sent over unicast, as 1921 a challenge-response method for servers to achieve synchronization of 1922 client Sender Sequence Numbers. 1924 10.8. End-to-end Protection 1926 The same considerations from Section 12.1 of [RFC8613] hold for Group 1927 OSCORE. 1929 Additionally, (D)TLS and Group OSCORE can be combined for protecting 1930 message exchanges occurring over unicast. However, it is not 1931 possible to combine DTLS and Group OSCORE for protecting message 1932 exchanges where messages are (also) sent over multicast. 1934 10.9. Master Secret 1936 Group OSCORE derives the Security Context using the same construction 1937 as OSCORE, and by using the Group Identifier of a group as the 1938 related ID Context. Hence, the same required properties of the 1939 Security Context parameters discussed in Section 3.3 of [RFC8613] 1940 hold for this document. 1942 With particular reference to the OSCORE Master Secret, it has to be 1943 kept secret among the members of the respective OSCORE group and the 1944 Group Manager responsible for that group. Also, the Master Secret 1945 must have a good amount of randomness, and the Group Manager can 1946 generate it offline using a good random number generator. This 1947 includes the case where the Group Manager rekeys the group by 1948 generating and distributing a new Master Secret. Randomness 1949 requirements for security are described in [RFC4086]. 1951 10.10. Replay Protection 1953 As in OSCORE, also Group OSCORE relies on sender sequence numbers 1954 included in the COSE message field 'Partial IV' and used to build 1955 AEAD nonces. 1957 Note that the Partial IV of an endpoint does not necessarily grow 1958 monotonically. For instance, upon exhaustion of the endpoint Sender 1959 Sequence Number, the Partial IV also gets exhausted. As discussed in 1960 Section 2.4.3, this results either in the endpoint being individually 1961 rekeyed and getting a new Sender ID, or in the establishment of a new 1962 Security Context in the group. Therefore, uniqueness of (key, nonce) 1963 pairs (see Section 10.2) is preserved also when a new Security 1964 Context is established. 1966 As discussed in Section 6.1, an endpoint that has just joined a group 1967 is exposed to replay attack, as it is not aware of the sender 1968 sequence numbers currently used by other group members. Appendix E 1969 describes how endpoints can synchronize with senders' sequence 1970 numbers. 1972 Unless exchanges in a group rely only on unicast messages, Group 1973 OSCORE cannot be used with reliable transport. Thus, unless only 1974 unicast messages are sent in the group, it cannot be defined that 1975 only messages with sequence numbers that are equal to the previous 1976 sequence number + 1 are accepted. 1978 The processing of response messages described in Section 2.3.1 of 1979 [I-D.ietf-core-groupcomm-bis] also ensures that a client accepts a 1980 single valid response to a given request from each replying server, 1981 unless CoAP observation is used. 1983 10.11. Client Aliveness 1985 As discussed in Section 12.5 of [RFC8613], a server may use the CoAP 1986 Echo Option [I-D.ietf-core-echo-request-tag] to verify the aliveness 1987 of the client that originated a received request. This would also 1988 allow the server to (re-)synchronize with the client's sequence 1989 number, as well as to ensure that the request is fresh and has not 1990 been replayed or (purposely) delayed, if it is the first one received 1991 from that client after having joined the group or rebooted (see 1992 Appendix E.3). 1994 10.12. Cryptographic Considerations 1996 The same considerations from Section 12.6 of [RFC8613] about the 1997 maximum Sender Sequence Number hold for Group OSCORE. 1999 As discussed in Section 2.4.2, an endpoint that experiences an 2000 exhaustion of its own Sender Sequence Number MUST NOT transmit 2001 further messages including a Partial IV, until it has derived a new 2002 Sender Context. This prevents the endpoint to reuse the same AEAD 2003 nonces with the same Sender Key. 2005 In order to renew its own Sender Context, the endpoint SHOULD inform 2006 the Group Manager, which can either renew the whole Security Context 2007 by means of group rekeying, or provide only that endpoint with a new 2008 Sender ID value. In either case, the endpoint derives a new Sender 2009 Context, and in particular a new Sender Key. 2011 Additionally, the same considerations from Section 12.6 of [RFC8613] 2012 hold for Group OSCORE, about building the AEAD nonce and the secrecy 2013 of the Security Context parameters. 2015 The EdDSA signature algorithm Ed25519 [RFC8032] is mandatory to 2016 implement. For endpoints that support the pairwise mode of Group 2017 OSCORE, the X25519 function [RFC7748] is also mandatory to implement. 2018 Montgomery curves and (twisted) Edwards curves [RFC7748] can be 2019 alternatively represented in short-Weierstrass form as described in 2020 [I-D.ietf-lwig-curve-representations]. 2022 For many constrained IoT devices, it is problematic to support more 2023 than one signature algorithm or multiple whole cipher suites. As a 2024 consequence, some deployments using, for instance, ECDSA with NIST 2025 P-256 may not support the mandatory signature algorithm but that 2026 should not be an issue for local deployments. 2028 The derivation of pairwise keys defined in Section 2.3.1 is 2029 compatible with ECDSA and EdDSA asymmetric keys, but is not 2030 compatible with RSA asymmetric keys. The security of using the same 2031 key pair for Diffie-Hellman and for signing is demonstrated in 2032 [Degabriele]. 2034 10.13. Message Segmentation 2036 The same considerations from Section 12.7 of [RFC8613] hold for Group 2037 OSCORE. 2039 10.14. Privacy Considerations 2041 Group OSCORE ensures end-to-end integrity protection and encryption 2042 of the message payload and all options that are not used for proxy 2043 operations. In particular, options are processed according to the 2044 same class U/I/E that they have for OSCORE. Therefore, the same 2045 privacy considerations from Section 12.8 of [RFC8613] hold for Group 2046 OSCORE. 2048 Furthermore, the following privacy considerations hold, about the 2049 OSCORE option that may reveal information on the communicating 2050 endpoints. 2052 o The 'kid' parameter, which is intended to help a recipient 2053 endpoint to find the right Recipient Context, may reveal 2054 information about the Sender Endpoint. Since both requests and 2055 responses always include the 'kid' parameter, this may reveal 2056 information about both a client sending a group request and all 2057 the possibly replying servers sending their own individual 2058 response. 2060 o The 'kid context' parameter, which is intended to help a recipient 2061 endpoint to find the right Recipient Context, reveals information 2062 about the sender endpoint. In particular, it reveals that the 2063 sender endpoint is a member of a particular OSCORE group, whose 2064 current Group ID is indicated in the 'kid context' parameter. 2066 When receiving a group request, each of the recipient endpoints can 2067 reply with a response that includes its Sender ID as 'kid' parameter. 2068 All these responses will be matchable with the request through the 2069 Token. Thus, even if these responses do not include a 'kid context' 2070 parameter, it becomes possible to understand that the responder 2071 endpoints are in the same group of the requester endpoint. 2073 Furthermore, using the mechanisms described in Appendix E.3 to 2074 achieve sequence number synchronization with a client may reveal when 2075 a server device goes through a reboot. This can be mitigated by the 2076 server device storing the precise state of the replay window of each 2077 known client on a clean shutdown. 2079 Finally, the mechanism described in Section 10.5 to prevent 2080 collisions of Group Identifiers from different Group Managers may 2081 reveal information about events in the respective OSCORE groups. In 2082 particular, a Group Identifier changes when the corresponding group 2083 is rekeyed. Thus, Group Managers might use the shared list of Group 2084 Identifiers to infer the rate and patterns of group membership 2085 changes triggering a group rekeying, e.g. due to newly joined members 2086 or evicted (compromised) members. In order to alleviate this privacy 2087 concern, it should be hidden from the Group Managers which exact 2088 Group Manager has currently assigned which Group Identifiers in its 2089 OSCORE groups. 2091 11. IANA Considerations 2093 Note to RFC Editor: Please replace all occurrences of "[This 2094 Document]" with the RFC number of this specification and delete this 2095 paragraph. 2097 This document has the following actions for IANA. 2099 11.1. OSCORE Flag Bits Registry 2101 IANA is asked to add the following value entry to the "OSCORE Flag 2102 Bits" subregistry defined in Section 13.7 of [RFC8613] as part of the 2103 "CoRE Parameters" registry. 2105 +--------------+------------+-------------------------------+-----------+ 2106 | Bit Position | Name | Description | Reference | 2107 +--------------+------------+-------------------------------+-----------+ 2108 | 2 | Group Flag | Set to 1 if the message is | [This | 2109 | | | protected with the group mode | Document] | 2110 | | | of Group OSCORE | | 2111 +--------------+------------+-------------------------------+-----------+ 2113 12. References 2115 12.1. Normative References 2117 [COSE.Algorithms] 2118 IANA, "COSE Algorithms", 2119 . 2122 [COSE.Key.Types] 2123 IANA, "COSE Key Types", 2124 . 2127 [I-D.ietf-core-groupcomm-bis] 2128 Dijk, E., Wang, C., and M. Tiloca, "Group Communication 2129 for the Constrained Application Protocol (CoAP)", draft- 2130 ietf-core-groupcomm-bis-00 (work in progress), March 2020. 2132 [I-D.ietf-cose-rfc8152bis-algs] 2133 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2134 Initial Algorithms", draft-ietf-cose-rfc8152bis-algs-09 2135 (work in progress), June 2020. 2137 [I-D.ietf-cose-rfc8152bis-struct] 2138 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2139 Structures and Process", draft-ietf-cose-rfc8152bis- 2140 struct-10 (work in progress), June 2020. 2142 [NIST-800-56A] 2143 Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R. 2144 Davis, "Recommendation for Pair-Wise Key-Establishment 2145 Schemes Using Discrete Logarithm Cryptography - NIST 2146 Special Publication 800-56A, Revision 3", April 2018, 2147 . 2150 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2151 Requirement Levels", BCP 14, RFC 2119, 2152 DOI 10.17487/RFC2119, March 1997, 2153 . 2155 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 2156 "Randomness Requirements for Security", BCP 106, RFC 4086, 2157 DOI 10.17487/RFC4086, June 2005, 2158 . 2160 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2161 Application Protocol (CoAP)", RFC 7252, 2162 DOI 10.17487/RFC7252, June 2014, 2163 . 2165 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 2166 for Security", RFC 7748, DOI 10.17487/RFC7748, January 2167 2016, . 2169 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 2170 Signature Algorithm (EdDSA)", RFC 8032, 2171 DOI 10.17487/RFC8032, January 2017, 2172 . 2174 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2175 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2176 May 2017, . 2178 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2179 "Object Security for Constrained RESTful Environments 2180 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 2181 . 2183 12.2. Informative References 2185 [Degabriele] 2186 Degabriele, J., Lehmann, A., Paterson, K., Smart, N., and 2187 M. Strefler, "On the Joint Security of Encryption and 2188 Signature in EMV", December 2011, 2189 . 2191 [I-D.ietf-ace-key-groupcomm] 2192 Palombini, F. and M. Tiloca, "Key Provisioning for Group 2193 Communication using ACE", draft-ietf-ace-key-groupcomm-07 2194 (work in progress), June 2020. 2196 [I-D.ietf-ace-key-groupcomm-oscore] 2197 Tiloca, M., Park, J., and F. Palombini, "Key Management 2198 for OSCORE Groups in ACE", draft-ietf-ace-key-groupcomm- 2199 oscore-07 (work in progress), June 2020. 2201 [I-D.ietf-ace-oauth-authz] 2202 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 2203 H. Tschofenig, "Authentication and Authorization for 2204 Constrained Environments (ACE) using the OAuth 2.0 2205 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-34 2206 (work in progress), June 2020. 2208 [I-D.ietf-core-echo-request-tag] 2209 Amsuess, C., Mattsson, J., and G. Selander, "CoAP: Echo, 2210 Request-Tag, and Token Processing", draft-ietf-core-echo- 2211 request-tag-09 (work in progress), March 2020. 2213 [I-D.ietf-lwig-curve-representations] 2214 Struik, R., "Alternative Elliptic Curve Representations", 2215 draft-ietf-lwig-curve-representations-10 (work in 2216 progress), April 2020. 2218 [I-D.ietf-lwig-security-protocol-comparison] 2219 Mattsson, J., Palombini, F., and M. Vucinic, "Comparison 2220 of CoAP Security Protocols", draft-ietf-lwig-security- 2221 protocol-comparison-04 (work in progress), March 2020. 2223 [I-D.mattsson-cfrg-det-sigs-with-noise] 2224 Mattsson, J., Thormarker, E., and S. Ruohomaa, 2225 "Deterministic ECDSA and EdDSA Signatures with Additional 2226 Randomness", draft-mattsson-cfrg-det-sigs-with-noise-02 2227 (work in progress), March 2020. 2229 [I-D.somaraju-ace-multicast] 2230 Somaraju, A., Kumar, S., Tschofenig, H., and W. Werner, 2231 "Security for Low-Latency Group Communication", draft- 2232 somaraju-ace-multicast-02 (work in progress), October 2233 2016. 2235 [I-D.tiloca-core-observe-multicast-notifications] 2236 Tiloca, M., Hoeglund, R., Amsuess, C., and F. Palombini, 2237 "Observe Notifications as CoAP Multicast Responses", 2238 draft-tiloca-core-observe-multicast-notifications-02 (work 2239 in progress), March 2020. 2241 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 2242 "Transmission of IPv6 Packets over IEEE 802.15.4 2243 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 2244 . 2246 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2247 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2248 . 2250 [RFC6282] Hui, J., Ed. and P. Thubert, "Compression Format for IPv6 2251 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 2252 DOI 10.17487/RFC6282, September 2011, 2253 . 2255 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 2256 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 2257 January 2012, . 2259 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2260 Constrained-Node Networks", RFC 7228, 2261 DOI 10.17487/RFC7228, May 2014, 2262 . 2264 [RFC7641] Hartke, K., "Observing Resources in the Constrained 2265 Application Protocol (CoAP)", RFC 7641, 2266 DOI 10.17487/RFC7641, September 2015, 2267 . 2269 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2270 the Constrained Application Protocol (CoAP)", RFC 7959, 2271 DOI 10.17487/RFC7959, August 2016, 2272 . 2274 Appendix A. Assumptions and Security Objectives 2276 This section presents a set of assumptions and security objectives 2277 for the approach described in this document. The rest of this 2278 section refers to three types of groups: 2280 o Application group, i.e. a set of CoAP endpoints that share a 2281 common pool of resources. 2283 o Security group, as defined in Section 1.1 of this specification. 2284 There can be a one-to-one or a one-to-many relation between 2285 security groups and application groups, and vice versa. Any two 2286 application groups associated to the same security group do not 2287 share any same resource. 2289 o CoAP group, as defined in [I-D.ietf-core-groupcomm-bis] i.e. a set 2290 of CoAP endpoints, where each endpoint is configured to receive 2291 CoAP multicast requests that are sent to the group's associated IP 2292 multicast address and UDP port. An endpoint may be a member of 2293 multiple CoAP groups. There can be a one-to-one or a one-to-many 2294 relation between application groups and CoAP groups. Note that a 2295 device sending a CoAP request to a CoAP group is not necessarily 2296 itself a member of that group: it is a member only if it also has 2297 a CoAP server endpoint listening to requests for this CoAP group, 2298 sent to the associated IP multicast address and port. In order to 2299 provide secure group communication, all members of a CoAP group as 2300 well as all further endpoints configured only as clients sending 2301 CoAP (multicast) requests to the CoAP group have to be member of a 2302 security group. There can be a one-to-one or a one-to-many 2303 relation between security groups and CoAP groups, and vice versa. 2305 A.1. Assumptions 2307 The following assumptions are assumed to be already addressed and are 2308 out of the scope of this document. 2310 o Multicast communication topology: this document considers both 2311 1-to-N (one sender and multiple recipients) and M-to-N (multiple 2312 senders and multiple recipients) communication topologies. The 2313 1-to-N communication topology is the simplest group communication 2314 scenario that would serve the needs of a typical Low-power and 2315 Lossy Network (LLN). Examples of use cases that benefit from 2316 secure group communication are provided in Appendix B. 2318 In a 1-to-N communication model, only a single client transmits 2319 data to the CoAP group, in the form of request messages; in an 2320 M-to-N communication model (where M and N do not necessarily have 2321 the same value), M clients transmit data to the CoAP group. 2322 According to [I-D.ietf-core-groupcomm-bis], any possible proxy 2323 entity is supposed to know about the clients and to not perform 2324 aggregation of response messages from multiple servers. Also, 2325 every client expects and is able to handle multiple response 2326 messages associated to a same request sent to the CoAP group. 2328 o Group size: security solutions for group communication should be 2329 able to adequately support different and possibly large security 2330 groups. The group size is the current number of members in a 2331 security group. In the use cases mentioned in this document, the 2332 number of clients (normally the controlling devices) is expected 2333 to be much smaller than the number of servers (i.e. the controlled 2334 devices). A security solution for group communication that 2335 supports 1 to 50 clients would be able to properly cover the group 2336 sizes required for most use cases that are relevant for this 2337 document. The maximum group size is expected to be in the range 2338 of 2 to 100 devices. Security groups larger than that should be 2339 divided into smaller independent groups. 2341 o Communication with the Group Manager: an endpoint must use a 2342 secure dedicated channel when communicating with the Group 2343 Manager, also when not registered as a member of the security 2344 group. 2346 o Provisioning and management of Security Contexts: a Security 2347 Context must be established among the members of the security 2348 group. A secure mechanism must be used to generate, revoke and 2349 (re-)distribute keying material, communication policies and 2350 security parameters in the security group. The actual 2351 provisioning and management of the Security Context is out of the 2352 scope of this document. 2354 o Multicast data security ciphersuite: all members of a security 2355 group must agree on a ciphersuite to provide authenticity, 2356 integrity and confidentiality of messages in the group. The 2357 ciphersuite is specified as part of the Security Context. 2359 o Backward security: a new device joining the security group should 2360 not have access to any old Security Contexts used before its 2361 joining. This ensures that a new member of the security group is 2362 not able to decrypt confidential data sent before it has joined 2363 the security group. The adopted key management scheme should 2364 ensure that the Security Context is updated to ensure backward 2365 confidentiality. The actual mechanism to update the Security 2366 Context and renew the group keying material in the security group 2367 upon a new member's joining has to be defined as part of the group 2368 key management scheme. 2370 o Forward security: entities that leave the security group should 2371 not have access to any future Security Contexts or message 2372 exchanged within the security group after their leaving. This 2373 ensures that a former member of the security group is not able to 2374 decrypt confidential data sent within the security group anymore. 2375 Also, it ensures that a former member is not able to send 2376 protected messages to the security group anymore. The actual 2377 mechanism to update the Security Context and renew the group 2378 keying material in the security group upon a member's leaving has 2379 to be defined as part of the group key management scheme. 2381 A.2. Security Objectives 2383 The approach described in this document aims at fulfilling the 2384 following security objectives: 2386 o Data replay protection: group request messages or response 2387 messages replayed within the security group must be detected. 2389 o Data confidentiality: messages sent within the security group 2390 shall be encrypted. 2392 o Group-level data confidentiality: the group mode provides group- 2393 level data confidentiality since messages are encrypted at a group 2394 level, i.e. in such a way that they can be decrypted by any member 2395 of the security group, but not by an external adversary or other 2396 external entities. 2398 o Pairwise data confidentiality: the pairwise mode especially 2399 provides pairwise data confidentiality, since messages are 2400 encrypted using pairwise keying material shared between any two 2401 group members, hence they can be decrypted only by the intended 2402 single recipient. 2404 o Source message authentication: messages sent within the security 2405 group shall be authenticated. That is, it is essential to ensure 2406 that a message is originated by a member of the security group in 2407 the first place, and in particular by a specific, identifiable 2408 member of the security group. 2410 o Message integrity: messages sent within the security group shall 2411 be integrity protected. That is, it is essential to ensure that a 2412 message has not been tampered with, either by a group member, or 2413 by an external adversary or other external entities which are not 2414 members of the security group. 2416 o Message ordering: it must be possible to determine the ordering of 2417 messages coming from a single sender. In accordance with OSCORE 2418 [RFC8613], this results in providing absolute freshness of 2419 responses that are not notifications, as well as relative 2420 freshness of group requests and notification responses. It is not 2421 required to determine ordering of messages from different senders. 2423 Appendix B. List of Use Cases 2425 Group Communication for CoAP [I-D.ietf-core-groupcomm-bis] provides 2426 the necessary background for multicast-based CoAP communication, with 2427 particular reference to low-power and lossy networks (LLNs) and 2428 resource constrained environments. The interested reader is 2429 encouraged to first read [I-D.ietf-core-groupcomm-bis] to understand 2430 the non-security related details. This section discusses a number of 2431 use cases that benefit from secure group communication, and refers to 2432 the three types of groups from Appendix A. Specific security 2433 requirements for these use cases are discussed in Appendix A. 2435 o Lighting control: consider a building equipped with IP-connected 2436 lighting devices, switches, and border routers. The lighting 2437 devices acting as servers are organized into application groups 2438 and CoAP groups, according to their physical location in the 2439 building. For instance, lighting devices in a room or corridor 2440 can be configured as members of a single application group and 2441 corresponding CoAP group. Those ligthing devices together with 2442 the switches acting as clients in the same room or corridor can be 2443 configured as members of the corresponding security group. 2444 Switches are then used to control the lighting devices by sending 2445 on/off/dimming commands to all lighting devices in the CoAP group, 2446 while border routers connected to an IP network backbone (which is 2447 also multicast-enabled) can be used to interconnect routers in the 2448 building. Consequently, this would also enable logical groups to 2449 be formed even if devices with a role in the lighting application 2450 may be physically in different subnets (e.g. on wired and wireless 2451 networks). Connectivity between lighting devices may be realized, 2452 for instance, by means of IPv6 and (border) routers supporting 2453 6LoWPAN [RFC4944][RFC6282]. Group communication enables 2454 synchronous operation of a set of connected lights, ensuring that 2455 the light preset (e.g. dimming level or color) of a large set of 2456 luminaires are changed at the same perceived time. This is 2457 especially useful for providing a visual synchronicity of light 2458 effects to the user. As a practical guideline, events within a 2459 200 ms interval are perceived as simultaneous by humans, which is 2460 necessary to ensure in many setups. Devices may reply back to the 2461 switches that issue on/off/dimming commands, in order to report 2462 about the execution of the requested operation (e.g. OK, failure, 2463 error) and their current operational status. In a typical 2464 lighting control scenario, a single switch is the only entity 2465 responsible for sending commands to a set of lighting devices. In 2466 more advanced lighting control use cases, a M-to-N communication 2467 topology would be required, for instance in case multiple sensors 2468 (presence or day-light) are responsible to trigger events to a set 2469 of lighting devices. Especially in professional lighting 2470 scenarios, the roles of client and server are configured by the 2471 lighting commissioner, and devices strictly follow those roles. 2473 o Integrated building control: enabling Building Automation and 2474 Control Systems (BACSs) to control multiple heating, ventilation 2475 and air-conditioning units to pre-defined presets. Controlled 2476 units can be organized into application groups and CoAP groups in 2477 order to reflect their physical position in the building, e.g. 2478 devices in the same room can be configured as members of a single 2479 application group and corresponding CoAP group. As a practical 2480 guideline, events within intervals of seconds are typically 2481 acceptable. Controlled units are expected to possibly reply back 2482 to the BACS issuing control commands, in order to report about the 2483 execution of the requested operation (e.g. OK, failure, error) 2484 and their current operational status. 2486 o Software and firmware updates: software and firmware updates often 2487 comprise quite a large amount of data. This can overload a Low- 2488 power and Lossy Network (LLN) that is otherwise typically used to 2489 deal with only small amounts of data, on an infrequent base. 2490 Rather than sending software and firmware updates as unicast 2491 messages to each individual device, multicasting such updated data 2492 to a larger set of devices at once displays a number of benefits. 2493 For instance, it can significantly reduce the network load and 2494 decrease the overall time latency for propagating this data to all 2495 devices. Even if the complete whole update process itself is 2496 secured, securing the individual messages is important, in case 2497 updates consist of relatively large amounts of data. In fact, 2498 checking individual received data piecemeal for tampering avoids 2499 that devices store large amounts of partially corrupted data and 2500 that they detect tampering hereof only after all data has been 2501 received. Devices receiving software and firmware updates are 2502 expected to possibly reply back, in order to provide a feedback 2503 about the execution of the update operation (e.g. OK, failure, 2504 error) and their current operational status. 2506 o Parameter and configuration update: by means of multicast 2507 communication, it is possible to update the settings of a set of 2508 similar devices, both simultaneously and efficiently. Possible 2509 parameters are related, for instance, to network load management 2510 or network access controls. Devices receiving parameter and 2511 configuration updates are expected to possibly reply back, to 2512 provide a feedback about the execution of the update operation 2513 (e.g. OK, failure, error) and their current operational status. 2515 o Commissioning of Low-power and Lossy Network (LLN) systems: a 2516 commissioning device is responsible for querying all devices in 2517 the local network or a selected subset of them, in order to 2518 discover their presence, and be aware of their capabilities, 2519 default configuration, and operating conditions. Queried devices 2520 displaying similarities in their capabilities and features, or 2521 sharing a common physical location can be configured as members of 2522 a single application group and corresponding CoAP group. Queried 2523 devices are expected to reply back to the commissioning device, in 2524 order to notify their presence, and provide the requested 2525 information and their current operational status. 2527 o Emergency multicast: a particular emergency related information 2528 (e.g. natural disaster) is generated and multicast by an emergency 2529 notifier, and relayed to multiple devices. The latter may reply 2530 back to the emergency notifier, in order to provide their feedback 2531 and local information related to the ongoing emergency. This kind 2532 of setups should additionally rely on a fault tolerance multicast 2533 algorithm, such as Multicast Protocol for Low-Power and Lossy 2534 Networks (MPL). 2536 Appendix C. Example of Group Identifier Format 2538 This section provides an example of how the Group Identifier (Gid) 2539 can be specifically formatted. That is, the Gid can be composed of 2540 two parts, namely a Group Prefix and a Group Epoch. 2542 For each group, the Group Prefix is constant over time and is 2543 uniquely defined in the set of all the groups associated to the same 2544 Group Manager. The choice of the Group Prefix for a given group's 2545 Security Context is application specific. The size of the Group 2546 Prefix directly impact on the maximum number of distinct groups under 2547 the same Group Manager. 2549 The Group Epoch is set to 0 upon the group's initialization, and is 2550 incremented by 1 each time new keying material, including a new Gid, 2551 is distributed to the group in order to establish a new Security 2552 Context (see Section 3.1). 2554 As an example, a 3-byte Gid can be composed of: i) a 1-byte Group 2555 Prefix '0xb1' interpreted as a raw byte string; and ii) a 2-byte 2556 Group Epoch interpreted as an unsigned integer ranging from 0 to 2557 65535. Then, after having established the Common Context 61532 times 2558 in the group, its Gid will assume value '0xb1f05c'. 2560 Using an immutable Group Prefix for a group assumes that enough time 2561 elapses between two consecutive usages of the same Group Epoch value 2562 in that group. This ensures that the Gid value is temporally unique 2563 during the lifetime of a given message. Thus, the expected highest 2564 rate for addition/removal of group members and consequent group 2565 rekeying should be taken into account for a proper dimensioning of 2566 the Group Epoch size. 2568 As discussed in Section 10.5, if endpoints are deployed in multiple 2569 groups managed by different non-synchronized Group Managers, it is 2570 possible that Group Identifiers of different groups coincide at some 2571 point in time. In this case, a recipient has to handle coinciding 2572 Group Identifiers, and has to try using different Security Contexts 2573 to process an incoming message, until the right one is found and the 2574 message is correctly verified. Therefore, it is favourable that 2575 Group Identifiers from different Group Managers have a size that 2576 result in a small probability of collision. How small this 2577 probability should be is up to system designers. 2579 Appendix D. Set-up of New Endpoints 2581 An endpoint joins a group by explicitly interacting with the 2582 responsible Group Manager. When becoming members of a group, 2583 endpoints are not required to know how many and what endpoints are in 2584 the same group. 2586 Communications between a joining endpoint and the Group Manager rely 2587 on the CoAP protocol and must be secured. Specific details on how to 2588 secure communications between joining endpoints and a Group Manager 2589 are out of the scope of this document. 2591 The Group Manager must verify that the joining endpoint is authorized 2592 to join the group. To this end, the Group Manager can directly 2593 authorize the joining endpoint, or expect it to provide authorization 2594 evidence previously obtained from a trusted entity. Further details 2595 about the authorization of joining endpoints are out of scope. 2597 In case of successful authorization check, the Group Manager 2598 generates a Sender ID assigned to the joining endpoint, before 2599 proceeding with the rest of the join process. That is, the Group 2600 Manager provides the joining endpoint with the keying material and 2601 parameters to initialize the Security Context (see Section 2). The 2602 actual provisioning of keying material and parameters to the joining 2603 endpoint is out of the scope of this document. 2605 It is RECOMMENDED that the join process adopts the approach described 2606 in [I-D.ietf-ace-key-groupcomm-oscore] and based on the ACE framework 2607 for Authentication and Authorization in constrained environments 2608 [I-D.ietf-ace-oauth-authz]. 2610 Appendix E. Examples of Synchronization Approaches 2612 This section describes three possible approaches that can be 2613 considered by server endpoints to synchronize with Sender Sequence 2614 Numbers of client endpoints sending group requests. 2616 The Group Manager MAY indicate which of such approaches are used in 2617 the group, as part of the group communication policies signalled to 2618 candidate group members upon their group joining. 2620 E.1. Best-Effort Synchronization 2622 Upon receiving a group request from a client, a server does not take 2623 any action to synchronize with the sender sequence number of that 2624 client. This provides no assurance at all as to message freshness, 2625 which can be acceptable in non-critical use cases. 2627 With the notable exception of Observe notifications and responses 2628 following a group rekeying, it is optional for the server to use the 2629 sender sequence number as Partial IV. Instead, for efficiency 2630 reasons, the server may rather use the request's Partial IV when 2631 protecting a response. 2633 E.2. Baseline Synchronization 2635 Upon receiving a group request from a given client for the first 2636 time, a server initializes its last-seen Sender Sequence Number in 2637 its Recipient Context associated to that client. The server may also 2638 drop the group request without delivering it to the application. 2639 This method provides a reference point to identify if future group 2640 requests from the same client are fresher than the last one received. 2642 A replay time interval exists, between when a possibly replayed or 2643 delayed message is originally transmitted by a given client and the 2644 first authentic fresh message from that same client is received. 2645 This can be acceptable for use cases where servers admit such a 2646 trade-off between performance and assurance of message freshness. 2648 With the notable exception of Observe notifications and responses 2649 following a group rekeying, it is optional for the server to use its 2650 own Sender Sequence Number as Partial IV. Instead, for efficiency 2651 reasons, the server may rather use the request's Partial IV when 2652 protecting a response. 2654 E.3. Challenge-Response Synchronization 2656 A server performs a challenge-response exchange with a client, by 2657 using the Echo Option for CoAP described in Section 2 of 2658 [I-D.ietf-core-echo-request-tag] and according to Appendix B.1.2 of 2659 [RFC8613]. 2661 That is, upon receiving a group request from a particular client for 2662 the first time, the server processes the message as described in this 2663 specification, but, even if valid, does not deliver it to the 2664 application. Instead, the server replies to the client with an 2665 OSCORE protected 4.01 (Unauthorized) response message, including only 2666 the Echo Option and no diagnostic payload. Since this response is 2667 protected with the Security Context used in the group, the client 2668 will consider the response valid upon successfully decrypting and 2669 verifying it. 2671 The server stores the Echo Option value included therein, together 2672 with the pair (gid,kid), where 'gid' is the Group Identifier of the 2673 OSCORE group and 'kid' is the Sender ID of the client in the group, 2674 as specified in the 'kid context' and 'kid' fields of the OSCORE 2675 Option of the group request, respectively. After a group rekeying 2676 has been completed and a new Security Context has been established in 2677 the group, which results also in a new Group Identifier (see 2678 Section 3.1), the server MUST delete all the stored Echo values 2679 associated to members of that group. 2681 Upon receiving a 4.01 (Unauthorized) response that includes an Echo 2682 Option and originates from a verified group member, a client sends a 2683 request as a unicast message addressed to the same server, echoing 2684 the Echo Option value. The client MUST NOT send the request 2685 including the Echo Option over multicast. 2687 In particular, the client does not necessarily resend the same group 2688 request, but can instead send a more recent one, if the application 2689 permits it. This makes it possible for the client to not retain 2690 previously sent group requests for full retransmission, unless the 2691 application explicitly requires otherwise. In either case, the 2692 client uses the Sender Sequence Number value currently stored in its 2693 own Sender Context. If the client stores group requests for possible 2694 retransmission with the Echo Option, it should not store a given 2695 request for longer than a pre-configured time interval. Note that 2696 the unicast request echoing the Echo Option is correctly treated and 2697 processed as a message, since the 'kid context' field including the 2698 Group Identifier of the OSCORE group is still present in the OSCORE 2699 Option as part of the COSE object (see Section 4). 2701 Upon receiving the unicast request including the Echo Option, the 2702 server performs the following verifications. 2704 o If the server does not store an Echo Option value for the pair 2705 (gid,kid), it considers: i) the time t1 when it has established 2706 the Security Context used to protect the received request; and ii) 2707 the time t2 when the request has been received. Since a valid 2708 request cannot be older than the Security Context used to protect 2709 it, the server verifies that (t2 - t1) is less than the largest 2710 amount of time acceptable to consider the request fresh. 2712 o If the server stores an Echo Option value for the pair (gid,kid) 2713 associated to that same client in the same group, the server 2714 verifies that the option value equals that same stored value 2715 previously sent by that client. 2717 If the verifications above fail, the server MUST NOT process the 2718 request further and MAY send a 4.01 (Unauthorized) response including 2719 an Echo Option. 2721 In case of positive verification, the request is further processed 2722 and verified. Finally, the server updates the Recipient Context 2723 associated to that client, by setting the Replay Window according to 2724 the Sequence Number from the unicast request conveying the Echo 2725 Option. The server either delivers the request to the application if 2726 it is an actual retransmission of the original one, or discards it 2727 otherwise. Mechanisms to signal whether the resent request is a full 2728 retransmission of the original one are out of the scope of this 2729 specification. 2731 A server should not deliver group requests from a given client to the 2732 application until one valid request from that same client has been 2733 verified as fresh, as conveying an echoed Echo Option 2734 [I-D.ietf-core-echo-request-tag]. Also, a server may perform the 2735 challenge-response described above at any time, if synchronization 2736 with Sender Sequence Numbers of clients is (believed to be) lost, for 2737 instance after a device reboot. A client has to be always ready to 2738 perform the challenge-response based on the Echo Option in case a 2739 server starts it. 2741 It is the role of the server application to define under what 2742 circumstances Sender Sequence Numbers lose synchronization. This can 2743 include experiencing a "large enough" gap D = (SN2 - SN1), between 2744 the Sender Sequence Number SN1 of the latest accepted group request 2745 from a client and the Sender Sequence Number SN2 of a group request 2746 just received from that client. However, a client may send several 2747 unicast requests to different group members as protected with the 2748 pairwise mode (see Section 9.2), which may consume the gap D at the 2749 server relatively fast. This would induce the server to perform more 2750 challenge-response exchanges than actually needed. 2752 To ameliorate this, the server may rather rely on a trade-off between 2753 the Sender Sequence Number gap D and a time gap T = (t2 - t1), where 2754 t1 is the time when the latest group request from a client was 2755 accepted and t2 is the time when the latest group request from that 2756 client has been received, respectively. Then, the server can start a 2757 challenge-response when experiencing a time gap T larger than a 2758 given, pre-configured threshold. Also, the server can start a 2759 challenge-response when experiencing a Sender Sequence Number gap D 2760 greater than a different threshold, computed as a monotonically 2761 increasing function of the currently experienced time gap T. 2763 The challenge-response approach described in this appendix provides 2764 an assurance of absolute message freshness. However, it can result 2765 in an impact on performance which is undesirable or unbearable, 2766 especially in large groups where many endpoints at the same time 2767 might join as new members or lose synchronization. 2769 Note that endpoints configured as silent servers are not able to 2770 perform the challenge-response described above, as they do not store 2771 a Sender Context to secure the 4.01 (Unauthorized) response to the 2772 client. Therefore, silent servers should adopt alternative 2773 approaches to achieve and maintain synchronization with sender 2774 sequence numbers of clients. 2776 Since requests including the Echo Option are sent over unicast, a 2777 server can be a victim of the attack discussed in Section 10.7, when 2778 such requests are protected with the group mode of Group OSCORE, as 2779 described in Section 8.1. 2781 Instead, protecting requests with the Echo Option by using the 2782 pairwise mode of Group OSCORE as described in Section 9.2 prevents 2783 the attack in Section 10.7. In fact, only the exact server involved 2784 in the Echo exchange is able to derive the correct pairwise key used 2785 by the client to protect the request including the Echo Option. 2787 In either case, an internal on-path adversary would not be able to 2788 mix up the Echo Option value of two different unicast requests, sent 2789 by a same client to any two different servers in the group. In fact, 2790 if the group mode was used, this would require the adversary to forge 2791 the client's counter signature in both such requests. As a 2792 consequence, each of the two servers remains able to selectively 2793 accept a request with the Echo Option only if it is waiting for that 2794 exact integrity-protected Echo Option value, and is thus the intended 2795 recipient. 2797 Appendix F. No Verification of Signatures in Group Mode 2799 There are some application scenarios using group communication that 2800 have particularly strict requirements. One example of this is the 2801 requirement of low message latency in non-emergency lighting 2802 applications [I-D.somaraju-ace-multicast]. For those applications 2803 which have tight performance constraints and relaxed security 2804 requirements, it can be inconvenient for some endpoints to verify 2805 digital signatures in order to assert source authenticity of received 2806 messages protected with the group mode. In other cases, the 2807 signature verification can be deferred or only checked for specific 2808 actions. For instance, a command to turn a bulb on where the bulb is 2809 already on does not need the signature to be checked. In such 2810 situations, the counter signature needs to be included anyway as part 2811 of a message protected with the group mode, so that an endpoint that 2812 needs to validate the signature for any reason has the ability to do 2813 so. 2815 In this specification, it is NOT RECOMMENDED that endpoints do not 2816 verify the counter signature of received messages protected with the 2817 group mode. However, it is recognized that there may be situations 2818 where it is not always required. The consequence of not doing the 2819 signature validation in messages protected with the group mode is 2820 that security in the group is based only on the group-authenticity of 2821 the shared keying material used for encryption. That is, endpoints 2822 in the group would have evidence that the received message has been 2823 originated by a group member, although not specifically identifiable 2824 in a secure way. This can violate a number of security requirements, 2825 as the compromise of any element in the group means that the attacker 2826 has the ability to control the entire group. Even worse, the group 2827 may not be limited in scope, and hence the same keying material might 2828 be used not only for light bulbs but for locks as well. Therefore, 2829 extreme care must be taken in situations where the security 2830 requirements are relaxed, so that deployment of the system will 2831 always be done safely. 2833 Appendix G. Optimized Request 2835 An optimized request is processed as a request in group mode 2836 (Section 8.1) and uses the OSCORE header compression defined in 2837 Section 5 for the group mode, with the following difference: the 2838 payload of the OSCORE message SHALL encode the ciphertext without the 2839 tag, concatenated with the value of the CounterSignature0 of the COSE 2840 object computed as described in Section 4.1. 2842 The optimized request is compatible with all AEAD algorithms defined 2843 in [I-D.ietf-cose-rfc8152bis-algs], but would not be compatible with 2844 AEAD algorithms that do not have a well-defined tag. 2846 Appendix H. Example Values of Parameters for Countersignatures 2848 The table below provides examples of values for Counter Signature 2849 Parameters in the Common Context (see Section 2.1.3), for different 2850 values of Counter Signature Algorithm. 2852 +-------------------+---------------------------------------------+ 2853 | Counter Signature | Example Values for Counter | 2854 | Algorithm | Signature Parameters | 2855 +-------------------+---------------------------------------------+ 2856 | (-8) // EdDSA | [1], [1, 6] // 1: OKP ; 1: OKP, 6: Ed25519 | 2857 | (-7) // ES256 | [2], [2, 1] // 2: EC2 ; 2: EC2, 1: P-256 | 2858 | (-35) // ES384 | [2], [2, 2] // 2: EC2 ; 2: EC2, 2: P-384 | 2859 | (-36) // ES512 | [2], [2, 3] // 2: EC2 ; 2: EC2, 3: P-512 | 2860 | (-37) // PS256 | [], [3] // empty ; 3: RSA | 2861 | (-38) // PS384 | [], [3] // empty ; 3: RSA | 2862 | (-39) // PS512 | [], [3] // empty ; 3: RSA | 2863 +-------------------+---------------------------------------------+ 2865 Figure 4: Examples of Counter Signature Parameters 2867 The table below provides examples of values for Counter Signature Key 2868 Parameters in the Common Context (see Section 2.1.4), for different 2869 values of Counter Signature Algorithm. 2871 +-------------------+---------------------------------+ 2872 | Counter Signature | Example Values for Counter | 2873 | Algorithm | Signature Key Parameters | 2874 +-------------------+---------------------------------+ 2875 | (-8) // EdDSA | [1, 6] // 1: OKP , 6: Ed25519 | 2876 | (-7) // ES256 | [2, 1] // 2: EC2 , 1: P-256 | 2877 | (-35) // ES384 | [2, 2] // 2: EC2 , 2: P-384 | 2878 | (-36) // ES512 | [2, 3] // 2: EC2 , 3: P-512 | 2879 | (-37) // PS256 | [3] // 3: RSA | 2880 | (-38) // PS384 | [3] // 3: RSA | 2881 | (-39) // PS512 | [3] // 3: RSA | 2882 +-------------------+---------------------------------+ 2884 Figure 5: Examples of Counter Signature Key Parameters 2886 Appendix I. Document Updates 2888 RFC EDITOR: PLEASE REMOVE THIS SECTION. 2890 I.1. Version -08 to -09 2892 o Pairwise keys are discarded after group rekeying. 2894 o Signature mode renamed to group mode. 2896 o The parameters for countersignatures use the updated COSE 2897 registries. Newly defined IANA registries have been removed. 2899 o Pairwise Flag bit renamed as Group Flag bit, set to 1 in group 2900 mode and set to 0 in pairwise mode. 2902 o Dedicated section on updating the Security Context. 2904 o By default, sender sequence numbers and replay windows are not 2905 reset upon group rekeying. 2907 o An endpoint implementing only a silent server does not support the 2908 pairwise mode. 2910 o Separate section on general message reception. 2912 o Pairwise mode moved to the document body. 2914 o Considerations on using the pairwise mode in non-multicast 2915 settings. 2917 o Optimized requests are moved as an appendix. 2919 o Normative support for the signature and pairwise mode. 2921 o Revised methods for synchronization with clients' sender sequence 2922 number. 2924 o Appendix with example values of parameters for countersignatures. 2926 o Clarifications and editorial improvements. 2928 I.2. Version -07 to -08 2930 o Clarified relation between pairwise mode and group communication 2931 (Section 1). 2933 o Improved definition of "silent server" (Section 1.1). 2935 o Clarified when a Recipient Context is needed (Section 2). 2937 o Signature checkers as entities supported by the Group Manager 2938 (Section 2.3). 2940 o Clarified that the Group Manager is under exclusive control of Gid 2941 and Sender ID values in a group, with Sender ID values under each 2942 Gid value (Section 2.3). 2944 o Mitigation policies in case of recycled 'kid' values 2945 (Section 2.4). 2947 o More generic exhaustion (not necessarily wrap-around) of sender 2948 sequence numbers (Sections 2.5 and 10.11). 2950 o Pairwise key considerations, as to group rekeying and Sender 2951 Sequence Numbers (Section 3). 2953 o Added reference to static-static Diffie-Hellman shared secret 2954 (Section 3). 2956 o Note for implementation about the external_aad for signing 2957 (Sectino 4.3.2). 2959 o Retransmission by the application for group requests over 2960 multicast as Non-Confirmable (Section 7). 2962 o A server MUST use its own Partial IV in a response, if protecting 2963 it with a different context than the one used for the request 2964 (Section 7.3). 2966 o Security considerations: encryption of pairwise mode as 2967 alternative to group-level security (Section 10.1). 2969 o Security considerations: added approach to reduce the chance of 2970 global collisions of Gid values from different Group Managers 2971 (Section 10.5). 2973 o Security considerations: added implications for block-wise 2974 transfers when using the signature mode for requests over unicast 2975 (Section 10.7). 2977 o Security considerations: (multiple) supported signature algorithms 2978 (Section 10.13). 2980 o Security considerations: added privacy considerations on the 2981 approach for reducing global collisions of Gid values 2982 (Section 10.15). 2984 o Updates to the methods for synchronizing with clients' sequence 2985 number (Appendix E). 2987 o Simplified text on discovery services supporting the pairwise mode 2988 (Appendix G.1). 2990 o Editorial improvements. 2992 I.3. Version -06 to -07 2994 o Updated abstract and introduction. 2996 o Clarifications of what pertains a group rekeying. 2998 o Derivation of pairwise keying material. 3000 o Content re-organization for COSE Object and OSCORE header 3001 compression. 3003 o Defined the Pairwise Flag bit for the OSCORE option. 3005 o Supporting CoAP Observe for group requests and responses. 3007 o Considerations on message protection across switching to new 3008 keying material. 3010 o New optimized mode based on pairwise keying material. 3012 o More considerations on replay protection and Security Contexts 3013 upon key renewal. 3015 o Security considerations on Group OSCORE for unicast requests, also 3016 as affecting the usage of the Echo option. 3018 o Clarification on different types of groups considered 3019 (application/security/CoAP). 3021 o New pairwise mode, using pairwise keying material for both 3022 requests and responses. 3024 I.4. Version -05 to -06 3026 o Group IDs mandated to be unique under the same Group Manager. 3028 o Clarifications on parameter update upon group rekeying. 3030 o Updated external_aad structures. 3032 o Dynamic derivation of Recipient Contexts made optional and 3033 application specific. 3035 o Optional 4.00 response for failed signature verification on the 3036 server. 3038 o Removed client handling of duplicated responses to multicast 3039 requests. 3041 o Additional considerations on public key retrieval and group 3042 rekeying. 3044 o Added Group Manager responsibility on validating public keys. 3046 o Updates IANA registries. 3048 o Reference to RFC 8613. 3050 o Editorial improvements. 3052 I.5. Version -04 to -05 3054 o Added references to draft-dijk-core-groupcomm-bis. 3056 o New parameter Counter Signature Key Parameters (Section 2). 3058 o Clarification about Recipient Contexts (Section 2). 3060 o Two different external_aad for encrypting and signing 3061 (Section 3.1). 3063 o Updated response verification to handle Observe notifications 3064 (Section 6.4). 3066 o Extended Security Considerations (Section 8). 3068 o New "Counter Signature Key Parameters" IANA Registry 3069 (Section 9.2). 3071 I.6. Version -03 to -04 3073 o Added the new "Counter Signature Parameters" in the Common Context 3074 (see Section 2). 3076 o Added recommendation on using "deterministic ECDSA" if ECDSA is 3077 used as counter signature algorithm (see Section 2). 3079 o Clarified possible asynchronous retrieval of keying material from 3080 the Group Manager, in order to process incoming messages (see 3081 Section 2). 3083 o Structured Section 3 into subsections. 3085 o Added the new 'par_countersign' to the aad_array of the 3086 external_aad (see Section 3.1). 3088 o Clarified non reliability of 'kid' as identity indicator for a 3089 group member (see Section 2.1). 3091 o Described possible provisioning of new Sender ID in case of 3092 Partial IV wrap-around (see Section 2.2). 3094 o The former signature bit in the Flag Byte of the OSCORE option 3095 value is reverted to reserved (see Section 4.1). 3097 o Updated examples of compressed COSE object, now with the sixth 3098 less significant bit in the Flag Byte of the OSCORE option value 3099 set to 0 (see Section 4.3). 3101 o Relaxed statements on sending error messages (see Section 6). 3103 o Added explicit step on computing the counter signature for 3104 outgoing messages (see Setions 6.1 and 6.3). 3106 o Handling of just created Recipient Contexts in case of 3107 unsuccessful message verification (see Sections 6.2 and 6.4). 3109 o Handling of replied/repeated responses on the client (see 3110 Section 6.4). 3112 o New IANA Registry "Counter Signature Parameters" (see 3113 Section 9.1). 3115 I.7. Version -02 to -03 3117 o Revised structure and phrasing for improved readability and better 3118 alignment with draft-ietf-core-object-security. 3120 o Added discussion on wrap-Around of Partial IVs (see Section 2.2). 3122 o Separate sections for the COSE Object (Section 3) and the OSCORE 3123 Header Compression (Section 4). 3125 o The countersignature is now appended to the encrypted payload of 3126 the OSCORE message, rather than included in the OSCORE Option (see 3127 Section 4). 3129 o Extended scope of Section 5, now titled " Message Binding, 3130 Sequence Numbers, Freshness and Replay Protection". 3132 o Clarifications about Non-Confirmable messages in Section 5.1 3133 "Synchronization of Sender Sequence Numbers". 3135 o Clarifications about error handling in Section 6 "Message 3136 Processing". 3138 o Compacted list of responsibilities of the Group Manager in 3139 Section 7. 3141 o Revised and extended security considerations in Section 8. 3143 o Added IANA considerations for the OSCORE Flag Bits Registry in 3144 Section 9. 3146 o Revised Appendix D, now giving a short high-level description of a 3147 new endpoint set-up. 3149 I.8. Version -01 to -02 3151 o Terminology has been made more aligned with RFC7252 and draft- 3152 ietf-core-object-security: i) "client" and "server" replace the 3153 old "multicaster" and "listener", respectively; ii) "silent 3154 server" replaces the old "pure listener". 3156 o Section 2 has been updated to have the Group Identifier stored in 3157 the 'ID Context' parameter defined in draft-ietf-core-object- 3158 security. 3160 o Section 3 has been updated with the new format of the Additional 3161 Authenticated Data. 3163 o Major rewriting of Section 4 to better highlight the differences 3164 with the message processing in draft-ietf-core-object-security. 3166 o Added Sections 7.2 and 7.3 discussing security considerations 3167 about uniqueness of (key, nonce) and collision of group 3168 identifiers, respectively. 3170 o Minor updates to Appendix A.1 about assumptions on multicast 3171 communication topology and group size. 3173 o Updated Appendix C on format of group identifiers, with practical 3174 implications of possible collisions of group identifiers. 3176 o Updated Appendix D.2, adding a pointer to draft-palombini-ace-key- 3177 groupcomm about retrieval of nodes' public keys through the Group 3178 Manager. 3180 o Minor updates to Appendix E.3 about Challenge-Response 3181 synchronization of sequence numbers based on the Echo option from 3182 draft-ietf-core-echo-request-tag. 3184 I.9. Version -00 to -01 3186 o Section 1.1 has been updated with the definition of group as 3187 "security group". 3189 o Section 2 has been updated with: 3191 * Clarifications on etablishment/derivation of Security Contexts. 3193 * A table summarizing the the additional context elements 3194 compared to OSCORE. 3196 o Section 3 has been updated with: 3198 * Examples of request and response messages. 3200 * Use of CounterSignature0 rather than CounterSignature. 3202 * Additional Authenticated Data including also the signature 3203 algorithm, while not including the Group Identifier any longer. 3205 o Added Section 6, listing the responsibilities of the Group 3206 Manager. 3208 o Added Appendix A (former section), including assumptions and 3209 security objectives. 3211 o Appendix B has been updated with more details on the use cases. 3213 o Added Appendix C, providing an example of Group Identifier format. 3215 o Appendix D has been updated to be aligned with draft-palombini- 3216 ace-key-groupcomm. 3218 Acknowledgments 3220 The authors sincerely thank Christian Amsuess, Stefan Beck, Rolf 3221 Blom, Carsten Bormann, Esko Dijk, Klaus Hartke, Rikard Hoeglund, 3222 Richard Kelsey, John Mattsson, Dave Robin, Jim Schaad, Ludwig Seitz, 3223 Peter van der Stok and Erik Thormarker for their feedback and 3224 comments. 3226 The work on this document has been partly supported by VINNOVA and 3227 the Celtic-Next project CRITISEC; the SSF project SEC4Factory under 3228 the grant RIT17-0032; and the EIT-Digital High Impact Initiative 3229 ACTIVE. 3231 Authors' Addresses 3233 Marco Tiloca 3234 RISE AB 3235 Isafjordsgatan 22 3236 Kista SE-16440 Stockholm 3237 Sweden 3239 Email: marco.tiloca@ri.se 3241 Goeran Selander 3242 Ericsson AB 3243 Torshamnsgatan 23 3244 Kista SE-16440 Stockholm 3245 Sweden 3247 Email: goran.selander@ericsson.com 3249 Francesca Palombini 3250 Ericsson AB 3251 Torshamnsgatan 23 3252 Kista SE-16440 Stockholm 3253 Sweden 3255 Email: francesca.palombini@ericsson.com 3256 Jiye Park 3257 Universitaet Duisburg-Essen 3258 Schuetzenbahn 70 3259 Essen 45127 3260 Germany 3262 Email: ji-ye.park@uni-due.de