Re: [TLS] predictability of inputs in ESNI

Rob Sayre <sayrer@gmail.com> Fri, 01 November 2019 22:27 UTC

Return-Path: <sayrer@gmail.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 F2158120130 for <tls@ietfa.amsl.com>; Fri, 1 Nov 2019 15:27:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 VZEpf7T2gUuL for <tls@ietfa.amsl.com>; Fri, 1 Nov 2019 15:27:18 -0700 (PDT)
Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4FF9412088B for <tls@ietf.org>; Fri, 1 Nov 2019 15:27:18 -0700 (PDT)
Received: by mail-il1-x143.google.com with SMTP id t9so7676979ils.4 for <tls@ietf.org>; Fri, 01 Nov 2019 15:27:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X+Jm6Rsg5Ri/lP1StGZfuYXQCd9WGz6ldQ1z6dlcfb4=; b=QA4vSI6ayApfwWyU/pGF1LqWg0j5LQZzvx2upDkHHswapPQ/gJyjOIOEawB5hz3IsH S3FonKtLCuxd1MJMLXYy4qnBwxSsO4t7vW9JvOsYAVe97f76L4Z5UU8lXnRbinoQEUxW sXe8AbRErbsKJc2C1YKQLLVB2UG5H9EbdEhNy/MvCZeb7q+ORxTaUPh3NRUpswiq5OXJ 9kdczcjHkOgt2LC9W3I7Exx3zTft/O20n7d0zBuH1gQRj4s4JUiK9gjVfC7DQEqruBBi 1xTW/2wcYSwPSmV9qNn8/JtXFXrvd1LzuI33EKjcPdjvimGEwYcvdzpZ8XHrwIq1AypD MWkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X+Jm6Rsg5Ri/lP1StGZfuYXQCd9WGz6ldQ1z6dlcfb4=; b=RXmLLr5NvkTT4kV0E1s7Od5tr8cXEf3RD5KJlDWDrwddqOd46+8s3wiTQ4PYBA0cSf Om/nU80WGVaeZ6+/O6t1fVrp5zM+hXxbrk9X3cOGvr1WOGdhsFF3eXWhpgH0soo28Ofs BGxQaZ3qVeocXMEIv07Na3epcmaF2fdWJF32dC6cTS9nvBWB1ycM/fLotmlhQncAD3mE wVlBTF6oL3U12nTbiqWZD5ti0y1S5Z6eQEPJU0i9q8vpaouYxcvJokplQnXW4kNgRcYy ZOByK9iEKRks8LywNTJbJgVyHez/KkEbjtrgwL7TzD/fSgBtJAM+w6Yn2lVFV3QSinPa Dv/A==
X-Gm-Message-State: APjAAAW2a5iV37KqIkMW6VlCF39F/j3CzrYcvaWT0eOltW2M6TuGV1Bt NfuHkq7+J6YWPy+PTyUAawtyJ6D2KIYlYwMMqI5q3wY3
X-Google-Smtp-Source: APXvYqyAS42N/e5AWNyjsuN7p/uEjPe7aphI6RvyyvKTtezivPLFzKJZXaTiOiYucW+wJAPbU8vDvNMtGrVlAc/kyT4=
X-Received: by 2002:a92:48cf:: with SMTP id j76mr14662359ilg.189.1572647237400; Fri, 01 Nov 2019 15:27:17 -0700 (PDT)
MIME-Version: 1.0
References: <CAChr6SxZQkbLExmFYX8obdvMw_oFY2=k9Q3YUTUW67HUo74vLg@mail.gmail.com> <CABcZeBMA0gnsw+pqmx0vtYXvd6aAWxTR6yAybDRxut+XJQonbg@mail.gmail.com>
In-Reply-To: <CABcZeBMA0gnsw+pqmx0vtYXvd6aAWxTR6yAybDRxut+XJQonbg@mail.gmail.com>
From: Rob Sayre <sayrer@gmail.com>
Date: Fri, 1 Nov 2019 15:27:06 -0700
Message-ID: <CAChr6SyxdZvYm4xn2svMRrJuGAKPD=dg4dZmoMW4LEOLmboaFw@mail.gmail.com>
To: Eric Rescorla <ekr@rtfm.com>
Cc: "TLS@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000f13fca059650771d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/-wvlUCLtgEhstm8zi0n0av6lLug>
Subject: Re: [TLS] predictability of inputs in ESNI
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: Fri, 01 Nov 2019 22:27:20 -0000

On Fri, Nov 1, 2019 at 3:09 PM Eric Rescorla <ekr@rtfm.com> wrote:

>
>
> On Fri, Nov 1, 2019 at 2:28 PM Rob Sayre <sayrer@gmail.com> wrote:
>
>> Hi,
>>
>> I am not sure how important these findings are, but I've noticed three
>> instances of unnecessarily predictable inputs in ESNI:
>>
>> 1) Trailing padding after domain names are zeros.
>>
> 2) The checksum calculation seems to start with predictable version bytes
>> in draft -04, and in shipping implementations
>>
>
> I'm not aware of any cryptographic reason why these would be a problem.
> It's reasonably common practice to have partially fixed inputs to the TLS
> cryptographic functions (see, for instance, HMAC labels and the trailing
> padding 0s in the record protection). In general, if this sort of thing
> turns out to be a problem for some algorithm, we consider it to be a
> problem with the algorithm.
>

I see. But is there any reason to make these inputs predictably zero by
spec?



>
>
> 3) In practice, NSS inserts 8 bytes of zeros at the beginning of its AAD
>> input (<https://github.com/tlswg/draft-ietf-tls-esni/issues/190>)
>>
>
> I believe you're misreading the code. For historical reasons, the internal
> NSS TLS AEAD API prefixes the AAD argument with the sequence number. When
> we repurposed this code for ESNI, we just passed in a 0 sequence number.
> That value is stripped off and is not part of the AAD computation.
>

I see, so you're saying that NSS adds 8 bytes to the AAD input, and then
strips it off at some later point? I wouldn't exactly call that misreading.
Maybe something to fix?

thanks,
Rob