Re: [TLS] Security review of TLS1.3 0-RTT

Colm MacCárthaigh <colm@allcosts.net> Wed, 03 May 2017 05:34 UTC

Return-Path: <colm@allcosts.net>
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 445A7129B5A for <tls@ietfa.amsl.com>; Tue, 2 May 2017 22:34:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 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] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=allcosts-net.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 UajjgGfBSFEk for <tls@ietfa.amsl.com>; Tue, 2 May 2017 22:34:56 -0700 (PDT)
Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::234]) (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 8B43A12940F for <tls@ietf.org>; Tue, 2 May 2017 22:32:52 -0700 (PDT)
Received: by mail-yw0-x234.google.com with SMTP id 203so79817531ywe.0 for <tls@ietf.org>; Tue, 02 May 2017 22:32:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=allcosts-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ndiCDVom8qMsJB3TPqyAJCJZH9OIyZS5yeTBYgxQisI=; b=TyUzlrpgqrThD+dwPzA3E9ebm7Dx7TFEAnEi4JrRCLGKqmZRKPlnFZizheMGmTDmPT 1UqQxNRr0brrLiyQqDuPrPchwjfGEn/xGwBmtsR5IdLPgw/9WVqGfEgzCmWPyDKmCj0/ 331Z6q77zL+HIKWJr41i/yCP/PKtSsc+H0ziBcQNntHV1xSPnu1FfAstgkv0pKYQn+VJ cqenxaaJskDxmsMIFeEgXXKuYiy0dE8haWHhFAyWOODXN1Ww37fc7Fbn0LPSxFU7uXtR vHoOBCi7cops+4O7BUVOCDmWtNhdgBlRpbtMeQizhJI8av3hQQME73I0Ag3EE17RuogN SI5w==
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=ndiCDVom8qMsJB3TPqyAJCJZH9OIyZS5yeTBYgxQisI=; b=uA8GuXG7dPaCif6BoxdibdHdmPcHQZ6d+zewROTRdqsJUbJkM+wT1Fg6UtT5PqOyt9 6J1pe7OGpwGstkSWy9RVfrbpcS880eiL0AK7Lb3W1ydhCeTVWh538W7Qey1YLe25OOjS YA88zMaG51tMu0Fj7UYTyxSBZkE8owPfwnJkT7jUma8UjZ50NZ2x8Rn5GcSDGZ94/Fpl QFcGCZf/2Dj4IYWldxDpYybl620VPPchnQwILtvYgHGKX+JpJVEfw6wGZThCP1m5f+SX 1OnZ/32XfhNjztVsc1o2Hf7nL+4Sy/k2O+gWDT8f1m6XBsfDkvqIz102w9XS+55r4Vus XufA==
X-Gm-Message-State: AN3rC/75N65TNbJapCpU/iaSFRTLzHfkZO+4oKJuMVjAh9Vvk1i/xLgG uWm15xFQuZWMagE1BWpIMp7HPoSDCf44
X-Received: by 10.129.53.207 with SMTP id c198mr30351366ywa.14.1493789571660; Tue, 02 May 2017 22:32:51 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.57.67 with HTTP; Tue, 2 May 2017 22:32:50 -0700 (PDT)
In-Reply-To: <CABcZeBPP1j5O_4d=fjN4XF65OSgg=8YSRFbs3-PKTGNQZXwvNw@mail.gmail.com>
References: <CAAF6GDcKZj9F-eKAeVj0Uw4aX_EgQ4DuJczL4=fsaFyG9Yjcgw@mail.gmail.com> <CABcZeBPP1j5O_4d=fjN4XF65OSgg=8YSRFbs3-PKTGNQZXwvNw@mail.gmail.com>
From: Colm MacCárthaigh <colm@allcosts.net>
Date: Tue, 02 May 2017 22:32:50 -0700
Message-ID: <CAAF6GDd5TkbmwCD2Ucoi7VPR7h+EcO40=KsDwvwKuT-Am8cQUA@mail.gmail.com>
To: Eric Rescorla <ekr@rtfm.com>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a1142e7ecc9d950054e97fcb4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/Stllc8n-XCxGNADgjQ5Rva4ciCk>
Subject: Re: [TLS] Security review of TLS1.3 0-RTT
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, 03 May 2017 05:34:58 -0000

On Tue, May 2, 2017 at 8:17 PM, Eric Rescorla <ekr@rtfm.com> wrote:

> Colm,
>
> Thanks for your review. Interesting stuff.
>

Thanks too for taking the time to read it.


> Scrolling ahead to the recommendations, I see you have:
>
> * Require implementations to robustly prevent Ticket re-use for 0-RTT.
>
> This seems like a good idea. I think it's arguable that we got a bit
> nihilistic about this, and as you say, you can do a pretty good job of
> reducing replay within a given data center using some local
> anti-replay mechanism. I would tend to think that a strong SHOULD is
> what you want here, as a MUST is going to be a lot more like a 6919
> MUST (BUT WE KNOW YOU WON'T).
>

A provider choosing to allow replays to their own applications is on them,
they can own the stack top to bottom, take the risk, have a response team
handle attack events, etc ... That's a legitimate case for "SHOULD", there
are exceptions to everything.

But at the same time, what I think we should care most about is the
interoperability case. So for example, if a TLS library, a web server, or
an upstream CDN, can break the assumptions of a down-stream service or
application, that's where we'll see CVEs cropping up. In those cases, I
think the problem is the upstream component, breaking long-held and fair
assumptions. In those cases, it feels like a "MUST".

I'm not sure how to strike a balance, so chose the more secure option.


> I understand from your document and our previous conversation that you
> believe single-use tokens are easier to implement on the server side,
> but I'm not sure I really follow your argument. If you want to provide
> some short text on that that we can all agree on, then I think we
> could incorporate this as well.
>

It's probably not important to get into a single-use token cache in the
draft itself. That was just intended for implementors. One thing that makes
a single-use cache slightly easier to implement is that reads and writes to
keys need not be sequenced relative to any kind of checkpoint.

With a strike register, some kind of checkpoint process is needed. A simple
one is to start with a clean slate, accept only writes for a time period
equivalent to the replay window, and then go read-write. But that kind of
modality is, I think, required. With a single-use cache, it need only
sequence the reads and writes to individual keys. Though it must store much
much more state, so there are different trade-offs to consider.


> * Partial mitigation for Gilmor attacks: deliberately duplicate 0-RTT
>   data
>
> This seems like some sort of extra-grease, but I'm kinda skeptical
> that anyone is going to do it. Perhaps it would be useful to add it to
> draft-ietf-tls-grease?
>

Grease is a good place for it for sure.


> * Require TLS proxies to operate 0-RTT transitively
>
> I've read this several times but I have to admit I don't understand
> it. Do you think you could rephrase?
>

What's in the draft is that there should be an application profile and that
TLS implementations should provide applications with special functions to
tell apart the early and regular data. The problem is that doesn't work
with TLS proxies (like CDNs) ... because the proxies are re-combulating the
data as a single stream to the origin. So the origin can't tell which data
was replayable.

If 0-RTT replay is tolerated, I think that's a big gnarly problem leading
to CVEs. If we prevent replay by other means, like the strike register,
it's not so big a deal.

What I was suggesting was that such proxies always send an outgoing 0-RTT
section to the origin that exactly lines up with the 0-RTT section that
came in on the front end. It's quite hard to make that all work; the CDN
would have to accept 0-RTT only if the origin also does. But I can't see
another way that really works, especially for Layer 4 accelerators. Again,
if 0-RTT replay is forbidden, not nearly as big a deal.


> The following doesn't appear in your recommendations, but I think you
> also think we should:
>
> * Adopt something like PR#998 to make each PSK_id correspond to a
>   different PSK even when they are issued on the same connection.
>

Big +1 to this.


> For the reasons Viktor indicated, I tend to think this is inadvisable.
>

I've been thinking more about this. What if tickets are single-use when
used with 0-RTT, but otherwise allowed for multiple uses? If that's
acceptable, then could we drop the age from tickets purely used for
resumption. That way the age would only appear on tickets that are used
once.

I think that way we get everything.

* Remove ticket_age
>
> This doesn't seem like a good idea: if you are implementing a strike
> register, you want to use ticket_age to help distinguish "fresh" from
> "unknown state". I.e., the ticket_age + the ticket issue time allows
> you to determine approximately when a CH was sent, and any CH that
> is significantly older or newer than now is forced back into 1-RTT.
>

Yep, I was wrong about this, I get it now, and that makes sense.

-- 
Colm