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

Andrei Popov <Andrei.Popov@microsoft.com> Wed, 22 March 2017 17:22 UTC

Return-Path: <Andrei.Popov@microsoft.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 B7F63129B4C for <unbearable@ietfa.amsl.com>; Wed, 22 Mar 2017 10:22:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.021
X-Spam-Level:
X-Spam-Status: No, score=-2.021 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_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.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 NtnT7jhTU-LI for <unbearable@ietfa.amsl.com>; Wed, 22 Mar 2017 10:22:04 -0700 (PDT)
Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0120.outbound.protection.outlook.com [104.47.37.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 86BBD129B49 for <unbearable@ietf.org>; Wed, 22 Mar 2017 10:22:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=z4wwSZxFVSKqVrjh1sKZYGFfeQTPkE+4ABDT9yaEhF4=; b=cJngaglFRl18dySFfULYvXq85QxAv5/NDciJ7yilfueRq49+WJ61XrwHXaqB5PVun0fYCqlakhXqxFXB5DrvzEcauhgQocNE6iO+HDA5qe5l55qaeiqQrYr149aBDV2DlvkxIRKhNcxvsW+cX/wwogr6Q/7aoDIHj5rcibTJbR4=
Received: from DM2PR21MB0091.namprd21.prod.outlook.com (10.161.141.14) by DM2PR21MB0090.namprd21.prod.outlook.com (10.161.141.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.0; Wed, 22 Mar 2017 17:22:02 +0000
Received: from DM2PR21MB0091.namprd21.prod.outlook.com ([10.161.141.14]) by DM2PR21MB0091.namprd21.prod.outlook.com ([10.161.141.14]) with mapi id 15.01.1005.003; Wed, 22 Mar 2017 17:22:02 +0000
From: Andrei Popov <Andrei.Popov@microsoft.com>
To: Nick Harper <nharper@google.com>
CC: Eric Rescorla <ekr@rtfm.com>, IETF Tokbind WG <unbearable@ietf.org>, Martin Thomson <martin.thomson@gmail.com>
Thread-Topic: [Unbearable] 0-RTT Token Binding: When to switch exporters?
Thread-Index: AQHSbdvurWwJUrGAZkyxVvys5avGZKE28kcggCd4oACAH07+gIABRECQgAAemICAAAhjEIAAGSoAgAAPAQCAAAUIUIAAII2AgAACEkCAAYowAIAAA7aAgAAAjZCAAAvMgIANyhiAgA+AzwCAACeWgIAAQYWAgAAFbwCAAC/PgIAAp9qAgABMl0CAACIyAIAACuwwgABOQwCAARq6IA==
Date: Wed, 22 Mar 2017 17:22:01 +0000
Message-ID: <DM2PR21MB0091B1E18B01CD7BC5E6DAAA8C3C0@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> <CACdeXiKqzPayvuvSy_FFwsgkiMMoBK38HiyE9xS31j=OYJ3S-g@mail.gmail.com>
In-Reply-To: <CACdeXiKqzPayvuvSy_FFwsgkiMMoBK38HiyE9xS31j=OYJ3S-g@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=microsoft.com;
x-originating-ip: [2001:4898:80e8:b::1d2]
x-microsoft-exchange-diagnostics: 1; DM2PR21MB0090; 7:6wopemtA5iUCXgn+PDk6m8l6UDPSyMQzFCbYsut/RHj3MzGDADVOR9T3ZjlEBoOtiNgObdI5pOSCC7odgjtcrBgi5a3gYiShK0uzCDD4nh30Vd3cO21pi5iLZo3x/Zl2jcs16GBiTzVjh+JETd2+H35PcaiodKtBYSdn7yxqYjLtf5N95pdyQCSUmwx2jGOGb8SpAa8MbHqjragAMV95WraZjISzebhadMLBoqW23CmfexVmDQNEpUgrEZPs0srrLAbgYocEBaC6Vs5k5bAYHQDC/j+CNqmDKTTCiAcelPE0Jip8BPjyu9hgY1CrISpTX0iPU05w4cEKmMFEGm7uXGmPeq9Fzi2Fb1I7zpUgD4o=
x-ms-office365-filtering-correlation-id: be3bc3c5-1a7f-427c-1238-08d47147f445
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081); SRVR:DM2PR21MB0090;
x-microsoft-antispam-prvs: <DM2PR21MB0090F1FB86038C5472F8A7848C3C0@DM2PR21MB0090.namprd21.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(211936372134217)(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006021)(93001021)(6055026)(61426038)(61427038)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123558025)(20161123555025)(6072148); SRVR:DM2PR21MB0090; BCL:0; PCL:0; RULEID:; SRVR:DM2PR21MB0090;
x-forefront-prvs: 02543CD7CD
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(39850400002)(39860400002)(39450400003)(39410400002)(39840400002)(24454002)(377454003)(77096006)(6436002)(110136004)(4326008)(86612001)(86362001)(6506006)(38730400002)(54906002)(99286003)(55016002)(2906002)(39060400002)(236005)(3280700002)(2900100001)(53936002)(54896002)(3660700001)(9686003)(6306002)(122556002)(6116002)(74316002)(54356999)(5660300001)(76176999)(50986999)(102836003)(790700001)(7736002)(93886004)(189998001)(33656002)(25786009)(8936002)(229853002)(8676002)(7696004)(81166006)(6916009)(2950100002)(6246003)(10090500001)(8990500004)(10290500002)(5005710100001)(53546009)(19609705001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR21MB0090; H:DM2PR21MB0091.namprd21.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_DM2PR21MB0091B1E18B01CD7BC5E6DAAA8C3C0DM2PR21MB0091namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2017 17:22:01.6453 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR21MB0090
Archived-At: <https://mailarchive.ietf.org/arch/msg/unbearable/5D3UtmgOb4e4Wkm-faeuDinKPfQ>
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 17:22:08 -0000

I haven’t thought through all the permutations of TLS 1.3, but it seems that you’re right and it is possible for a client to only use “proper TB” without negotiating “replayable” vs. “proper” TB options, by keeping some extra state associated with the resumption secret. If the WG decides to go ahead with 0-RTT TB, then we should at least describe the behavior of a client and server that avoids mixing TB with 0-RTT. This will be particularly important for clients and servers that care about malware enough to support TB key attestation.

Cheers,

Andrei

From: Nick Harper [mailto:nharper@google.com]
Sent: Tuesday, March 21, 2017 5:20 PM
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>
Subject: Re: [Unbearable] 0-RTT Token Binding: When to switch exporters?


On Tue, Mar 21, 2017 at 13:26 Andrei Popov <Andrei.Popov@microsoft.com<mailto: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