Re: [Lake] Computational analysis of EDHOC Sig-Sig - improvement suggestions for transcript hashes

John Mattsson <john.mattsson@ericsson.com> Fri, 08 July 2022 18:30 UTC

Return-Path: <john.mattsson@ericsson.com>
X-Original-To: lake@ietfa.amsl.com
Delivered-To: lake@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7941EC14CF01 for <lake@ietfa.amsl.com>; Fri, 8 Jul 2022 11:30:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.752
X-Spam-Level:
X-Spam-Status: No, score=-2.752 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.745, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yGl4w0B8CA1z for <lake@ietfa.amsl.com>; Fri, 8 Jul 2022 11:30:02 -0700 (PDT)
Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80087.outbound.protection.outlook.com [40.107.8.87]) (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 776CAC1594A8 for <lake@ietf.org>; Fri, 8 Jul 2022 11:30:02 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hGpAWPfZTblrmTbL1/2yB+8nyAmkDenXYkdJqJpGyF5PXuMHl1cienXIKawCPPC8R8LuDi3ZlwX4dE0YsIyax81tuju4UHym3/kbat7tcI5fCS0CwKUmQNsHchy0Nn3/MGvXCwm323IMS1ZGJuXRw9TsvQLoEEwX8gQK4AhKFxTZvk8CcdyrOh7GdUgxIMGCvkQt9hxS5k93+46AnIPgp8PmMnpWABpVTqgRgNGhsReODcVY0ri0RqveZz3kZiQH7OUYEfhgFMiO2kRd9JjHjG2oJw8wcYYLPkbs992wfvZAG0GTi0ZHtX3QeHKeSx6mLshjkvgJp0ESlKD0EDgbDQ==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4eDj8yxtcCi4zYQ/KGULNJ1bj9b30enP0iRhdyj4CI8=; b=B0okoXLbUXT5zxMilBdfdh9CkU3ZaAq9jCkAZS7rRoATd9F2vn4chPdS0NmWCH1F4tce11FkRkt3iZjxnTYyBpsyMEqPTGEg13LDt/rY0zEiWQ/5POvPKXCrlMwG+X8YLDzch7u564e89eqxe/pDDpLlX7ws+tgc9Fae7T9ZFp/2fozlwE74li6gPByLTjhg6aBpvD9xRcEiAKLr8M4CVOd0WEJXcmnyP81JS4Z2RbgQ/Ev7DTM6pIgVNL59JiJPH9z9u0eR+zj622dDKVNCU4J1EVd50ZeAqlxBuzZ7Pa1algyDz01qBu6N4n9dgfkjMd4bxfl9GcXyjK0HIZBi7Q==
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=4eDj8yxtcCi4zYQ/KGULNJ1bj9b30enP0iRhdyj4CI8=; b=tIoM4d2x90zgLTjFrcCpCL4azwfj7TyHH0gxqUXc2uOiyhnT9DzK9d52lQ5zPpn9UG/Vta2svlFufREX7wCR6UMXLscmOtOWWQ54b2HSzNs2C0ez1SbyyBBUYCPbXSQawhNlG6pjPJkCM9RgCFdDDtEtlMGsKiKhj5xz2EOY3UA=
Received: from HE1PR0701MB3050.eurprd07.prod.outlook.com (2603:10a6:3:4b::8) by VI1PR07MB4717.eurprd07.prod.outlook.com (2603:10a6:803:69::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Fri, 8 Jul 2022 18:29:57 +0000
Received: from HE1PR0701MB3050.eurprd07.prod.outlook.com ([fe80::c9a5:b970:1fd7:5cdb]) by HE1PR0701MB3050.eurprd07.prod.outlook.com ([fe80::c9a5:b970:1fd7:5cdb%5]) with mapi id 15.20.5417.020; Fri, 8 Jul 2022 18:29:56 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: Ilunga Tshibumbu Mukendi Marc <marcilu@student.ethz.ch>, "lake@ietf.org" <lake@ietf.org>
Thread-Topic: Computational analysis of EDHOC Sig-Sig - improvement suggestions for transcript hashes
Thread-Index: AQHYki7Bx0PZeaSgS0aU9IgCcTyOUK10OTqsgACRMic=
Date: Fri, 08 Jul 2022 18:29:56 +0000
Message-ID: <HE1PR0701MB305037B3669117263242B0BB89829@HE1PR0701MB3050.eurprd07.prod.outlook.com>
References: <428673a502dd4ec3980c2201eec3a1e3@student.ethz.ch> <d74e6ee606e543a084a76c37f2ada023@student.ethz.ch>
In-Reply-To: <d74e6ee606e543a084a76c37f2ada023@student.ethz.ch>
Accept-Language: en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ericsson.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: b53a19ef-ccbc-4fe8-50a8-08da610fdbc0
x-ms-traffictypediagnostic: VI1PR07MB4717:EE_
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 5/fEqwJzSr/Pw5qhCg/pr119XaaMZb7gLZnTz/ZwPIAOefKX67JjxyjWpTdFvWL7fJzoFbFyebcpukEAh9MFia1ehuzqbxEcpWUKbk5E7HOQEd3RwDF75OvVegrTWmclvD1bWfN22eXobfEvbUY5JyWhjlU3P6ysCag9jyPEGdq6gLumNVYtZw7Mny5pzgCGjuH0B3VckfXuU6LdewPqtpDX6OPV1dFY40R5KrBl0rsTJ0fx23X0sIJoLR2a05ZpDbB3DUgLRg9cYEmVdbq7sAqcDbkO7xKzfkz+ksSJbXmUeUQuoU2jJQ9zjrHFcUGG3OI6vRqhDPjoPihhCkzNwKppzPTyen0sNSjJyabK8kn1bxkYkUHtQISOOT//Ow5jG/EESyMxkadQJI1o6YujBZLJYv4GbQNNfP69vQpvNBqhW3fait/mkfAq+HsCzLdC73qRraeVodZldyCRUVM5aYBW06tG1Wh1/mX25mi05Jin7cz06mrQOGItFBYgCvrep+OsBlSj+RSnMYLRPMDq6nk3/mzkSleq+BAlvK3U9dvErbjBuiDDBdyc9pKU0D7zT/msN4BuTRFNG6A9TVbsEwRiWkRiMWdGuBQiqNH5UeMaU4AdreqsDxcNDXOG6b3EtDbmopp9TDU5c+IK9um03TQJ9E7vkgySBN9ax39OM6Xx5z+rj+3JWCTwrQEOBqR2YZ2uyN/3HPvD66KGAMImFLQAnTh4DbKOQ8Sqm1VDUOf6k8a4ozhCmqWv4L2HaQ6yHQvn64O4a9YmWj7QPLcEVkkpY0xCWGAy2gX4LptcylMunUnoQJNdv3lXJizHQzqs5v5i8jnJPx0HMg8vsBoOvOCvPldSt/Nh6uUc4wBRWJopkyCuTfXldemdBzmGyOi+NIIsX4GcR6o7j5D2we3lLqtFefrKOeyMHasKghfhR8E=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR0701MB3050.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(136003)(366004)(346002)(396003)(376002)(76116006)(6506007)(66476007)(52536014)(38070700005)(7696005)(166002)(8676002)(186003)(38100700002)(5660300002)(9686003)(55016003)(44832011)(966005)(66446008)(86362001)(53546011)(82960400001)(66946007)(64756008)(26005)(91956017)(8936002)(478600001)(2906002)(66556008)(122000001)(41300700001)(316002)(66574015)(110136005)(33656002)(83380400001)(71200400001); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: UVXNn2Qt0zGqta2DtK+2PWxqTYpEgKCuMhZlSFNYw2g83OcUY9SQQnOLE/3/d6VY1m2k7N7JUVNo4D8pshIjZ4M1VRjvIbtadyyTVGhLKTs77Cr6CWUMhj9mNKBs9RG3vCP0+jiIrDXmqEbPr3O8jX7JDB95GvJraaPAQzbAEFTNwPzYMuQl4xsi6sA7tO4fbClVV3iyA2yMYgU0g0qQUPibeeQSBgRTYnxI6R1SDAYrn60I0MYGV72ROwWzlJ3Q1A9dB+qp2gmEVzxXQ5KfvRQxyKpmjWUaRFi34FtcWcu/D5cOpRL+1dEtdn/q91zsuhG/qZjXIBlmVSLHACWiSyjzK65RiMCCFm6wFKE1UN9Aw1m6xCvB9WzX42QKRLuyfgr4HWjRG6mORFW9eyG5q0o8iw3mUrURZzphUp770jACV+hu2oZjhOcER0VqAWHsZLLqaiidRfn2PXyD2ngstK7+mYtmJC3GiIzJvytvxbggBudG5tLbmB5NnUkcRt/eAm6zqZ82CO0U+9Pt0SPWG18mWVfe6opur/v3WXbOLugGkX2Uho6zlxmq2YiN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type: multipart/alternative; boundary="_000_HE1PR0701MB305037B3669117263242B0BB89829HE1PR0701MB3050_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: HE1PR0701MB3050.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b53a19ef-ccbc-4fe8-50a8-08da610fdbc0
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2022 18:29:56.5251 (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: yDhWmTlocUHr6GNbiWIYH7gNL56qq9pqausxMfrGuBujuAxlonmOYE/ZG5WXy/2fqUFNfXlH9IpqwptMMVTOxwHmB8nkosCTm2sLSTIng4k=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB4717
Archived-At: <https://mailarchive.ietf.org/arch/msg/lake/aaySxFxyUyAfqyt0kkBXHdga2sQ>
Subject: Re: [Lake] Computational analysis of EDHOC Sig-Sig - improvement suggestions for transcript hashes
X-BeenThere: lake@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Lightweight Authenticated Key Exchange <lake.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/lake>, <mailto:lake-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/lake/>
List-Post: <mailto:lake@ietf.org>
List-Help: <mailto:lake-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/lake>, <mailto:lake-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jul 2022 18:30:07 -0000

Dear Marc and Felix,

Thanks you very much for your detailed analysis and feedback.

Your suggested change seems like a relatively easy thing to do:

OLD: TH_3 = H(TH_2, PLAINTEXT_2)
NEW: TH_3 = H(TH_2, PLAINTEXT_2, CRED_R)

where

PLAINTEXT_2 = ( PAD_2, ID_CRED_R, Signature_or_MAC_2, EAD_2 )

and where the message to be signed is

[ "Signature1", << ID_CRED_R >>, << TH_2, CRED_R, ? EAD_2 >>, MAC_2 ]

where

MAC_2 = EDHOC-KDF( PRK_3e2m, 2, << ID_CRED_R, TH_2, CRED_R, ? EAD_2 >>, mac_length_2 )

(and similar for TH_4)

I have not read the papers you refer to yet but if I understand you correctly, the problem is that signature schemes in general provides quite weak properties and even if CRED_R is already included in MAC_2 and in the external_aad of the signature, that is not enough, i.e., depending on the signature scheme an attacker might be able to find two identities CRED_R and CRED_R' such that Signature_or_MAC_2 is the same for the two identities.

Does the issue only apply to authentication with signature keys or also to authentication with Static Diffie-Hellman keys?

This seems like a change we should do.

I created an issue and a PR in the LAKE WG Github.

https://github.com/lake-wg/edhoc/issues/317
https://github.com/lake-wg/edhoc/pull/318

Cheers,
John

From: Lake <lake-bounces@ietf.org> on behalf of Ilunga Tshibumbu Mukendi Marc <marcilu@student.ethz.ch>
Date: Friday, 8 July 2022 at 11:48
To: lake@ietf.org <lake@ietf.org>
Subject: [Lake] Computational analysis of EDHOC Sig-Sig - improvement suggestions for transcript hashes

Dear Mališa, dear all,

Following our last email and in preparation for the IETF 114, we would like to offer a suggestion from our computational analysis of EDHOC. I will first state the suggestion and then give some motivation and justification.

Suggestion: Include the authentication credentials in the transcript hash computation.

Namely, we suggest modifying the transcript hashes TH_3 and TH_4 to include the credential of the peer that authenticate themselves. More precisely, we propose that protocol participants compute:
   > TH_3 = H(TH_2, (PAD_2, G_Y, ID_CRED_R, SIGNATURE_2, EAD_2, C_R, CRED_R)) instead of
   >    TH_3 = H(TH_2, (PAD_2, G_Y, ID_CRED_R, SIGNATURE_2, EAD_2, C_R))

Similarly, we propose that the computation of TH_4 becomes
   >   TH_4 = H(TH_3, (PAD_3, ID_CRED_I, SIGNATURE_3, EAD_3, CRED_I)) instead of
   >   TH_4 = H(TH_3, (PAD_3, ID_CRED_I, SIGNATURE_3, EAD_3))

The philosophy behind this proposal is to make explicit the identity of the peer that authenticated themselves, even if those identities are not sent. (One can think of this as expanding TH to include the actual identity credentials, which the sent ID_CRED values hint to but do not uniquely determine). This is to simplify arguing agreement on the communication peer.


Motivation and justification:

- We analysed EDHOC in the Multi-Stage Key exchange model, following the work [Dow21] of Dowling et al.
- We suggest the change above as an improvement towards ensuring explicit authentication, which we observed when analysing the following excerpt from the draft (draft-14, section 3.5.3):

  "As stated in Section 3.1 of [I-D.ietf-cose-rfc8152bis-struct], applications MUST NOT assume that 'kid' values are unique, and several keys associated with a 'kid' may need to be checked before the correct one is found. Applications might use additional information such as 'kid context' or lower layers to determine which key to try first. Applications should strive to make ID_CRED_x as unique as possible, since the recipient may otherwise have to try several keys."

We modelled the above statement conservatively and considered that any ID_CRED might reference multiple identities and associated credentials. A potential consequence of this modelling is that there may be ambiguity about the identity of the peer who authenticated themselves, which needs careful consideration. For instance, if ID_CRED_R refers to both CRED_R and CRED_R', the initiator that tries multiple public keys could conclude that it is talking to R'. If this occurs, the protocol would still come to completion since the transcript hash won't change.

The standard unforgeability notion of signature schemes would not necessarily prevent such a scenario [1], and our analysis relies on strictly stronger notions. Concretely we require that signature schemes in EDHOC provide explicit ownership. In our model and proof, we had to rely on the relatively strong notion of "Malicious Universal Exclusive Ownership" to capture explicit authentication for EDHOC as currently specified. To the best of our knowledge, M-S-UEO was only studied and proven for Ed25519 as implemented in Libsodium[Bre20]. Therefore, relying on a weaker notion, "Universal Exclusive Ownership", is desirable.

Adding the credentials in the transcript hash would prevent identity mis-binding attacks since divergence in the identity of the authenticated host would lead to diverging transcript hashes and, therefore, different derived keys. Furthermore, we can rely on weaker notions of explicit ownership from a proof standpoint. Fortunately, Ed25519 provides explicit ownership [Bre20], and [Po05] already showed that the inclusion of the credentials along with the message in the signing process, as is done already in EDHOC, provides explicit ownership and prevents ambiguity.  For ECDSA, care must be taken in the implementation so that this construction guarantees exclusive ownership. Overall, we assume that CBOR encoding is unambiguous.

We would very much appreciate your feedback and thoughts on the discussion above, and we are happy to answer any questions you might have.


Kind regards,
Marc Ilunga (and Felix Günther)

[1] The need for a notion strictly stronger than standard EUF-CMA security for signature schemes also arises in the basic SIGMA protocol with the MAC under the signature. One needs that signature scheme is not only unforgeable for a random key but for all keys. Otherwise, an attacker may carry an identity mis-binding attack.
[Dow21] Dowling et al. "A Cryptographic Analysis of the TLS 1.3 Handshake Protocol", https://eprint.iacr.org/2020/1044.pdf<https://protect2.fireeye.com/v1/url?k=31323334-501cfaf3-313273af-454445554331-f6f777553d837518&q=1&e=eea177da-76f6-472b-9dd2-2652afccf5e1&u=https%3A%2F%2Feprint.iacr.org%2F2020%2F1044.pdf>
[Po05] Pornin and Stern, "Digital Signatures Do Not Guarantee Exclusive Ownership", https://link.springer.com/chapter/10.1007/11496137_10
[Bre20] Brendel et al. "The Provable Security of Ed25519: Theory and Practice", https://eprint.iacr.org/2020/823.pdf<https://protect2.fireeye.com/v1/url?k=31323334-501cfaf3-313273af-454445554331-507a7da6a666bbed&q=1&e=eea177da-76f6-472b-9dd2-2652afccf5e1&u=https%3A%2F%2Feprint.iacr.org%2F2020%2F823.pdf>