Re: [Ace] Review of draft-ietf-ace-oscore-profile

John Mattsson <john.mattsson@ericsson.com> Mon, 14 September 2020 12:49 UTC

Return-Path: <john.mattsson@ericsson.com>
X-Original-To: ace@ietfa.amsl.com
Delivered-To: ace@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E56B13A083A for <ace@ietfa.amsl.com>; Mon, 14 Sep 2020 05:49:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.796
X-Spam-Level:
X-Spam-Status: No, score=-3.796 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.695, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rRFr4oG0szl3 for <ace@ietfa.amsl.com>; Mon, 14 Sep 2020 05:49:18 -0700 (PDT)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2055.outbound.protection.outlook.com [40.107.22.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 96FA83A0843 for <ace@ietf.org>; Mon, 14 Sep 2020 05:49:17 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nNujq8mH+IemTRowz1B/Cj1eFH9gCLSzw0Cy+jJVs0n1Fsj5ANbTJPk5n75VnoOAftY42lzxjQzLSU/AxMc8FUinwcXnkO9yF1G9ui0Vw7rAjlnsCYjRgEQzjq9pYpAvbyUMFc/WFMKjvygLFeA8vX5P104Rog0jftnh7X0JsX9o5VOjleNIiJCc4ofyqd8hyR4QXzm17ChVldE8kmp8eJhx1WImPO408bl/kxmxpCX7Q1Ue1yWcJeWT9Iz918jTPU78JjEyXz/JMSDE/J6RnhxAQa4GXkwirk9cRq6AhmhQWU9x1uKstT4SNa6gerxLljRQfuQb4a+U2DHnd6O1BA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S8ppbLdgMZDTlZ3KhrrDxgtT6WipcXSxjfLKRDEtdmQ=; b=AOGBDoZPVOSTuDN6P2omVLaeDozOnQI9UWXRRG2A/+gG0TpIy8lDMv3yLKV4PZfaN8/FZo1L/c454RB8RvylNFOCsfuXzkiNW+4gGo5rBg2FKmPw8tIoXC7iPfzbdXFlpSuxzBZp+dRQSrL0zvS36FQ8jqGyXhoUuTH3+8cg7CgtqEd6Qg7FNYA6v6TVAfgtQuZrU42WbJa1XDunzJYZht8OhtUiuoGprIKU5rtl0uYONafT7P31dvJ1EG/xIQZfeoR/jhx4Tpq6AcStagT8pv1tvCCKVkfQ5idS5P4kwj2BCBM9zLeJS+krTNjxC6GfYUhq/Vf4Ugpw0xfkF1qiVA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S8ppbLdgMZDTlZ3KhrrDxgtT6WipcXSxjfLKRDEtdmQ=; b=lYHlcRgj5jMCPz2IXypBqxKrCqliI6KlLkjAiBw89SMx3UoVILia8rwh7jiaFycH4xinDzbiTf4g9wB0J/xwnrfN4C6J5/98YYRPUoAPavpiVkCXtcG8KVvmPQ8xueTX96xrY5B00giuMX/HjPXB8ynrU3SkpsvQwNoqCVG15js=
Received: from AM6PR07MB4584.eurprd07.prod.outlook.com (2603:10a6:20b:17::24) by AM5PR0701MB2498.eurprd07.prod.outlook.com (2603:10a6:203:11::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.9; Mon, 14 Sep 2020 12:49:15 +0000
Received: from AM6PR07MB4584.eurprd07.prod.outlook.com ([fe80::39e8:f3f:a912:6e92]) by AM6PR07MB4584.eurprd07.prod.outlook.com ([fe80::39e8:f3f:a912:6e92%6]) with mapi id 15.20.3391.009; Mon, 14 Sep 2020 12:49:15 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: "ace@ietf.org" <ace@ietf.org>
Thread-Topic: Review of draft-ietf-ace-oscore-profile
Thread-Index: AQHWg4M79uX9e36lC0mzSIP1XPgmMaloRWYA
Date: Mon, 14 Sep 2020 12:49:15 +0000
Message-ID: <5970A958-EC6A-4FC7-8E8E-B226C1D52BDF@ericsson.com>
References: <B69129BC-0DEC-48C8-93A2-70E541F3814E@ericsson.com>
In-Reply-To: <B69129BC-0DEC-48C8-93A2-70E541F3814E@ericsson.com>
Accept-Language: en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/16.40.20081000
authentication-results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=ericsson.com;
x-originating-ip: [81.225.97.222]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 196c5907-ac0e-4678-3531-08d858ac964b
x-ms-traffictypediagnostic: AM5PR0701MB2498:
x-microsoft-antispam-prvs: <AM5PR0701MB24982C70A7185313FC25F05289230@AM5PR0701MB2498.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: oF58rzQQV3wifEptTHkvMVe9KYnsVpcahmXyBDrSmrIahOR+iL+DUYpOpkhDH68qci/bxESsMb6z3CZRIL0CN6+VZxwC2Sqy00yyLdBNhLmG2qXiDbNKUDNXKpqAKmyfoSnQl7dDrKru6cRC9j5gqkiqbiLkK8s9zGbSKLqgbc/vIHf+GwZ9Yc+zkFCW6+4gvxNBRkLUhzacad/IzZx+BIPaU29JqUQjz926vNWwS9yzxnKTcXx74TfRkOddXzFpbFzvwW40rOQyTrYHY9+g+bYhVRIn8DMV2Gca2wtA78MYTXIN2W7sEpbg3e3OQv3qQ//iEEbYc9FUguWARYhVlCfgQpMNnzZomlNy7d5tSLm2NdwkkV93e1gAQiU68RfPj/DRexrww/wLerIP4C6h9oi2CgxhcxWgo2mx0CAObn75Yxdc1SSsfHXDKNnfO0nqSzh1JT9lKpwSz0bimzW0kw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR07MB4584.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(366004)(396003)(346002)(376002)(316002)(8936002)(8676002)(2906002)(86362001)(2616005)(6512007)(186003)(508600001)(6916009)(33656002)(53546011)(6506007)(966005)(26005)(83380400001)(36756003)(6486002)(71200400001)(83080400001)(66556008)(44832011)(66446008)(66946007)(64756008)(30864003)(91956017)(5660300002)(66476007)(76116006); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata: AyMQRB2zIMMz+tB8UBG/ORmsdNOETmkX+SDk/2jKUbYNoLb0QbUd9AC1y60n8N/mTpLlz9frM4OHHvPlGUsfDGwFJ/lP4POkIoiqTpex6oRog/DbkDjyNtXF0NYTjpcexHy8JK3lPzoOkZwaBrTt+5uPSTuiXQGwnbAafhu5hihan9MjPP38qBXfvsSO8mzRBZsVNzCmrihrslKoK4I0s5JGPSYdTfJYGRPJxU80aff0LYcp/hVHxkWWharD4S/bOy/7Um5CmZbdGZqBTAZMKrR+PcnQQSmxfkBPl0d7N3r1XtdRQMdOlDhJiSdS59+lQvE8yqu7or2yrGzL4+u6l+nV9+OfNub7rBTcLXDYMp0vqsvqRJ019MJV/R0C9cXaHuGHy9Ibz8UCvVKKDtGPJ294UxmVtECaDsN96wIQ1WkYwlgmL2JAxPK1OGofKSKW2jdTL0FPf6vrKG1j0cHFcIzCi4VL6ywBjh2Cv4/RVTfjLCjm7Vl/D8PC2uopDKF72gVIGZ1pt7Su8ZiNviFO2mC229IZU81dDvQbgZFV7b84ty+zj1oHzD1J8KyoHyNnCJeFCnSE11gMg6z0jAyUiBolBtTSVdHhkyqepEodAyA9gpLU7f0j0eVvvaaH5ztPJtOOt6xizn3lNU1g2rNPMg==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-ID: <713FC5DF82C69D47A3569E9EBEA892D1@eurprd07.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM6PR07MB4584.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 196c5907-ac0e-4678-3531-08d858ac964b
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2020 12:49:15.0736 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: idPSzJSYGAYNrJ6AmuQK98Gq7uB+hQ/+e4azdVbIVxs0eclgQGbetb1YWerz+pUBYZ3OATDIJy++MQtkeMCva9aY+ibTfXq9oyR47YtY+ls=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0701MB2498
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/R5l_wHdpJi7ZMIwchZqqxavI_08>
Subject: Re: [Ace] Review of draft-ietf-ace-oscore-profile
X-BeenThere: ace@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Authentication and Authorization for Constrained Environments \(ace\)" <ace.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ace>, <mailto:ace-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ace/>
List-Post: <mailto:ace@ietf.org>
List-Help: <mailto:ace-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ace>, <mailto:ace-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Sep 2020 12:49:20 -0000

Hi,

Additional comments on the draft. Some of these require technical changes. 

-------------------------
 
- "(as opposed to, e.g., a counter, that might leak some information about the client)"
 
Using counters for N1 and N2 is not secure with the current Master Salt construction as an attacker can trick the client to do a two-time pad.

-> "1"
<- "11"

and

-> "11"
<- "1"

To mitigate these kind of attacks the master salt need to include lengths, e.g. by using a CBOR array. I commented before that I found the master salt construction for JSON is unclear. I think the same apply for CBOR. Assuming the client used the random nonce 0x36f6

In case of CBOR, is the master salt then constructed with the value or the CBOR encoding?

0x36f6 or 0x4236f6

And in case of JSON, is the master salt then constructed with the binary value, the base64 encoding, or the JSON value sent on the wire?

0x36f6, or 0x4e76593d (NvY=), or 0x224e76593d22 ("NvY=")

All of the JSON alternatives and the first CBOR alternative are not secure when used with counters.

The security issues clearly need to be fixed. The master salt construction need to be well-specified also to avoid interoperability between different implementations.

-------------------------
 
"The response code must be 4.01 (Unauthorized) in case the client has a valid token associated with that Security Context, but the Security Context has not been used before, as the proof-of-possession in this profile is performed by both parties verifying that they have established the same Security Context."
 
Sending unauthorized, achieves nothing compared to sending a successful response and wastes a complete round-trip. RS has no reason to consider C unauthorized. RS has proof-of-possesion at this point. RS has no reason to send Unauthorized, a successful answer achieves the same thing. After receiving any response, C gets proof-of-possesion.

This should be fixed, even if it is not a security issue.

Suggestion: Remove this paragraph. Note that this is the only place in the draft where the profile mandates an OSCORE response. CoAP responses are in general optional. So if you want proof-of-possesion in both directions, you need to mandate a response, but there is no reason to mandate 4.01.
 
-------------------------
 
- "We assume in this document that a resource is associated to one single AS, which makes it possible for the AS to enforce uniqueness of identifiers for each client requesting a particular resource to a RS."

"enforce uniqueness of identifiers for each client requesting a particular resource" is not a meaningful thing to do. You probably want to say:

- "We assume in this document that a RS is associated to one single AS, which makes it possible for the AS to enforce uniqueness of identifiers for each client sending requests to a RS."
 
-------------------------
 
As far as I can tell, the draft does not say anything about the AS reusing a token/OSCORE_Input_Material/master key. An AS reusing the same token to several C seem in general like a ok thing to do if a RS only wants to know that the requests is authorized and does not need info on who C is. This can also severely limit the amount of storage/memory in the RS. Requiring RS to save a new token / object for many C is not suitable for a constained RS.
 
If AS cannot reuse a token/object/ms you need to explicitly forbid that.
 
-------------------------
 
"so if a client uses the same single token from multiple locations with multiple Resource Servers, it can risk being tracked by the token's value even when the access token is encrypted."
 
The corresponsing security risks of this is missing. These security implication of using symmetric keys was pointed out by Jim on the list. Suggestion:
 
"If a single OSCORE_Input_Material object is used with multiple RSs, the RSs can impersonate C to one of the other RS, and impersonate another RS to the client. If a master key is used with several clients, the Cs can impersonate RS to one of the other C. Similarly if symmetric keys are used to integrity protect the token between AS and RS and the token can be used with multiple RSs, the RSs can impersonate AS to one of the other RS. If the token key is used for any other communication between the RSs and AS, the RSs can impersonate each other to the AS."

Alternatively, things can be forbidden.
 
-------------------------
 
- "occurs implicitly"

The use of "implicitly" is a bit unfortunate here as implicit is very commonly used to describe level of key confirmation and this draft provides explicit key confirmation.

Suggestion: Rewrite with something not using the word "implicit"
 
-------------------------

- Figure 1.
 
"[ ]" is not defined

But even better would be if the profile did not talk about any specific AS discovery mechnism.
 
-------------------------

 





Editorial suggestions:

-------------------------

- "bound to a key" -> "bound to a symmetric key"
 
-------------------------
 
- "This situation might occur " -> "two-time pad might otherwise occur"
 
-------------------------

- Figure 1.
 
I think it would be very good if you added a little bit more text in the Figure to show when proof-of-possession achieved.
 
/Sec Context             /Sec Context                |
   Derivation/              Derivation/               |
   |                            |                     |
   | ---- OSCORE Request -----> |                     |
 
                                                proof-of-possession
                                                context storage
   |                            |                     |
   | <--- OSCORE Response ----- |                     |
 
proof-of-possession
context storage
   |                            |                     |
   | ---- OSCORE Request -----> |                     |
   |                            |                     |
   | <--- OSCORE Response ----- |                     |
   |           ...              |                     |
 
-------------------------

Cheers,
John

-----Original Message-----
From: John Mattsson <john.mattsson@ericsson.com>
Date: Saturday, 5 September 2020 at 14:51
To: "ace@ietf.org" <ace@ietf.org>
Subject: Review of draft-ietf-ace-oscore-profile

Hi,

I have reviewed the latest GitHub version of draft-ietf-ace-oscore-profile
https://ace-wg.github.io/ace-oscore-profile/draft-ietf-ace-oscore-profile.html

In general this draft looks very good. I have one major comments, and several more minor comments.

Major comment
-------------------

- Asignment of OSCORE Sender and Recipient IDs

I think the specified mechanism where the AS dictates the OSCORE connection parameters is unfortunate. It introduces several current and future limitations. The current assignment mechanisms only works without problems in close systems where the RS does not have any other non-AS OSCORE connections, where the CoAP client and CoAP server roles are fixed and cannot be switched, and where only draft-ietf-ace-oscore-profile is used. In systems where the OSCORE nodes can switch between CoAP client and CoAP server (a feature explicitly supported by OSCORE) the current mechanism is likely to lead to RecipientID collisions. Also in future systems where the AS also supports a more modern key management with PFS using e.g. a future draft-ace-edhoc-oscore-profile, the mechanism would not work together in an efficient way. My understanding is that the authors would like the solution to work with both role switching and EDHOC.

How to negotiate these type of connection identifiers (in this case OSCORE Sender and Recipient IDs) have been studied and specified several times in e.g. draft-selander-lake-edhoc, draft-ietf-tls-dtls-connection-id. A solution where each party choses its OSCORE recipient ID for the connection always work without collisions. Such a negotiation could quite easily be added to the roundtrip with the nonces N1 and N2. My feeling is that it would be worthwhile to do such a change. This would also require a new identifier for the OSCORE_Security_Context Object, either a new objectID or a hash of the object could be used. I think this would be a good change as the current "hack" of using the ACE client sender Id and and ID context to identify the object might lead to other future limitations.

The suggested changes would lead quite equal message sizes and storage requirements, they might even lead to some small improvements.

Minor comments
-------------------

- "server authentication"

My understanding is that server authentication with this draft requires two additional things. That C trusts AS and that RS sends an OSCORE response back. The draft should point this out similarly to the way it points out that a OSCORE request is required for proof-of-possession. As C trust in AS, and RS sending an OSCORE response back are both optional, I would recommend to maybe remove "server authentication" from the abstract and intro.

- "The nonces are encoded as CBOR bstr if CBOR is used, and as Base64 string if JSON is used"

Would be good to define exactly how the Master salt is created when JSON is used. I.e. is the Base64 encoded strings used, or are the byte strings after Base64 decoding used.

- "the authz-info endpoint is not a protected resource, so there is no cryptographic protection to this request."

I do not think this follows from the OAuth ACE term “protected resource”. Most resources on the web are not protected resources, but use cryptographic protection (https:// HTTPS)

- "An OSCORE_Security_Context is an object that represents part or all of an OSCORE Security Context"

The object cannot represent all of an RFC 8613 OSCORE Security Context as sequence number, replay window, and Master salt are missing. I would also strongly recommend removing "context" from the name of the object so that it is not confused with an RFC 8613 context. Maybe OSCORE input keying material or something similar.

- "CBOR type"

The types listed are CDDL types. Should at least mention CDDL or change to actual CBOR types.

- "Security Context identified by "kid""

This message has two different "kid", one on the ACE level and one on the OSCORE level, would be good to clarify which "kid" this refers to.

- "client" "server"

I think the draft should have a sentence saying that the terms "client" "server" when used without specification refer to the ACE client C and the ACE resource server RS. There is another server in the ACE architecture, and on the CoAP level the nodes can switch roles.

- "input salt"

input salt is not defined when it is used in section 2.

- "clientID", "serverID", "contextID"

I am not fond of these new abbreviations for the OSCORE parameters for several reasons. The draft uses the term "clientID" for "ACE client sender ID" = "ACE resource server recipient ID", the term "serverID" for "ACE client recipient ID" = "ACE resource server sender ID", and the term "contextID" for "ID context". "clientID" and "contextID" is also together used as an identifier for the "OSCORE_Security_Context Object".

The problems I have with these terms are that "client ID" and "serverID" give the impression that they are identifiers for the nodes C and RS, which they are not. In two-party OSCORE, the identifiers (senderID and recipientID) are not connected to any of the parties more than the other. In fact, a node needs to be in control of its recipient IDs but does not really need to care much about its sender IDs.

- RFC 8613 Appendix B.2

To me it does not seem clear if draft-ietf-ace-oscore-profile can be used together with the mechanism in Appendix B.2 of RFC 8613. The mechanism in Appendix B.2 leads to a new Context ID. Is it allowed to use that mechanism after using draft-ietf-ace-oscore-profile? In draft-ietf-ace-oscore-profile, the AS dictates a specific “ID Context”?

Cheers,
John