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

Nick Harper <nharper@google.com> Wed, 22 March 2017 00:20 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 C53FE12940A for <unbearable@ietfa.amsl.com>; Tue, 21 Mar 2017 17:20:01 -0700 (PDT)
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 WnlbH-MCLwP7 for <unbearable@ietfa.amsl.com>; Tue, 21 Mar 2017 17:19:59 -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 AC91F126D85 for <unbearable@ietf.org>; Tue, 21 Mar 2017 17:19:59 -0700 (PDT)
Received: by mail-yw0-x234.google.com with SMTP id p77so119966852ywg.1 for <unbearable@ietf.org>; Tue, 21 Mar 2017 17:19:59 -0700 (PDT)
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=Oza5qEWmf5H3rgznKEw0G9IaJJc/+OQTMrLKBJfMvJA=; b=DTpLXOhSp5hwrUjLLGQ8wdTr2F5njqzv2U2HPtvQmbKOV0vFi2GodU0ved9C5xfh8G JRiPnmgCw3e4Tt6v5Erf8v6NUMLWjkauLX4pbuTBpp3CREDGzXiVmEUDt9uZbpK8k/Lg xYBDA4NgQP32UNvaOpv1Yh+Rcbzx5ppyrQeavZwkJqBl+WOxrU0mvHsFNbD7GEo2a48O f9P3o1bxgpO2/lNfhoTh8dUoujOaJyCFPJ27xGqxp4CKBy0coO/GF+4nS0YcBBbWSSMk yQrRlrAmidscDrUlR8zcFZWbs9MwBVi9+SgMF4y5LAUyrh46IA0jiBfxsNAEyRPM1np9 iZCQ==
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=Oza5qEWmf5H3rgznKEw0G9IaJJc/+OQTMrLKBJfMvJA=; b=qBE4iQncO8RmGNU3AMmtmoq51nBETZCBDXUmDb6SExgSjufZqClgG9UGmm2qRqDBlF 5SLevj+LYgZDLfFwuc/nc7s2f+qKS7HOAAfuIsqnQR8aEVwJ5Wyv5wBj0ENkLWCZt8YW D0MTzqAkdrnC5eJ6lxWpn9gVb9k7Ph/xF05HMA0RpkLF0GMZ3kKrkAq6dXKX+04rMu6k 7YsifEL20paW3YWf/bzIMsHipu0/Yet/1G/iZuXfW2EncSs9ViE/bRslu7bYBzYhj3bk rRa/Nhohrvi2OBGlC11rjMGAVCQLYgQ2RJDjM2VhUE9GHbAAN2Go1EXCjkrjjh9a+tKs x7Rg==
X-Gm-Message-State: AFeK/H05wpDLYgKh2cY6exYe1pG+Vhnx4ZzUkeILLDIwlJeXLPUpZX2BdaCeQVPH8aPHULyg1RZt1u5IhkyBk1Z/
X-Received: by 10.37.192.143 with SMTP id c137mr19185485ybf.195.1490141998759; Tue, 21 Mar 2017 17:19:58 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.65.5 with HTTP; Tue, 21 Mar 2017 17:19:38 -0700 (PDT)
In-Reply-To: <DM2PR21MB009145A3452CDBAF28D4A4678C3D0@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> <CACdeXi+YjLaXtoX47LtVK4Ay2y-mCOOraV46gbbbuQPL40ngXg@mail.gmail.com> <DM2PR21MB00910C83983BEE885B0E04288C560@DM2PR21MB0091.namprd21.prod.outlook.com> <CACdeXiLON5OAjfFCNsenCeaGV3a_LDoi17VAk=fSzF0YA5=f7Q@mail.gmail.com> <CACdeXiLNCrPSz0_hZSpQ6tsoHB7ryJ2dCnHjUYwu5vu5fO4XBg@mail.gmail.com> <SN1PR21MB0096D7426A4E230E284F0D058C560@SN1PR21MB0096.namprd21.prod.outlook.com> <CACdeXiKuzNh0fP9b-jEF82m-6mX+i04To96GMa_tFNcuznGn+A@mail.gmail.com> <DM2PR21MB00914BA07BA984E931B88FEB8C290@DM2PR21MB0091.namprd21.prod.outlook.com> <CACdeXiKQjaoAArLBcjRj+kUJUqH+f1bA5yeCCiQ6GMXzWJURBw@mail.gmail.com> <CABkgnnV0+vumfkZAMRZ_8q5pTkwf_CqhZ+deeVWdbF9SFaHoJw@mail.gmail.com> <DM2PR21MB0091DE5B213D2363FAF353CF8C280@DM2PR21MB0091.namprd21.prod.outlook.com> <CACdeXiKweRaZEKi4kqmPfUc2JLyZLGbp8tFRpkTfmJisPCMWRg@mail.gmail.com> <CACdeXiL6riBRb1-UDhVK-R5CvopzisJnYTRjWsvpimWA2G3DhQ@mail.gmail.com> <CABcZeBN2RhBsyj8_1F6bBnw9j10qdABwdZVdgwVcUr4Tf6sLtA@mail.gmail.com> <CACdeXiLZQSMxSqTPSHVqUwZomUpaMadUNYEEzF2to9Rx6nLMWQ@mail.gmail.com> <CABcZeBPvxX-8PuoV1oV-k5BnH3sjbWuuHfeAfh7FRhgtuVPkCQ@mail.gmail.com> <CACdeXi+rbsKf7zbpe4n49BUmj1ay0GSg_A48ZrAztKPY9+Fm2A@mail.gmail.com> <CABkgnnXBQEV4w7Zb=C9GE25-wp3oMVauKRZ21mCa+Qoby9XAPg@mail.gmail.com> <CABcZeBPpoex3axkkqgTRGWujGLbkC2GNqn+-50ipso3e9h8vJA@mail.gmail.com> <DM2PR21MB00910C42F25CCC08B9CC4D588C3D0@DM2PR21MB0091.namprd21.prod.outlook.com> <CACdeXiLJCrD=Z7Se5TJBzhE5JOjipWC+_gthBq_upRZyG=LSDg@mail.gmail.com> <DM2PR21MB009145A3452CDBAF28D4A4678C3D0@DM2PR21MB0091.namprd21.prod.outlook.com>
From: Nick Harper <nharper@google.com>
Date: Tue, 21 Mar 2017 17:19:38 -0700
Message-ID: <CACdeXiKqzPayvuvSy_FFwsgkiMMoBK38HiyE9xS31j=OYJ3S-g@mail.gmail.com>
To: Andrei Popov <Andrei.Popov@microsoft.com>
Cc: Eric Rescorla <ekr@rtfm.com>, IETF Tokbind WG <unbearable@ietf.org>, Martin Thomson <martin.thomson@gmail.com>
Content-Type: multipart/alternative; boundary="001a113912f480a923054b46b83c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/unbearable/wosVuyACgCu0axWcPloCqi0wxNY>
Subject: Re: [Unbearable] 0-RTT Token Binding: When to switch exporters?
X-BeenThere: unbearable@ietf.org
X-Mailman-Version: 2.1.22
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: Wed, 22 Mar 2017 00:20:02 -0000

On Tue, Mar 21, 2017 at 13:26 Andrei Popov <Andrei.Popov@microsoft.com>
wrote:

> Hi Nick,
>
> > Second replay of a TokenBinding message on a new connection (where the
> exporter is the same). This involves client malware, which can just as
> easily do private key operations to generate new TokenBinding messages to
> use on new connections. In TBPROTO, this is also possible, but it can only
> be done for active connections. With 0-RTT, the attacker can do this for
> connections that will be created up to 7 days in the future.
>
> A basic property of Token Binding is that malware can't export the token
> and successfully use it from another machine, as long as it cannot also
> export the TB key. This is a useful property, because it means that once
> the client malware is removed, the attack is immediately stopped. This
> property is not present when Token Binding is used in combination with
> 0-RTT, because it may be possible for the malware to export the TLS 1.3
> resumption secret.
>
> > If a server's threat model does not include client malware, i.e. the
> server is only using Token Binding to protect against attacks like XSS
> (e.g. to protect cookies without the HttpOnly flag set, or OAuth tokens),
> then enabling both TB and 0-RTT is perfectly reasonable.
> > Depending on the server's policies, even if client malware is in its
> threat model it still could find the 7 day window acceptable.
>
> Yes, I can easily imagine servers with such policies:).
> If the WG decides to allow the use of TB in combination with 0-RTT, then
> we should at least provide a way for the client to negotiate
> replayable/0-RTT TB option separately. This would allow a client to opt out
> of "replayable TB", while avoiding reauthentication on every connection. A
> server that receives a TLS 1.3 ClientHello advertising "proper TB" (and not
> "replayable TB") would either not negotiate Token Binding, or reject 0-RTT
> resumption with this client (and instead do a full handshake).
>
> A different client would be able to offer both "proper TB" and "replayable
> TB". Such a client would use the 0-RTT exporter throughout all 0-RTT
> connections, simplifying the rules... Would this work for you, Nick?
>

I agree that both the client and the server should be able to opt out of
"replayable TB" and be able to do "proper TB" or 0-RTT as they wish. I'd be
happy with providing a way for negotiating "replayable TB" separately from
"proper TB" and using the 0-RTT exporter for the entirety of 0-RTT
connections. I'm also ok with switching exporters for "replayable TB" if
the WG prefers that.

If we need to, I could propose a new TLS extension to negotiate "replayable
TB", which the client and server can use to negotiate that separately from
"proper TB". However, I think we can design it so that extension isn't
needed.

Let's consider a client that supports TB and 0-RTT, but would prefer to do
"proper TB", speaking to a server that supports "replayable TB". Before the
client can make a 0-RTT connection to the server, it needs to make a 1-RTT
connection to get a PSK it can use for resumption (and 0-RTT). When it
makes this 1-RTT connection, it learns that the server supports both 0-RTT
and TB, so the client could make a note not to use that PSK for 0-RTT (only
use it for 1-RTT resumption). Let's also consider a server that when it
issued the NewSessionTicket to the client did not support TB (so the client
is going to use this NST for a 0-RTT connection), but when the client
initiates the 0-RTT connection, the server now supports TB. One option is
for the client to exclude the TB extension from its ClientHello and send
the EarlyDataIndication extension. This results in the client making a
connection without TB even though both endpoints support it. Instead, the
client should send the TB extension and the EarlyDataIndication extension.
(The early data won't contain a bound token.) The server when choosing
whether or not to accept early data will follow rules that the result of
negotiating the TB extension must be the same on the resumed connection as
on the connection where the NST was issued, and since the NST was issued on
a connection without TB, but this connection would negotiate TB, the server
rejects early data and negotiates TB. (This is the same behavior for early
data as the ALPN and SNI extensions.)

A server that supports TB and 0-RTT, but not "replayable TB" can implement
this much easier. If a ClientHello arrives with only one of the two
extensions (TB or EarlyDataIndication), it negotiates whichever is present
as normal. If both are present, the server can unconditionally reject early
data if it negotiates TB.

I realize the client scenario is a bit complicated, and I might not have
explained it well. Does this provide a clear enough signal (for both sides)
between "proper TB" and "replayable TB"?

>
> Cheers,
>
> Andrei
>