[TLS] Applied AEAD limits in (D)TLS, QUIC, OSCORE, ...

John Mattsson <john.mattsson@ericsson.com> Sun, 21 February 2021 18:15 UTC

Return-Path: <john.mattsson@ericsson.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3DD403A0E13; Sun, 21 Feb 2021 10:15:07 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.671
X-Spam-Level:
X-Spam-Status: No, score=-2.671 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.57, 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 w5bpuXKzUen1; Sun, 21 Feb 2021 10:15:05 -0800 (PST)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2088.outbound.protection.outlook.com [40.107.20.88]) (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 56BC33A0E15; Sun, 21 Feb 2021 10:15:04 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=asSKiXjkt63Ua+ednZ6u4tUB0hY+eSUTxCu3kQ4gCd1MjgbxUd0gTSKnvRi+Ouf1Ari3hsfQzLMe+3vASihm587lNMEDTOCtCrAgFrzBoW50OKVdkby77z+nVKJ3LlGvZ6gFEf5nU8UpH1kEtJAnapS6swHbrfservKKlaksUdFql87FNcQ/iJd+o0Eg7re/kaxe7RA1tF3yaOVjYaTC9Uw/yCqQ6Vt/VTMvUKYYxqE0at6Sa/tCv3R0qE5Lug8G9Gu7bxjuQ0o9pnRbZOtF/rbFb2f3UdsY95Gdp2djBSCGUv1wBFyVfAtL5tpFImGJFAmSrScq7CmnvtlDv7pCCw==
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=+ErzdvBdRX0iKO2/kfR6puMJaKktra/aWj8zL9Gismg=; b=KZA4UFmWxwjHjvNv2qQpWEqpfAUkP29lYrEbyw2B92U6bAonYUwn9VLC8HPb1qKoqAfrb7zGo1wH29JKPHtz7iauFmg0hHf6Btlmnv2Z9V1nFj0RFJ+mFhZN9HNNWXKd2k6JTrp1XLdOcVwFZiM5e80OvcBZlmSguxHHuP3xoWmSp2qOEDh9IYB5ne2OqInOIaAqEaySxcBMyFa/3EcHlseDslnfmCP+E1w0Ah/G0riwvZPXBz2C/3BlmNsyB2PyK6/yWLZy/AA7Zka1OQOv5MnBG8SCSotLsFiOrbjz7XlaC8N0qAHWSDI5WGYFeOSy/2i5Ju1Sle2wXgey2oXx4w==
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=+ErzdvBdRX0iKO2/kfR6puMJaKktra/aWj8zL9Gismg=; b=nqd17r9fOL0M/EjU+wXgKkMkmYDDB/wdPR1KcjsUjHzwZByflwX9CpoK0r4xugsyBaPEC4Zr/mMm4syOUnH87hzlTkUMlYM24aeveJg/e2uZU4LeYX7hWpCFx0egAVh5sKuZ3Rt+cgJDuayIrqwNGFjhFhoVqIAzRxe0gnGQ6XU=
Received: from (10.168.92.136) by HE1PR07MB4363.eurprd07.prod.outlook.com (20.176.164.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Sun, 21 Feb 2021 18:14:09 +0000
Received: from HE1PR0701MB3050.eurprd07.prod.outlook.com ([fe80::c555:6e47:970c:1268]) by HE1PR0701MB3050.eurprd07.prod.outlook.com ([fe80::c555:6e47:970c:1268%11]) with mapi id 15.20.3868.025; Sun, 21 Feb 2021 18:14:08 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: "cfrg@ietf.org" <cfrg@ietf.org>, "TLS@ietf.org" <TLS@ietf.org>, "quic@ietf.org" <quic@ietf.org>, "core@ietf.org" <core@ietf.org>
Thread-Topic: Applied AEAD limits in (D)TLS, QUIC, OSCORE, ...
Thread-Index: AQHXCH1YiGAcTblN70aS3TibPweiaw==
Date: Sun, 21 Feb 2021 18:14:08 +0000
Message-ID: <36004EDE-523A-42AC-83BF-33F05AA08C27@ericsson.com>
Accept-Language: en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/16.46.21021202
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: 14bdcb02-0095-4b07-916f-08d8d6947b91
x-ms-traffictypediagnostic: HE1PR07MB4363:
x-microsoft-antispam-prvs: <HE1PR07MB4363B950B791ED8416ABBC4C89829@HE1PR07MB4363.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: 1xoG+WhiCWVR6VuuTGlfpJ/eA8nm7MNg8i9UvGnV9t3fjT3MKHi/f0mQhzWR78Y9dKRIY4PegYwU8GKwBwdhBbLBf5a2VD3m8wmTqWraoLPOhCfOX7pluiLmQGWuzCZEVwTecPJbHsZzDm8RSMO7mSL0cX4tvmgaxdXbte6r8P5aZQUIWiUE8LnxVGk/j5YNieIuhRSzSKVFiYBx0wzd4DnezaRYFkrzN7d7WssuQgWo2XlnqhyXvev7SLg2f49ICVHsR67LqgddBpVz8za/zy/ZR+gZyTk4N96a/naCpQ6JAXCrMROR+lwt8wQ7smZ4U335tFgRk3f6Oy9nYmi50wRbxQKEURXeB7+F6XJknp/I+485zvscb7b4e7elGQH7NQtPqN3zK7QPNfGWDsXiYT9VkDb3mfkoV5rfkZX4CbWHgyoFQMuBVloR1icsp3lMD06ZCrlzQIbexsA2J/gwqoKGNvoBu/AlMm+KZ2qWQYpr6ZvzjgU6xk+4JwysHVtxKwZqfXbHn/+KTPMeZt+7I/qNo9wzCZzMNlTKWV98bi7eJ8M5vPy5OSGoVzx/cRpyUhY1SHT03UPYI7MXAjxj3g==
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:(4636009)(376002)(346002)(136003)(39860400002)(366004)(396003)(64756008)(26005)(66446008)(8676002)(5660300002)(66556008)(6506007)(66946007)(450100002)(478600001)(186003)(2906002)(76116006)(66476007)(33656002)(44832011)(71200400001)(83380400001)(316002)(6512007)(8936002)(110136005)(36756003)(86362001)(6486002)(2616005)(45980500001); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata: =?utf-8?B?ckFXTzJ2czRwb0RwakxENHFUQkEyT3VlcVlRODdaYXh0RDRvcDBKaEI4WERE?= =?utf-8?B?S1pSWXpHd0J2Q295NTZ4cUw0UDkvNWdjeG9kYWhSaXdnVmJZNllYR0hIQWRj?= =?utf-8?B?Zms4SzQySEoxb21wNWQzdWhCb0xrRmpEczlKYXpPczdJTzJ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RyaUZnWk5yYXVFZUx2QWxGOG1UcnZhZmMvM1dVT0Js?= =?utf-8?B?b3BMK2lUZVZmTHJENlV2ajJMeGxYVjhTVGlVL2phQ0R3d3NlN3UyanBiSW91?= =?utf-8?B?Y3FFdE1lcllqemI2WHkxYXVCVDNuei9adWpKTG9aSG1qTzV2NTRxUnllcUgv?= =?utf-8?B?bkpiRlJ6M0h2SDcyVGlydER2aE0zMnJrYWNtcHk2N1VKZ1NIck1QN2JZMFVp?= =?utf-8?B?eGFTUHk5ekNjWlpBcE53cnFYKytobUZLNjVrV3FMRFNXdXd0WGIxQWs5Wmxm?= =?utf-8?B?K1M4TER0SHNHMGE4UGc5UFJTZUoyZysrcUNwcHpSd2ZoaTVVM2drYTNMdElN?= =?utf-8?B?YlNLcmtDVFphNGFmNWdNN3JjckRMRk9lcDRzRTFKSmU1eStRdmtKUTVhM2Rn?= =?utf-8?B?cDZUNjJwRGU3QjYwdzIwVitKRE9PS2tiTlNDOHU5ZGFSNmlZdTF5V3B3Sit1?= =?utf-8?B?SkdYWllmbjRGaDNQM2VFMXRIZWtqUHI4VWc3enN0Uk5nWmEzNHdvRHJwVjJq?= =?utf-8?B?NUN5cE0ya2RqVEtIdVFKdS9wMVI5TkFRenFuMmRSa1RPRyttR2RHZXdBWDJQ?= =?utf-8?B?WWo5bm9zK3JldnpEV1BTUkpXU0VyQ1Rac0tqaksvRTBrWFlwYktxUWhiNzNP?= =?utf-8?B?Rkd2VXJPVjNqTTM1YUVVSElxaGNnUEFaRHlsVEFKMmc2bldSMzdwUUlqTFZo?= =?utf-8?Q?VuCOpNSTbW+UDGRSRXBTD+ESex67vOVsPyGLOzj?=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-ID: <8406E33DD5342042BC2264E7383FB64E@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: HE1PR0701MB3050.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 14bdcb02-0095-4b07-916f-08d8d6947b91
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2021 18:14:08.8356 (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: 9Kkl+GYiI6dvVQ24tBdr4mR8zpYMQvBurScQMn5ca+vv8Eh6mGx3NVuW1qr1Rhoy/AAW6tIrH2H5wJsRfKXU7+7Qj8pcWwmi4Qdpmxe/RQ8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB4363
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/ifECQatkeB-IeMWBYme67OnmPE4>
Subject: [TLS] Applied AEAD limits in (D)TLS, QUIC, OSCORE, ...
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Feb 2021 18:15:07 -0000

Hi,

I took a more detailed look at how (D)TLS and QUIC apply the advantage bounds in practice. If I have understood correctly, (D)TLS and QUIC set bounds on CA and IA for a single key (called CA_key and IA_key below) and then force a rekey when (or before) this limit is reached. 

I think it is great that the AEAD limit work has made it clear that counters for v and q as well as frequent rekeying are needed. However the process of limiting CA/IA per key does not seem like the right thing to do for a security protocol where each connection has many keys, communication between two parties can use many connections, and adversaries can often trick the parties to tear down the old connection and set up a new connection. I think a general process need to be designed a bit differently.

The concrete limits on v and q set by (D)TLS 1.3 and QUIC seem essential to keep the GCM CA, CCM CA, and the CCM success probability per forgery attempt low. The process used can however give a bit strange and misleading results as seen below:



Example 1: The ideal t-bit MAC

IA_key = v / 2^t

Using the process of setting an upper bound p = 2^-57 for a single key gives v <= 2^t * 2^-57 and following QUIC and DTLS you must re-key when that limit is reached, but this does not improve the security at all for the ideal MAC. The forgery probability of each packet is always 2^-t anyway.


Example 2: Sending 2^64 packets with ChaCha20-Poly1305 (l=2^10)

CA_key <= v * l / 2^103

a) Rekying every TLS packet gives CA_key <= 2^-93
b) Rekying every 2^36 TLS packet gives CA_key <= 2^-57
c) Rekying every 2^64 TLS packet gives CA_key <= 2^-27

These looks drastically different, but assuming the single-key bounds are tight, an adversary trying to attack the whole connection can do so with an advantage of 2^-27 (CA_key * number of keys) for all three options.


Example 3: IA bounderies per key.

DTLS 1.3 limits IA per key but does not limit the number of keys per connection. That means an attacker can make IA for the connection arbitrary high. Limiting the IA per connection does not help either if the assumption is that the parties just set up a new connection. The only possible thing to do is likely to limit the forgery success probability per forgery attempt.



It seems quite easy to see from the inequalities when rekeying lower the advantage for the connection as a whole. Looking at the the single-key inequalities. If the dominating term in the advantage it proportional to q^2 or v^2 it is beneficial to re-key also for small v and q.

AES-GCM CA <= ((s + q + 1)^2) / 2^129
AES-CCM CA <= (2l * q)^2 / 2^128
AES-CCM IA <= v / 2^128 + (2l * (v + q))^2 / 2^128

If the advantage is proportional to q or v, re-keying does not lower the advantage for the connection as a whole even for large v and q:

AES-GCM IA <= 2 * (v * (l + 1)) / 2^128
ChaCha  CA <= v * ((8 * l) / 2^106)
ChaCha  IA <= v * ((8 * l) / 2^106)

For AES-CCM with 64-bit tags, the advantage is dominated by the term 
v / 2^64 when v,q is small and the term (2l * (v + q))^2 / 2^128 when v,q are larger.

AES-CCM_8 IA <= v / 2^64 + (2l * (v + q))^2 / 2^128

Assuming l=2^8 and limits v = q = 2^40, the integrity advantage after 2^40 packages is IA <= 2^-24 + 2^-28 which is very close to the advantage IA = 2^-24 for an ideal 64-bit MAC after 2^40 forgery attempts. CCM_8 has much worse IA than the other algorithms because of it tag length, but rekeying frequently does not improve application security.



To summarize:

- For GCM CA, CCM CA, and CCM IA, counters for v and q and rekeying definitely needs to be mandated to keep the quadricly growing advantage bounded. I think the AEAD limit work is great in showing the need for this. Thank you!

- The limits in the DLTS 1.3 draft also puts clear bounds on CA for the whole connection, CA per protected message, and IA per forgery attempt, which is great. The CA advantage for an attacker for the whole connection varies quite a lot between the algorithms, but that is ok. The limits in DTLS 1.3 does not limit the IA for the whole connection.

- I think the process to put a limit on CA and IA for a single key does not give the wanted results for a security protocol with many keys per connection, many connection per peers, and attackers can force new connections. It might be better to look at "multi-key" security involving all the keys in the connection and calculating CA/IA for a connection with a fixed number of messages. The best approach is might however be to just look at "single-key" security and set maximum limits for CA / q and IA / v or something similar. 

- When using CCM_8, frequent rekeying does not significantly improve IA for a long connection. When v << 2^40 and q << 2^40 CCM_8 is very close to an ideal 64-bit MAC. Any 64-bit MAC does of course provide much worse IA than a good 128-bit MAC.

- Very frequent rekeying should be recommended, but maybe even more as a way to limit the effect of key leagage then to lower CA and IA. This put higher requirements (forward secrecy, post-compromise security) on which re-keying mechanism that is used.

- I don't see any need for DTLS 1.3 and QUIC to change except maybe being more allowing to CCM_8 for IoT applications. I think CORE should introduce counters for v and q and rekeying, but probably use a slightly different process. I see no need to frequently rekey CCM_8. CCM_8 is close to the ideal 64-bit MAC unless for high values of v and q. CCM_8 is ok as long as 64-bit MACs are acceptable, which I think they are, especially for constrained IoT radio, where sending 2^64 packets (4.3 billion messages per second for 68 years) is infeasible.

Cheers,
John