Re: [Unbearable] 0-RTT Token Binding: When to switch exporters?

Nick Harper <nharper@google.com> Tue, 28 February 2017 19:53 UTC

Return-Path: <nharper@google.com>
X-Original-To: unbearable@ietfa.amsl.com
Delivered-To: unbearable@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5EFA8126579 for <unbearable@ietfa.amsl.com>; Tue, 28 Feb 2017 11:53:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.701
X-Spam-Level:
X-Spam-Status: No, score=-2.701 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 r6NreNT2Rem2 for <unbearable@ietfa.amsl.com>; Tue, 28 Feb 2017 11:53:07 -0800 (PST)
Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (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 39BC5129698 for <unbearable@ietf.org>; Tue, 28 Feb 2017 11:53:07 -0800 (PST)
Received: by mail-yw0-x22a.google.com with SMTP id l138so16536591ywc.0 for <unbearable@ietf.org>; Tue, 28 Feb 2017 11:53:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9hTKWrcfkIAeILYzXgnrZ/H04VEBkYSFYG/1+X62ESI=; b=b0s5JolKvpJib8jHTWoxcEUeXHGWAw3Z1+p8oMybNnR6hyzcEx/FeS3lv3feX98/GZ FbzlvTUcLmy6EL33R8o2amYtxkNlPN/jwdZlCPH9An/5WzKUKKxjAj2A4rQt7hAPFcJP Ip8adinAZmtjC91cJu6+8FltUUR561fu1xncFInNzO4TB55nsmS0yhv0PcsyuN7En16J 7hK+QKp+XM/gzaildc+/mu2lEwJsWqElxtS0lAYgMfqP/8iZISByECiFTNOskIAbHnT+ o9LGJ9owi8JuSL/CkBQZLflJu7to9twUw5a86gKSHkyRHAg5ar1ddbTcKQdNc68O8AKb bcqQ==
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=9hTKWrcfkIAeILYzXgnrZ/H04VEBkYSFYG/1+X62ESI=; b=G1DWLMDLGcf2QqnKOHsfBk2mjD0ObwraFP5/P6Xjh3IIOpvfldOozMlvEZ/GDu8kAn b+ff1eipjshBtywNmlkm2gnMwzH7u9Z6uXBFS+r60SwSmA7rMjsLGDXz1IOIe2O3zNJa VprrKFw2JMlnvvXxgL2Xvv9SbyYxdrlcPw5nef+wxbz3cWYSrK7UVjqn1gPKutYz+b5i 9NkUbGFzCD+hfnP6WGEyGCHywaNLwvH+X8HgTBACAeUyUoQsm6jj+lAHJP8CTRDdg9Mq Wu1NeqW8XJid26ZcGUjHzJ/729gnTZRFkf13kamHR7EypU+GQEqbxp2AuEHs90P+TUP7 HybA==
X-Gm-Message-State: AMke39kssXV8u8DpP8dEi/YVfLDfOOIY7WAbd8+ZtmzOLUPB+UGJapLMRTPJQ0pZ963GvS21NxnoecB6Uc6IJ15P
X-Received: by 10.129.75.204 with SMTP id y195mr252889ywa.320.1488311586293; Tue, 28 Feb 2017 11:53:06 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.65.5 with HTTP; Tue, 28 Feb 2017 11:52:45 -0800 (PST)
In-Reply-To: <DM2PR21MB0091E3F087E1AECA3A63A3788C560@DM2PR21MB0091.namprd21.prod.outlook.com>
References: <CACdeXiK2Hs=Kz_5OFryWR+9_t6nDL_p7NKjw=CwRsua_E5S9Mw@mail.gmail.com> <DM2PR0301MB084793F58146F8574BF36EE18C780@DM2PR0301MB0847.namprd03.prod.outlook.com> <CACdeXiJGcsTxrSWmd5BZrfoWTHhFF3+RisQFD628iYNMzZakhQ@mail.gmail.com> <CACdeXiJFe7-jM9qEnNB+Wp3joGxF_X1z+-dPywb9SRZuSNmAzQ@mail.gmail.com> <DM2PR21MB0091E3F087E1AECA3A63A3788C560@DM2PR21MB0091.namprd21.prod.outlook.com>
From: Nick Harper <nharper@google.com>
Date: Tue, 28 Feb 2017 11:52:45 -0800
Message-ID: <CACdeXi+YjLaXtoX47LtVK4Ay2y-mCOOraV46gbbbuQPL40ngXg@mail.gmail.com>
To: Andrei Popov <Andrei.Popov@microsoft.com>
Content-Type: multipart/alternative; boundary="001a113c9f5e6adae105499c8b4f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/unbearable/XJOqwO9hlOHvJ8zo5bUK4eUflZ8>
Cc: IETF Tokbind WG <unbearable@ietf.org>
Subject: Re: [Unbearable] 0-RTT Token Binding: When to switch exporters?
X-BeenThere: unbearable@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "\"This list is for discussion of proposals for doing better than bearer tokens \(e.g. HTTP cookies, OAuth tokens etc.\) for web applications. The specific goal is chartering a WG focused on preventing security token export and replay attacks.\"" <unbearable.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/unbearable>, <mailto:unbearable-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/unbearable/>
List-Post: <mailto:unbearable@ietf.org>
List-Help: <mailto:unbearable-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/unbearable>, <mailto:unbearable-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Feb 2017 19:53:09 -0000

On Tue, Feb 28, 2017 at 10:46 AM, Andrei Popov <Andrei.Popov@microsoft.com>
wrote:

> Hi Nick,
>
>
>
> Ø  Instead, I propose that if a server accepts the client's 0-RTT data,
> then the client uses the 0-RTT exporter for the entirety of the connection,
> and otherwise the client uses the exporter as already specified in TBPROTO.
> This still has decent security properties.
>
> My understanding is that an attacker who has a stolen bound token and TLS
> “Early Secret” (but not the corresponding TB private key), can successfully
> replay this token, alongside the attacker’s HTTP request, to a server that
> allows TLS 1.3 0-RTT. This type of replay is possible from multiple
> machines, for as long as the server is willing to accept 0-RTT connections
> based on the same TLS “Early Secret”. Is this correct?
>
>
>
> And this is of course in addition to a network attacker being able to
> replay a legitimate client’s request without change (no stealing of tokens
> or secrets required), unless the server takes extraordinary steps to
> prevent 0-RTT replay.
>

The attacker needs more than just the TLS "Early Secret". The attacker
needs the resumption PSK (effectively the Early Secret), but also the
ClientHello used for a 0-RTT connection and the Sec-Token-Binding header
sent on that 0-RTT connection. The attacker can then replay the stolen
bound token from that connection with the Sec-Token-Binding header on a new
connection that uses the same ClientHello, and an attacker-chosen HTTP
request. This replay is possible for as long as the server will accept that
specific ClientHello (which can be shorter than how long that server will
accept that resumption PSK, because the ClientHello includes the ticket age
when sending early data, and section 4.2.7 of tls13 says that the server
MUST validate that the ticket age is in a small tolerance of the time since
it was issued). I believe this is covered in section 6.2 of
https://tools.ietf.org/html/draft-ietf-tokbind-tls13-0rtt-00, and would be
happy to expand on that section to make things clearer. This is all in
addition to a network attacker being able to replay a 0-RTT request without
changing it.

This replay of a Sec-Token-Binding header for a 0-RTT request exists
regardless of when the client switches from the 0-RTT exporter to the
normal exporter (assuming that the server will accept the combination of
0-RTT + TB at all).

>
>
> Ø  A server accepting early data should accept any request sent in early
> data. The server can't sniff the early data to reject it if it contains a
> request it doesn't like (e.g. a POST request), because the early data could
> contain multiple requests (e.g. in the case of HTTP/2), and the server MUST
> process the ClientHello and immediately send the ServerHello - it cannot
> wait to process all of the client's early data.
>
> From the fact that the server sends the ServerHello after processing
> ClientHello, it does not follow that the server will accept every request
> sent as early data. The server can very well reject certain requests and/or
> terminate the handshake at any stage.
>

The server chooses whether or not to accept early data before it reads that
early data. This is the fact that I use to conclude that the server will
accept in early data any request. The server certainly could terminate the
handshake at any stage, but then it doesn't matter how we would do Token
Binding on that connection, because the connection is no more. TLS 1.3
doesn't provide any mechanism for a server to say "I don't like that that
request was sent in early data, please send it again now that the handshake
is complete", and I'm not aware of any application layer specs (e.g. HTTP)
that have such a mechanism. That's how I reached the conclusion that the
server won't reject some requests sent in early data.

>
>
> Cheers,
>
>
>
> Andrei
>
>
>