Re: [TLS] Server validation of a second ClientHello

Hubert Kario <hkario@redhat.com> Wed, 13 February 2019 12:12 UTC

Return-Path: <hkario@redhat.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 2831E12DDA3 for <tls@ietfa.amsl.com>; Wed, 13 Feb 2019 04:12:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.9
X-Spam-Level:
X-Spam-Status: No, score=-6.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 3m_7fdbAiqdX for <tls@ietfa.amsl.com>; Wed, 13 Feb 2019 04:12:44 -0800 (PST)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EDD45128CB7 for <tls@ietf.org>; Wed, 13 Feb 2019 04:12:43 -0800 (PST)
Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CEC6C059B7A; Wed, 13 Feb 2019 12:12:43 +0000 (UTC)
Received: from pintsize.usersys.redhat.com (unknown [10.43.21.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6328C5D6B3; Wed, 13 Feb 2019 12:12:42 +0000 (UTC)
From: Hubert Kario <hkario@redhat.com>
To: Eric Rescorla <ekr@rtfm.com>
Cc: Martin Thomson <mt@lowentropy.net>, "<tls@ietf.org>" <tls@ietf.org>
Date: Wed, 13 Feb 2019 13:12:34 +0100
Message-ID: <103341275.xSgb4icBHy@pintsize.usersys.redhat.com>
In-Reply-To: <CABcZeBNZJp+KiLEuaRZR0nO1PPEr_qcCJ9MypU104qTm6v8tcA@mail.gmail.com>
References: <1549596678.898774.1653407000.2B2ACE8E@webmail.messagingengine.com> <1549980018.5oto7EOJll@pintsize.usersys.redhat.com> <CABcZeBNZJp+KiLEuaRZR0nO1PPEr_qcCJ9MypU104qTm6v8tcA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart25838277.KSJJiFsezQ"; micalg="pgp-sha512"; protocol="application/pgp-signature"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 13 Feb 2019 12:12:43 +0000 (UTC)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/lDSQ2FJwiOnekkAWUNqTPcspDk8>
Subject: Re: [TLS] Server validation of a second ClientHello
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: Wed, 13 Feb 2019 12:12:46 -0000

On Wednesday, 13 February 2019 01:31:41 CET Eric Rescorla wrote:
> I concur with what I take to be MT's position here:
> 
> 1. The client is clearly prohibited from changing most elements of the CH
> (except for listed exceptions).
> 2. It's reasonable to check for and fail the handshake on any spec
> violation except those where checking is explicitly forbidden (e.g., Must
> Be Zero but Must be Ignored)
> 3. Nothing in the spec requires the server to check for this condition.

and what about values that technically can't change (as you noted yourself) 
but they do change and the server does use them?

you are not suggesting that which value will be used (from first or second 
CH), or if the connection will be aborted, to be implementation dependant 
*by design* , do you?
 
> -Ekr
> 
> On Tue, Feb 12, 2019 at 4:53 AM Hubert Kario <hkario@redhat.com> wrote:
> > On Monday, 11 February 2019 00:43:39 CET Martin Thomson wrote:
> > > On Fri, Feb 8, 2019, at 23:53, Hubert Kario wrote:
> > > > the cookie can be up to 2^16 bytes long, even if client sends all 50
> > > > extensions and spaces them with unknown extensions between, that's at
> > 
> > most
> > 
> > > > 20 bytes per extension = 1000 bytes total extra space needed in cookie
> > > > (32 bytes and 1600 bytes if you want to be very conservative)
> > > 
> > > Yeah, that's ridiculously large.  With quite a few extensions supported,
> > 
> > and
> > 
> > > many more unknown to us, the only way we might realistically ensure that
> > > the ClientHello doesn't change is to save a hash snapshot at every
> > 
> > boundary
> > 
> > > where the cookie extension might be inserted or where an extension might
> > 
> > be
> > 
> > > changed.  SHA-2 has a fairly small state to capture, but that's still
> > > nearly unbounded state.  With an amplification factor of up to 8,
> > > meaning
> > > that it could be more efficient to send the client its entire
> > > ClientHello
> > > in the cookie.
> > 
> > I definitely won't claim that it is easy or straight-forward to do, I do
> > claim
> > that it is possible. Yes, sometimes it may mean that sending the literal
> > CH in
> > cookie may be more bandwidth efficient.
> > 
> > And regarding the specific extension in question, to verify that it didn't
> > change between Hello's it is only 2 bytes extra in cookie. If that is too
> > much
> > already, I don't think that stateless HRR is something we will see in
> > implementations for years to come.
> > 
> > --
> > Regards,
> > Hubert Kario
> > Senior Quality Engineer, QE BaseOS Security team
> > Web: www.cz.redhat.com
> > Red Hat Czech s.r.o., Purkyňova 115, 612 00  Brno, Czech
> > Republic_______________________________________________
> > TLS mailing list
> > TLS@ietf.org
> > https://www.ietf.org/mailman/listinfo/tls


-- 
Regards,
Hubert Kario
Senior Quality Engineer, QE BaseOS Security team
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkyňova 115, 612 00  Brno, Czech Republic