Potential Oracle Access to he peer's randomness

Florentin Rochet <florentin.rochet@uclouvain.be> Thu, 29 October 2020 12:04 UTC

Return-Path: <florentin.rochet@uclouvain.be>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 448D43A0CB9 for <quic@ietfa.amsl.com>; Thu, 29 Oct 2020 05:04:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, 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=uclouvain.be
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 JVMAkPOfQDsk for <quic@ietfa.amsl.com>; Thu, 29 Oct 2020 05:04:27 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2095.outbound.protection.outlook.com [40.107.20.95]) (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 032903A0CB2 for <quic@ietf.org>; Thu, 29 Oct 2020 05:04:26 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ul9MdiCCurT6ttSnFbMQvxUfER6JE4SzHtoFQQvZl6MFxC0sSYc9kdkGPha7SaZ5NpdOZU6JpRwWqW5I/5KN1VLWEInz2zMp/HEWWuUTBMMij4FwJT7EYmQNvmnXAoaYDHaNjJ057LIsTLO15kg6WAofuDxVjCdNQ3lPw9BHByqSQZ1Argu2eDq/oohlm7hcXQ9fYIJjnBKrof3ktgJiPpWgxJigpnzp/LmyJoWTU6YNdbqR8WR99bAlJb/D5h1UCIaKmHoEs2V8JmhjYU6iK2bDAPSCB0CJcLOt9z9e+60no0pN3g97uWTRHD+qjPjhrHG/YuweuSQFVf9CO2NYRw==
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=u3vjPicRrIb9CvoZGyn8G3sdQo4isB4XS2BNcg9gFVQ=; b=DzD+hkMQmbrBEB4VyCmNU4lKWR2qphSIBvInqJIDAg83huPlJ38k2onfXreCZDl4mqdo6psRJmirU9+jSyZ0EI8DU2Tu4ZlyiCUPKk1U/vWfijhxhvdnyk88fCX6tldfrPsoBrmLJQan9+SsmiePUzHEsUpKBEkuW9h094SsZIOuvoFFPGbkTwXEAteo1WUgu1MsrP5DWoh4+P2EbJNLSg09WQg5DahHQcjD369Zfboh8Oe6NupLL2xd9RfdLt9bYwXU9xBJYTo8Hcb+uXqlxRVPVWfdKp+R0yB3UiuwC5cuSsdvS8pICJRw8OTywSPMu3xJj87K2T8FPt+177iFsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uclouvain.be; dmarc=pass action=none header.from=uclouvain.be; dkim=pass header.d=uclouvain.be; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uclouvain.be; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u3vjPicRrIb9CvoZGyn8G3sdQo4isB4XS2BNcg9gFVQ=; b=voCvStqjMTMEhkI77+He0iaNq5lb2be7o6kZDMnK5ZTiigWlVFF5MtlO1svMxczoSwQyqXJAOC9AH+qqqQmEbxy7iHFkfnvRnz3FGrJ4jhleaLWpE9K9gG+rpQtOumwZtgZA7MdymlOMhs02erZ3tGdVwAoOvlWiNbiG30LFLpk=
Authentication-Results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=uclouvain.be;
Received: from DB6PR03MB3142.eurprd03.prod.outlook.com (2603:10a6:6:35::15) by DB6PR0302MB2760.eurprd03.prod.outlook.com (2603:10a6:4:ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.25; Thu, 29 Oct 2020 12:04:24 +0000
Received: from DB6PR03MB3142.eurprd03.prod.outlook.com ([fe80::70ee:f6db:2263:79c4]) by DB6PR03MB3142.eurprd03.prod.outlook.com ([fe80::70ee:f6db:2263:79c4%7]) with mapi id 15.20.3477.028; Thu, 29 Oct 2020 12:04:24 +0000
To: quic@ietf.org
From: Florentin Rochet <florentin.rochet@uclouvain.be>
Subject: Potential Oracle Access to he peer's randomness
Message-ID: <12aee905-9065-67d4-6f4d-7f7a7b8d9937@uclouvain.be>
Date: Thu, 29 Oct 2020 13:04:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-Originating-IP: [79.132.236.78]
X-ClientProxiedBy: AM8P189CA0013.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::18) To DB6PR03MB3142.eurprd03.prod.outlook.com (2603:10a6:6:35::15)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from [192.168.178.37] (79.132.236.78) by AM8P189CA0013.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Thu, 29 Oct 2020 12:04:24 +0000
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 44003e6d-7057-4d54-368b-08d87c02c6ee
X-MS-TrafficTypeDiagnostic: DB6PR0302MB2760:
X-Microsoft-Antispam-PRVS: <DB6PR0302MB2760DE161A13ACC09114731FE5140@DB6PR0302MB2760.eurprd03.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: Xtwx+jJdO/QMWTtrJ3ak/feT/AdOhke1IOPebhWrTjdtJ5eDdNryDXKaLPKJ86LqVHffHXZSitSF8vpU4NNYxM5EKrSmY4Olf5EizMfEyFMm3HKgEAegx9GIyhmMifcruwuPzIxIACxbfsqgh7A9iopupEYtEAGdR1HFnh47H25UCQYiNiIAU3JbjpvmqmAoU/ymTm2r6DFB7ipBJOEiU5jrfSxYwTgAPzT+RgMqW/M/e0VRlIEQvKPqtVbC3Ix6ihbxyu+teVFyoGyrhNpkJbqRe9lvOfZKxDHRR/kSGh+m7He/DgmkggTV7QYGokx/yVRDReCSI06XdBTnDo2OgG7hWtmilz0nDNlFKeJfWhHzYguCgM5iY6ROH9dGub1TPTFx+igvxWMM91+/ht0iSHJU+ajtKQameHeBVUhGRm33CTvfy9ESnjYi2Qzbm2eswAwDO8BDx9XUe5aLU7xMig==
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR03MB3142.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(376002)(39850400004)(346002)(396003)(44832011)(186003)(966005)(16526019)(83380400001)(52116002)(956004)(8676002)(31696002)(2616005)(5660300002)(31686004)(2906002)(6486002)(66946007)(66556008)(478600001)(16576012)(26005)(8936002)(86362001)(66476007)(316002)(786003)(36756003)(6916009)(43740500002); DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData: 3EeulnVrTh2oIsfuCN2lfDKHY9/m1wyp6wZGK47dznFk5e23t4+ip7LH7IE07AMXyONgq8zVrx/aP7ZbJ7nON/7ljLB1lNvAz2S9z5riXaON26x39EM+//I8Y+BbB7/Ft7EGe7pB+5uqm4DLbe97ilxdotZVgpmR6j6gU4e1i3uWidqr4o1ML7oOw3jEPre73tuppFWmZiYbE23ePu0G60J1l6exvfaDRYOSd3Gq1q84qNMk+9MAYl/MN9JR9EMmKL3ddf0PWbj4rSIn9hsm2sfWmBXZJAV9j+gV4H9dPHfITtBmFtubZa/MpfGygd+4ZAEDMxFzZhwZ0qKLL6t2jLqdMmt3LXqbGPI1I2op2Kbpc/imQJPA4qC9W44mUpKik5nsk1DvNj/fBLjtDArqakeFK/iEJ8B9QP7iZkSSbf8jvoVQVChgJ4Vi62xdDmL1kAaL6Xbu2/CUBAKX4KFaP9k0CwsAaesT/v02w/YIqSm1l1hNHMsPU5+c6FDs1MfPqj0ZoOjg4/m/DUmOVNIytomOcisPUUNUMkCQbKx+AB2TfNhrfrZPuqSivnMQJf4EQasiYOI/PeNb+eYJhxyZaFg8idcJfBhl8AXuFgjBY2sE1LF9t48ZooJJ+qoaYbz2Cs6tz5n+xuKYKQezdY/ttA==
X-OriginatorOrg: uclouvain.be
X-MS-Exchange-CrossTenant-Network-Message-Id: 44003e6d-7057-4d54-368b-08d87c02c6ee
X-MS-Exchange-CrossTenant-AuthSource: DB6PR03MB3142.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2020 12:04:24.4223 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7ab090d4-fa2e-4ecf-bc7c-4127b4d582ec
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VDywkV4vXN2Vf2o6EYBCQ0QLUT7luC9aaOqa9YnJ8jT/Wy+zyQZBQUSMQsb7YUHFSpkYfcl+NAcgTANmOSRxRoGN4lQijMOtFRvtC9+AcIY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0302MB2760
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/iLN_lEM1BuymNoU9_f2BtrPF8PQ>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Oct 2020 12:04:29 -0000

Dear QUIC designers,

I've been recently following the discussion on PATH_CHALLENGE/PATH_RESPONSE
attack scenarios, and for what it matters, I am also working on QUIC-like
capabilities above TCP. In my design, upon thinking on connection 
migration attack vectors,
I've been worried about another type of exploit. It is more critical in 
my opinion than
bandwidth amplification, and it also affects QUIC.

So, regarding QUIC, when a connection migration is initiated, from the 
current
specification[0], "An endpoint can migrate a connection to a new local 
address
by sending packets containing non-probing frames from that address." Sending
a non-probing packet would trigger a PATH_CHALLENGE message from the other
peer in an implementation following those specs to enter in path validation.

Essentially, it means that a client can, on-demand, trigger a PATH_CHALLENGE
from the server. In the specification[1], the PATH_CHALLENGE is 
containing an
unpredictable payload. More formally, it is meant to be 
indistinguishable from the output
of a random function. In practice, there are different ways to compute this
"unpredictable" payload, with critical differences.

The naive approach is to use unsecure randomness random(), and then 
putting it
in the PATH_CHALLENGE.

Another approach would be to use secure randomness to satisfy the current
specifications. That is, putting the output of SecureRandom() to the
PATH_CHALLENGE.

Ironically, the second approach is worrying me. That is, the current 
protocol
specifications may provide incentives to implement a protocol channel to 
allow
any client to query the server's PRNG output on-demand, and with probably a
consequent amount of randomness bandwidth.

We know from history that this is not a great idea, especially is the 
presence
of potential weaknesses within the PRNG (intentional or not). The most 
appealing
example is the backdoored Dual EC PRNG, for which the "backdoor holder" 
would
only need to bruteforce 16 bits to recover the internal state and 
predict any
new outcome. This is possible as soon as enough of the Duac EC output is
observed. In the case of Dual EC, and assuming that the PATH_CHALLENGE 
contains
16 bytes of randomness, the attacker would only need to trigger 3 
PATH_CHALLENGE
to predict the PRNG's next outcomes (assuming P256 base points).

Of course, Dual EC is an extreme case, for which the randomness could 
still be
available from other protocol materials (e.g., ConnIDs or keys), but we 
should
anyway avoid specifying a protocol that would offer Secure Randomness 
easily,
and not under the peer's control.

I suggest to specify what "unpredictability" means and how to compute it
and iterate over multiple "unpredictable" payloads. A goal would be to make
clear that we want as few as possible outputs from SecureRandom() to 
avoid for
e.g., a client to have an oracle access to the Server's PRNG. A solution 
could
be to use a simple Hash function and R, 16 bytes of randomness only 
known by the
server and global to all sessions. Then a PATH_CHALLENGE could contain, with
SESSION_SERCRET the shared derived secret of the session:

Challenge_1 = H(SESSION_SECRET || R)

Then, the next one:

Challenge_2 = H(Challenge_1 || R)
...
Challenge_i = H(Challenge_i-1 || R)

This maintains unpredictability, assuming a cryptographic hash function 
and R
secret. I guess that other constructions are possible as well, using 
HKDF for
example.

I would also suggest looking into other places for which "unpredictability"
is needed, and evaluate whether it could provide good oracle access to the
other peer, and if we can be more exigent into the specifications to 
make sure
to avoid those issues.

I have opened a issue to github to further discuss appropriate changes, 
if any are decided.

https://github.com/quicwg/base-drafts/issues/4314


Best regards,

Florentin

[0] 
https://github.com/quicwg/base-drafts/blob/master/draft-ietf-quic-transport.md#initiating-connection-migration-initiating-migration

[1] 
https://github.com/quicwg/base-drafts/blob/master/draft-ietf-quic-transport.md#initiating-path-validation