Re: [TLS] close_notify and TLS 1.3

Hubert Kario <hkario@redhat.com> Mon, 13 November 2017 11:37 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 E42D6126CD8 for <tls@ietfa.amsl.com>; Mon, 13 Nov 2017 03:37:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.92
X-Spam-Level:
X-Spam-Status: No, score=-6.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 fNIHuTTNWBuk for <tls@ietfa.amsl.com>; Mon, 13 Nov 2017 03:37:22 -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 3DF19124BFA for <tls@ietf.org>; Mon, 13 Nov 2017 03:37:22 -0800 (PST)
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 002A72CE92F; Mon, 13 Nov 2017 11:37:22 +0000 (UTC)
Received: from pintsize.usersys.redhat.com (unknown [10.43.21.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C20E570A1E; Mon, 13 Nov 2017 11:37:21 +0000 (UTC)
From: Hubert Kario <hkario@redhat.com>
To: tls@ietf.org
Date: Mon, 13 Nov 2017 12:37:15 +0100
Message-ID: <3025542.QI1GADQRnG@pintsize.usersys.redhat.com>
In-Reply-To: <A6C599ED-3F3D-462F-9B39-1FEF6A0B549B@apple.com>
References: <A6C599ED-3F3D-462F-9B39-1FEF6A0B549B@apple.com>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2265732.qeKQ7pAz3o"; micalg="pgp-sha512"; protocol="application/pgp-signature"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 13 Nov 2017 11:37:22 +0000 (UTC)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/0BDjwf-65_2UG0g5HyYIBUiFBoc>
Subject: Re: [TLS] close_notify and TLS 1.3
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 13 Nov 2017 11:37:24 -0000

On Saturday, 11 November 2017 10:21:11 CET David Schinazi wrote:
> Hello all,
> 
> Currently TLS 1.3 specifies close_notify in the same way that TLS 1.2 did.
> I believe that has issues and this might be the right time to fix them.
> The purpose of close_notify is to protect against data truncation attacks,
> each side is required to send close_notify before closing the write side of
> the transport connection so the other side knows that the data was not
> truncated. As such, close_notify only needs half-close semantics to prevent
> truncation.
> 
> However, the specification contains the following text:
> << Each party MUST send a “close_notify” alert before closing the write side
> of the connection, unless some other fatal alert has been transmitted. The
> other party MUST respond with a “close_notify” alert of its own and close
> down the connection immediately, discarding any pending writes. >>
> 
> This means that an application-layer client can't send a query then close
> their write transport when they know that they're done, because the server
> would terminate the TLS session before sending the reply. On top of this,
> when the server receives the close_notify, it may have already sent part of
> the reply (or wrote it to the socket send buffer) so the responding
> close_notify would in effect be inflicting a truncation attack on the
> client.
> 
> This doesn't make much difference for HTTP because clients already
> don't close their write transport after sending a reply, however having the
> option do do this could allow innovation in new protocols that can define
> the semantics of when they use close_notify. An example is DNS PUSH:
> https://tools.ietf.org/html/draft-ietf-dnssd-push
> <https://tools.ietf.org/html/draft-ietf-dnssd-push>
> 
> A proposal to solve this problem would be to give close_notify half-close
> semantics: we keep the requirements that a close_notify be sent before
> closing the transport, and that any data received after a close_notify is
> ignored, but we simply remove the requirement to immediately reply
> with a close_notify. This has the advantage that current implementations
> are already compliant but future ones can leverage this improvement.
> 
> What do you think? Is this worth discussing on Thursday?

what about alerts?

if you half-closed the connection for write and then received key-update, or 
message with an invalid tag, how are you supposed to react to it?

-- 
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