Re: [TLS] TLSv1.3 Cookies

Eric Rescorla <ekr@rtfm.com> Wed, 13 September 2017 15:13 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 24ABE133055 for <tls@ietfa.amsl.com>; Wed, 13 Sep 2017 08:13:40 -0700 (PDT)
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 pzx6iGU6e9DW for <tls@ietfa.amsl.com>; Wed, 13 Sep 2017 08:13:38 -0700 (PDT)
Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::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 D9C29132DFB for <tls@ietf.org>; Wed, 13 Sep 2017 08:13:37 -0700 (PDT)
Received: by mail-oi0-x236.google.com with SMTP id l74so3410077oih.1 for <tls@ietf.org>; Wed, 13 Sep 2017 08:13:37 -0700 (PDT)
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=dqBOdC6W0mVOESI3KqDztZcAXT0psFnhNCkA0B/N+8g=; b=BmiUTa0E0hj8RYSWnpq6gZ9lIPfcpkEqdjYDNnQ7sX85rZ6xJvKjv2djbtwo4LDSba H9qJ75wwjGSrcusRnA9HBG3rUX0+fd90507WvNMZbPtjhchXlYww6Y8K5/ltMj/gRCJf LOaH8HI3qqqqsbK9vNu2w6Sr8GUG6DXjiW3CHSkhwZC0r5hhxYg2HoHCvXhy7p9nBbu1 6h2NA3DKZUYjWakr/rrwsMJs+8bapqbJE7Qe9smAGApwWvGMDR/o6RfR321wWEVxwja7 goagGch5AFWWA8J2/lxZVwf1BksOhwJEmrLDXKuqq8xvD6kV6xvC6u1C8HTWa21nkpuG NFAQ==
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=dqBOdC6W0mVOESI3KqDztZcAXT0psFnhNCkA0B/N+8g=; b=btsitFJMxKk0NKyeJK8N1g4cnFHtOYllcBi3v31sdGlz3LALGJLcdNyo0br39TddxA qCCBB+BULak5lBzZPrlNZVxd43bKoUZcX+LbswQyFaKSfFF95478RPNpbsZISYWRf6Kd aCGGFhV/UEgitceFC7t8ZPJm3V9n55eTchpGSC3dNdIOP6ULyyjBDrXg6QHz6DoQSpfv LzDWSy3TusS2AXlVzVtcZD6VfwlVkZ/NMMCi2RfMYBDTQ2J0M0rsfiFGRiNUyZXQWYS5 heEiGUbFwTrXLTKmYkELd+7BUu6mUurAvWehIcDt7T4Sk3lFixrLqYxJglZzZJunY1NF qIcA==
X-Gm-Message-State: AHPjjUiZa3mNzJyd4P+GeR7lipcIKAYl2gjsauBE/+Bh7R+3zkB4OMEf 0Z/CCDfwiT2Se8sJQJmj1SALdt8b8gKIQMimQC0v+UmA
X-Google-Smtp-Source: AOwi7QCc2C7uWHzullSLwlP+xRMjaK4OUNPI7DB750gEGhjxLLGKvKbH+zgMCRQDtIqSoP1IHhbw92dTnwWE5BFA3lU=
X-Received: by 10.202.117.215 with SMTP id q206mr4275032oic.36.1505315617174; Wed, 13 Sep 2017 08:13:37 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.168.74.197 with HTTP; Wed, 13 Sep 2017 08:12:56 -0700 (PDT)
In-Reply-To: <CAMoSCWYXWJMkFAdrcy033_bjMZjRUiU-V5f8MkoTXyvDfw+z6A@mail.gmail.com>
References: <CAMoSCWYXWJMkFAdrcy033_bjMZjRUiU-V5f8MkoTXyvDfw+z6A@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Wed, 13 Sep 2017 08:12:56 -0700
Message-ID: <CABcZeBOS5C+oHchVqhOr-ob3t4c8dxqz5b_iUYiNcbXS5ZaCDQ@mail.gmail.com>
To: Matt Caswell <frodo@baggins.org>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a113e9a68a313770559139a6f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/gTAQJd9k65I2p09J-ev1PVeA1iw>
Subject: Re: [TLS] TLSv1.3 Cookies
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: Wed, 13 Sep 2017 15:13:40 -0000

On Wed, Sep 13, 2017 at 7:53 AM, Matt Caswell <frodo@baggins.org> wrote:

> I am looking at trying to implement the TLSv1.3 stateless cookie
> mechanism (in order to be able to support QUIC stateless retries).
>
> I am not clear how cookies are supposed to interact with early_data.
> Consider the scenario where a server is operating statelessly. Because
> there is no state each ClientHello looks like the first one it ever
> saw. The server only knows that a particular ClientHello is actually a
> ClientHello2 following an HRR because of the state held in the cookie.
>
> What happens when a client attempts to send early data to such a
> server? The server will process the ClientHello and determine that
> there is no cookie, sends back an HRR and then forgets all of its
> state and waits for the next ClientHello. However what it actually
> gets next is early_data. It does not know that that early data
> followed an earlier ClientHello (because it is stateless) so it does
> not know to skip the records. It just looks like illegal records so,
> presumably, it will respond with an alert.
>

It seems like there are three cases here:

1. TLS over TCP -- you won't do this statelessly, and so you can know to
dump
early data.
2. DTLS -- you can be stateless, but you don't terminate connections on
decrypt
error, so you just discard the packets as you would any other bogus packet.
3. QUIC -- the data looks like an unknown connection (you have dumped the
conn_id)
so you silently discard.



> I am also unclear what protects against cookies being replayed. If an
> attacker wishes to perform an amplification attack on a particular IP
> it awaits a legitimate ClientHello with a cookie coming from that IP
> and records it. It then replays that ClientHello with cookie to the
> server many times. The cookie looks valid to the server and it
> responds with its ServerHello, full Certificate chain etc back to the
> original IP. What have I missed here?
>

Yes. Cookies aren't generally intended to stop that kind of amplification,
they're just designed to prevent blind attacks on IPs you're not on-path
for. Note that QUIC has an additional defense here of requiring that
that ClientInitial be a certain minimum size. Note that if you are on-path
you can still get a lot of amplification even with TCP at the cost of
sending SYN, ACK, ClientHello...

-Ekr


> Thanks
>
> Matt
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>