Re: [TLS] close_notify and TLS 1.3

Eric Rescorla <ekr@rtfm.com> Mon, 13 November 2017 12:25 UTC

Return-Path: <ekr@rtfm.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 33FE6128959 for <tls@ietfa.amsl.com>; Mon, 13 Nov 2017 04:25:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.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 fdZDkE-t-HeG for <tls@ietfa.amsl.com>; Mon, 13 Nov 2017 04:25:49 -0800 (PST)
Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com [IPv6:2607:f8b0:4002:c05::236]) (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 09ED4124BFA for <tls@ietf.org>; Mon, 13 Nov 2017 04:25:49 -0800 (PST)
Received: by mail-yw0-x236.google.com with SMTP id d2so8706569ywb.11 for <tls@ietf.org>; Mon, 13 Nov 2017 04:25:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XdgaFkPDBHUin70YOjtsxuXPY4ckUqIuR7v4K3Rl4dQ=; b=QOI3Jd6EoWaTHKbB59uv+v8CmF2/gl3xntXRrW9GtlV6DWjB4ZxIeE0Ajvg5pXYLjq 8eh59LKB3ZqO6yxmBIRVhBmw6IwilGsinu8znIgxejB2zKbT7pnjkHpIV0de2HbYZxhe Xa65paut0ZRgZuMcdmAo9uFupa4fnZSP/11jFe3tG42HtEheAHTcyLNuLT7ty1rCQ+D4 BIxJmfsxlLoeFqpwqk3G4LGk8O6Grm6vn5szAkNYx+H3FVoRok95efoxr0tz62vQG3iq IX3rQKo83N/kYY5/RuakVe0rrIASNvnQankbZcxmyCELLGzzmaZ3uEmbxigLwpP+6dWl ZzPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XdgaFkPDBHUin70YOjtsxuXPY4ckUqIuR7v4K3Rl4dQ=; b=nxzrz+kqrnhPkvF8DIAssHwR1WGeH5jf4+lloWQpCQ5JBTB9YZbmEiHqW2QADdFGyF 5EgAQQ1/RGc05iS+n3/FwWpS47oNUK/tGRVStjIC47c6Dv3Eo486mHTiMvO63IrlpwgV iZawng3NDSHwD5KIsAC3nzWhHJWNCIF2jdPBgR3yYubOVu3dvKWOot2VaAXDG0inYkGl XAZN25TYeRjXWbzMkcvKLz5262RqDucEEo+Pcp3pHfeo+4FUbFqGU8gsQytEYYa3cKRh 9ITfYma2xeX5fgJN9b+0pQtCYF8i9fH4Qdq0IVCSSwzjc0thm0/ys7S9rfoD44cKdpeZ qqvQ==
X-Gm-Message-State: AJaThX6xdhqQ0rbagvOKayS7N8aDKifE6HcjlZD5+kwGkCIWpsAp+sNX Ktk5Oljis//tJ5jXKw/EnYAvazk9vyHV3Q2Sc0TDQQ==
X-Google-Smtp-Source: AGs4zMYNs+UiJYQIVYtySv7JsmPU2p7S/SVqr1eCthqIcX9Zmmi+Zq0uYSE6Hcqpp+kp0mjhydXwqKjA25s7dHuKxAk=
X-Received: by 10.13.192.196 with SMTP id b187mr5823950ywd.416.1510575948313; Mon, 13 Nov 2017 04:25:48 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.61.12 with HTTP; Mon, 13 Nov 2017 04:25:07 -0800 (PST)
In-Reply-To: <3025542.QI1GADQRnG@pintsize.usersys.redhat.com>
References: <A6C599ED-3F3D-462F-9B39-1FEF6A0B549B@apple.com> <3025542.QI1GADQRnG@pintsize.usersys.redhat.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Mon, 13 Nov 2017 12:25:07 +0000
Message-ID: <CABcZeBPczGOafQk-hokrxALWUwWAaegDoK_Ed+wcvxx9Jor5vw@mail.gmail.com>
To: Hubert Kario <hkario@redhat.com>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a114edd48ce5aae055ddc5e67"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/EsFKHbHzXyFiHdhu9DfPVtjVWgs>
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 12:25:51 -0000

On Mon, Nov 13, 2017 at 11:37 AM, Hubert Kario <hkario@redhat.com> wrote:

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


I assume you mean with update_requested set. in any case, you do nothing:

If the request_update field is set to "update_requested" then the receiver
MUST
send a KeyUpdate of its own with request_update set to
"update_not_requested" prior
to sending its next application data record.



> or
> message with an invalid tag, how are you supposed to react to it?
>

I think it would be fine to either silently tear down the connection or to
send an alert.

-Ekr


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