draft-ietf-tokbind-https-02.txt   draft-ietf-tokbind-https-03.txt 
Internet Engineering Task Force A. Popov Internet Engineering Task Force A. Popov
Internet-Draft M. Nystroem Internet-Draft M. Nystroem
Intended status: Standards Track Microsoft Corp. Intended status: Standards Track Microsoft Corp.
Expires: April 17, 2016 D. Balfanz, Ed. Expires: September 22, 2016 D. Balfanz, Ed.
A. Langley A. Langley
Google Inc. Google Inc.
October 15, 2015 J. Hodges
Paypal
March 21, 2016
Token Binding over HTTP Token Binding over HTTP
draft-ietf-tokbind-https-02 draft-ietf-tokbind-https-03
Abstract Abstract
This document describes a collection of mechanisms that allow HTTP This document describes a collection of mechanisms that allow HTTP
servers to cryptographically bind authentication tokens (such as servers to cryptographically bind authentication tokens (such as
cookies and OAuth tokens) to a TLS [RFC5246] connection. cookies and OAuth tokens) to a TLS [RFC5246] connection.
We describe both _first-party_ as well as _federated_ scenarios. In We describe both _first-party_ as well as _federated_ scenarios. In
a first-party scenario, an HTTP server issues a security token (such a first-party scenario, an HTTP server issues a security token (such
as a cookie) to a client, and expects the client to send the security as a cookie) to a client, and expects the client to send the security
skipping to change at page 2, line 4 skipping to change at page 2, line 6
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 17, 2016.
This Internet-Draft will expire on September 22, 2016.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3
2. The Token-Binding Header . . . . . . . . . . . . . . . . . . 3 2. The Sec-Token-Binding Header . . . . . . . . . . . . . . . . 4
3. Federation Use Cases . . . . . . . . . . . . . . . . . . . . 4 3. Federation Use Cases . . . . . . . . . . . . . . . . . . . . 4
3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 4
3.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . 4 3.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3. HTTP Redirects . . . . . . . . . . . . . . . . . . . . . 6 3.3. HTTP Redirects . . . . . . . . . . . . . . . . . . . . . 6
3.4. Negotiated Key Parameters . . . . . . . . . . . . . . . . 7 3.4. Negotiated Key Parameters . . . . . . . . . . . . . . . . 7
4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 3.5. Federation Example . . . . . . . . . . . . . . . . . . . 7
4.1. Security Token Replay . . . . . . . . . . . . . . . . . . 7 4. Security Considerations . . . . . . . . . . . . . . . . . . . 10
4.2. Privacy Considerations . . . . . . . . . . . . . . . . . 7 4.1. Security Token Replay . . . . . . . . . . . . . . . . . . 10
4.3. Triple Handshake Vulnerability in TLS . . . . . . . . . . 7 4.2. Triple Handshake Vulnerability in TLS . . . . . . . . . . 10
4.4. Sensitivity of the Token-Binding Header . . . . . . . . . 8 4.3. Sensitivity of the Sec-Token-Binding Header . . . . . . . 10
4.5. Securing Federated Sign-On Protocols . . . . . . . . . . 9 4.4. Securing Federated Sign-On Protocols . . . . . . . . . . 11
5. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 5. Privacy Considerations . . . . . . . . . . . . . . . . . . . 13
5.1. Normative References . . . . . . . . . . . . . . . . . . 11 5.1. Scoping of Token Binding Keys . . . . . . . . . . . . . . 13
5.2. Informative References . . . . . . . . . . . . . . . . . 12 5.2. Life Time of Token Binding Keys . . . . . . . . . . . . . 14
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.1. Normative References . . . . . . . . . . . . . . . . . . 14
6.2. Informative References . . . . . . . . . . . . . . . . . 15
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15
1. Introduction 1. Introduction
The Token Binding Protocol [TBPROTO] defines a Token Binding ID for a The Token Binding Protocol [TBPROTO] defines a Token Binding ID for a
TLS connection between a client and a server. The Token Binding ID TLS connection between a client and a server. The Token Binding ID
of a TLS connection is related to a private key that the client of a TLS connection is related to a private key that the client
proves possession of to the server, and is long-lived (i.e., proves possession of to the server, and is long-lived (i.e.,
subsequent TLS connections between the same client and server have subsequent TLS connections between the same client and server have
the same Token Binding ID). When issuing a security token (e.g. an the same Token Binding ID). When issuing a security token (e.g. an
HTTP cookie or an OAuth token) to a client, the server can include HTTP cookie or an OAuth token) to a client, the server can include
skipping to change at page 3, line 38 skipping to change at page 4, line 5
Token Binding ID that the client is using with a _different_ server Token Binding ID that the client is using with a _different_ server
than the one that the TokenBindingMessage is sent to. This is useful than the one that the TokenBindingMessage is sent to. This is useful
in federation scenarios. in federation scenarios.
1.1. Requirements Language 1.1. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
2. The Token-Binding Header 2. The Sec-Token-Binding Header
Once a client and server have negotiated the Token Binding Protocol Once a client and server have negotiated the Token Binding Protocol
with HTTP/1.1 or HTTP/2 (see The Token Binding Protocol [TBPROTO]), with HTTP/1.1 or HTTP/2 (see The Token Binding Protocol [TBPROTO]),
clients MUST include the Token-Binding header in their HTTP requests. clients MUST include the Sec-Token-Binding header in their HTTP
The ABNF of the Token-Binding header is: requests. The ABNF of the Sec-Token-Binding header is:
Token-Binding = "Token-Binding" ":" [CFWS] EncodedTokenBindingMessage Sec-Token-Binding = "Sec-Token-Binding" ":" [CFWS] EncodedTokenBindingMessage
The EncodedTokenBindingMessage is a web-safe Base64-encoding of the The EncodedTokenBindingMessage is a web-safe Base64-encoding of the
TokenBindingMessage as defined in the TokenBindingProtocol [TBPROTO]. TokenBindingMessage as defined in the TokenBindingProtocol [TBPROTO].
The TokenBindingMessage MUST contain a TokenBinding with The TokenBindingMessage MUST contain a TokenBinding with
TokenBindingType provided_token_binding, which MUST be signed with TokenBindingType provided_token_binding, which MUST be signed with
the Token Binding key used by the client for connections between the Token Binding key used by the client for connections between
itself and the server that the HTTP request is sent to (clients use itself and the server that the HTTP request is sent to (clients use
different Token Binding keys for different servers). The Token different Token Binding keys for different servers). The Token
Binding ID established by this TokenBinding is called a _Provided Binding ID established by this TokenBinding is called a _Provided
skipping to change at page 4, line 38 skipping to change at page 4, line 50
that token to the TLS connection between the client and a Relying that token to the TLS connection between the client and a Relying
Party. Party.
In this section we describe mechanisms to achieve this. The common In this section we describe mechanisms to achieve this. The common
idea among these mechanisms is that a server (called the _Token idea among these mechanisms is that a server (called the _Token
Consumer_ in this document) gives the client permission to reveal the Consumer_ in this document) gives the client permission to reveal the
Provided Token Binding ID that is used between the client and itself, Provided Token Binding ID that is used between the client and itself,
to another server (called the _Token Provider_ in this document). to another server (called the _Token Provider_ in this document).
Also common across the mechanisms is how the Token Binding ID is Also common across the mechanisms is how the Token Binding ID is
revealed to the Token Provider: The client uses the Token Binding revealed to the Token Provider: The client uses the Token Binding
Protocol [TBPROTO], and includes a TokenBinding structure in the Protocol [TBPROTO], and includes a TokenBinding structure in the Sec-
Token-Binding HTTP header defined above. What differs between the Token-Binding HTTP header defined above. What differs between the
various mechanisms is _how_ the Token Consumer grants the permission various mechanisms is _how_ the Token Consumer grants the permission
to reveal the Token Binding ID to the Token Provider. Below we to reveal the Token Binding ID to the Token Provider. Below we
specify one such mechanism, which is suitable for redirect-based specify one such mechanism, which is suitable for redirect-based
interactions between Token Consumers and Token Providers. interactions between Token Consumers and Token Providers.
3.2. Overview 3.2. Overview
In a Federated Sign-On protocol, an Identity Provider issues an In a Federated Sign-On protocol, an Identity Provider issues an
identity token to a client, which sends the identity token to a identity token to a client, which sends the identity token to a
skipping to change at page 6, line 19 skipping to change at page 6, line 32
When a Token Consumer redirects the client to a Token Provider as a When a Token Consumer redirects the client to a Token Provider as a
means to deliver the token request, it SHOULD include a Include- means to deliver the token request, it SHOULD include a Include-
Referer-Token-Binding-ID HTTP response header in its HTTP response. Referer-Token-Binding-ID HTTP response header in its HTTP response.
The ABNF of the Include-Referer-Token-Binding-ID header is: The ABNF of the Include-Referer-Token-Binding-ID header is:
Include-Referer-Token-Binding-ID = "Include-Referer-Token-Binding-ID" ":" Include-Referer-Token-Binding-ID = "Include-Referer-Token-Binding-ID" ":"
[CFWS] %x74.72.75.65 ; "true", case-sensitive [CFWS] %x74.72.75.65 ; "true", case-sensitive
Including this response header signals to the client that it should Including this response header signals to the client that it should
reveal the Token Binding ID used between the client and the Token reveal, to the Token Provider, the Token Binding ID used between
Consumer to the Token Provider. In the absence of this response itself and the Token Consumer. In the absence of this response
header, the client will not disclose any information about the Token header, the client will not disclose any information about the Token
Binding used between the client and the Token Consumer to the Token Binding used between the client and the Token Consumer to the Token
Provider. Provider.
When a client receives this header, it should take the TokenBindingID
of the provided TokenBinding from the referrer and create a referred
TokenBinding with it to include in the TokenBindingMessage on the
redirect request. In other words, the Token Binding message in the
redirect request to the Token Provider includes one provided binding
and one referred binding, the latter constructed from the binding
between the client and the Token Consumer.
If the Include-Referer-Token-Binding-ID header is received in
response to a request that did not include the Token-Binding header,
the client MUST ignore the Include-Referer-Token-Binding-ID header.
This header has only meaning if the HTTP status code is 301, 302, This header has only meaning if the HTTP status code is 301, 302,
303, 307 or 308, and MUST be ignored by the client for any other 303, 307 or 308, and MUST be ignored by the client for any other
status codes. If the client supports the Token Binding Protocol, and status codes. If the client supports the Token Binding Protocol, and
has negotiated the Token Binding Protocol with both the Token has negotiated the Token Binding Protocol with both the Token
Consumer and the Token Provider, it already sends the following Consumer and the Token Provider, it already sends the following
header to the Token Provider with each HTTP request (see above): header to the Token Provider with each HTTP request (see above):
Token-Binding: EncodedTokenBindingMessage Sec-Token-Binding: EncodedTokenBindingMessage
The TokenBindingMessage SHOULD contain a TokenBinding with The TokenBindingMessage SHOULD contain a TokenBinding with
TokenBindingType referred_token_binding. If included, this TokenBindingType referred_token_binding. If included, this
TokenBinding MUST be signed with the Token Binding key used by the TokenBinding MUST be signed with the Token Binding key used by the
client for connections between itself and the Token Consumer (more client for connections between itself and the Token Consumer (more
specifically, the web origin that issued the Include-Referer-Token- specifically, the web origin that issued the Include-Referer-Token-
Binding-ID response header). The Token Binding ID established by Binding-ID response header). The Token Binding ID established by
this TokenBinding is called a _Referred Token Binding ID_. this TokenBinding is called a _Referred Token Binding ID_.
As described above, the TokenBindingMessage MUST additionally contain As described above, the TokenBindingMessage MUST additionally contain
skipping to change at page 7, line 23 skipping to change at page 7, line 44
referred_token_binding TokenBinding of the TokenBindingMessage, even referred_token_binding TokenBinding of the TokenBindingMessage, even
if that signature algorithm is different from the one negotiated with if that signature algorithm is different from the one negotiated with
the origin that the header is sent to. the origin that the header is sent to.
Token Providers SHOULD support all the SignatureAndHashAlgorithms Token Providers SHOULD support all the SignatureAndHashAlgorithms
specified in the Token Binding Protocol [TBPROTO]. If a token specified in the Token Binding Protocol [TBPROTO]. If a token
provider does not support the SignatureAndHashAlgorithm specified in provider does not support the SignatureAndHashAlgorithm specified in
the referred_token_binding TokenBinding in the TokenBindingMessage, the referred_token_binding TokenBinding in the TokenBindingMessage,
it MUST issue an unbound token. it MUST issue an unbound token.
3.5. Federation Example
The diagram below shows a typical HTTP Redirect-based Web Browser SSO
Profile (no artifact, no callbacks), featuring binding of, e.g., a
TLS Token Binding ID into an OpenID Connect "ID Token".
Legend:
+------------+------------------------------------------------------+
| EKM: | TLS Exported Keying Material [RFC5705] |
| {EKMn}Ksm: | EKM for server "n", signed by private key of TBID |
| | "m", where "n" must represent server receiving the |
| | ETBMSG, if a conveyed TB's type is |
| | provided_token_binding, then m = n, else if TB's |
| | type is referred_token_binding, then m != n. E.g., |
| | see step 1b in diagram below. |
| ETBMSG: | "Sec-Token-Binding" HTTP header field conveying an |
| | EncodedTokenBindingMessage, in turn conveying |
| | TokenBinding (TB)struct(s), e.g.: ETBMSG[[TB]] or |
| | ETBMSG[[TB1],[TB2]] |
| ID Token: | the "ID Token" in OIDC, it is the semantic |
| | equivalent of a SAML "authentication assertion". "ID |
| | Token w/TBIDn" denotes a "token bound" ID Token |
| | containing TBIDn. |
| Ks & Kp: | private (aka secret) key, and public key, |
| | respectively, of client-side Token Binding key pair |
| OIDC: | Open ID Connect |
| TB: | TokenBinding struct containing signed EKM, TBID, and |
| | TB type, e.g.: |
| | [{EKM1}Ks1,TBID1,provided_token_binding] |
| TBIDn: | Token Binding ID for client and server n's token- |
| | bound TLS association. TBIDn contains Kpn. |
+------------+------------------------------------------------------+
Client, Token Consumer, Token Provider,
aka: aka: aka:
User Agent OpenID Client, OpenID Provider,
OIDC Relying Party, OIDC Provider,
SAML Relying Party SAML Identity Provider
[ server "1" ] [ server "2" ]
+--------+ +----+ +-----+
| Client | | TC | | TP |
+--------+ +----+ +-----+
| | |
| | |
| | |
| 0. Client interacts w/TC | |
| over HTTPS, establishes Ks1 & Kp1, TBID1 |
| ETBMSG[[{EKM1}Ks1,TBID1,provided_token_binding]] |
|------------------------------>| |
| | |
| | |
| | |
| 1a. OIDC ID Token request, aka| |
| "Authentication Request", conveyed with |
| HTTP response header field of: |
| Include-Referer-Token-Binding-ID:true |
| any security-relevant cookies | |
| should contain TBID1 | |
+<- - - - - - - - - - - - - - - - | |
. | (redirect to TP via 301, 302, | |
. | 303, 307, or 308) | |
. | | |
+------------------------------------------------------->|
| 1b. opens HTTPS w/ TP, |
| establishes Ks2, Kp2, TBID2; |
| sends GET or POST with |
| ETBMSG[[{EKM2}Ks2,TBID2,provided_token_binding], |
| [{EKM2}Ks1,TBID1,referred_token_binding]] |
| as well as the ID Token request |
| | |
| | |
| | |
| 2. user authentication (if applicable, |
| methods vary, particulars are out of scope) |
|<====================================================>|
| (TP generates ID Token for TC containing TBID1, may |
| also set cookie(s) containing TBID2 and/or TBID1, |
| details vary, particulars are out of scope) |
| | |
| | |
| | |
| 3a. ID Token containing Kp1, issued for TC, |
| conveyed via OIDC "Authentication Response" |
+<- - - - - - - - - - - - - - - - - - - - - - - - - - - -|
. | (redirect to TC) | |
. | | |
. | | |
+-------------------------------->| |
| 3b. HTTPS GET or POST with |
| ETBMSG[[{EKM1}Ks1,TBID1,provided_token_binding]] |
| conveying Authn Reponse containing |
| ID Token w/TBID1, issued for TC |
| | |
| | |
| | |
| 4. user is signed-on, any security-relevant cookie(s)|
| that are set SHOULD contain TBID1 |
|<------------------------------| |
| | |
| | |
4. Security Considerations 4. Security Considerations
4.1. Security Token Replay 4.1. Security Token Replay
The goal of the Federated Token Binding mechanisms is to prevent The goal of the Federated Token Binding mechanisms is to prevent
attackers from exporting and replaying tokens used in protocols attackers from exporting and replaying tokens used in protocols
between the client and Token Consumer, thereby impersonating between the client and Token Consumer, thereby impersonating
legitimate users and gaining access to protected resources. Bound legitimate users and gaining access to protected resources. Bound
tokens can still be replayed by malware present in the client. In tokens can still be replayed by malware present in the client. In
order to export the token to another machine and successfully replay order to export the token to another machine and successfully replay
it, the attacker also needs to export the corresponding private key. it, the attacker also needs to export the corresponding private key.
The Token Binding private key is therefore a high-value asset and The Token Binding private key is therefore a high-value asset and
MUST be strongly protected, ideally by generating it in a hardware MUST be strongly protected, ideally by generating it in a hardware
security module that prevents key export. security module that prevents key export.
4.2. Privacy Considerations 4.2. Triple Handshake Vulnerability in TLS
The Token Binding protocol uses persistent, long-lived TLS Token
Binding IDs. To protect privacy, TLS Token Binding IDs are never
transmitted in clear text and can be reset by the user at any time,
e.g. when clearing browser cookies. Unique Token Binding IDs MUST be
generated for connections to different origins, so they cannot be
used by cooperating servers to link user identities.
4.3. Triple Handshake Vulnerability in TLS
The Token Binding protocol relies on the exported key material (EKM) The Token Binding protocol relies on the exported key material (EKM)
value [RFC5705] to associate a TLS connection with a TLS Token value [RFC5705] to associate a TLS connection with a TLS Token
Binding. The triple handshake attack [TRIPLE-HS] is a known TLS Binding. The triple handshake attack [TRIPLE-HS] is a known TLS
protocol vulnerability allowing the attacker to synchronize keying protocol vulnerability allowing the attacker to synchronize keying
manterial between TLS connections. The attacker can then manterial between TLS connections. The attacker can then
successfully replay bound tokens. For this reason, the Token Binding successfully replay bound tokens. For this reason, the Token Binding
protocol MUST NOT be negotiated unless the Extended Master Secret TLS protocol MUST NOT be negotiated unless the Extended Master Secret TLS
extension [I-D.ietf-tls-session-hash] has also been negotiated. extension [I-D.ietf-tls-session-hash] has also been negotiated.
4.4. Sensitivity of the Token-Binding Header 4.3. Sensitivity of the Sec-Token-Binding Header
The purpose of the Token Binding protocol is to convince the server The purpose of the Token Binding protocol is to convince the server
that the client that initiated the TLS connection controls a certain that the client that initiated the TLS connection controls a certain
key pair. For the server to correctly draw this conclusion after key pair. For the server to correctly draw this conclusion after
processing the Token-Binding header, certain secrecy and integrity processing the Sec-Token-Binding header, certain secrecy and
requirements must be met. integrity requirements must be met.
For example, the client's private Token Binding key must be kept For example, the client's private Token Binding key must be kept
secret by the client. If the private key is not secret, then another secret by the client. If the private key is not secret, then another
actor in the system could create a valid Token Binding header, actor in the system could create a valid Token Binding header,
impersonating the client. This can render the main purpose of the impersonating the client. This can render the main purpose of the
protocol - to bind bearer tokens to certain clients - moot: Consider, protocol - to bind bearer tokens to certain clients - moot: Consider,
for example, an attacker who obtained (perhaps through a network for example, an attacker who obtained (perhaps through a network
intrusion) an authentication cookie that a client uses with a certain intrusion) an authentication cookie that a client uses with a certain
server. Consider further that the server bound that cookie to the server. Consider further that the server bound that cookie to the
client's Token Binding ID precisely to thwart cookie theft. If the client's Token Binding ID precisely to thwart cookie theft. If the
attacker were to come into possession of the client's private key, he attacker were to come into possession of the client's private key, he
could then establish a TLS connection with the server and craft a could then establish a TLS connection with the server and craft a
Token-Binding header that matches the binding present in the cookie, Sec-Token-Binding header that matches the binding present in the
thus successfully authenticating as the client, and gaining access to cookie, thus successfully authenticating as the client, and gaining
the client's data at the server. The Token Binding protocol, in this access to the client's data at the server. The Token Binding
case, didn't successfully bind the cookie to the client. protocol, in this case, didn't successfully bind the cookie to the
client.
Likewise, we need integrity protection of the Token-Binding header: A Likewise, we need integrity protection of the Sec-Token-Binding
client shouldn't be tricked into sending a Token-Binding header to a header: A client shouldn't be tricked into sending a Sec-Token-
server that contains Token Binding messages about key pairs that the Binding header to a server that contains Token Binding messages about
client doesn't control. Consider an attacker A that somehow has key pairs that the client doesn't control. Consider an attacker A
knowledge of the exported keying material (EKM) for a TLS connection that somehow has knowledge of the exported keying material (EKM) for
between a client C and a server S. (While that is somewhat unlikely, a TLS connection between a client C and a server S. (While that is
it's also not entirely out of the question, since the client might somewhat unlikely, it's also not entirely out of the question, since
not treat the EKM as a secret - after all, a pre-image-resistant hash the client might not treat the EKM as a secret - after all, a pre-
function has been applied to the TLS master secret, making it image-resistant hash function has been applied to the TLS master
impossible for someone knowing the EKM to recover the TLS master secret, making it impossible for someone knowing the EKM to recover
secret. Such considerations might lead some clients to not treat the the TLS master secret. Such considerations might lead some clients
EKM as a secret.) Such an attacker A could craft a Token-Binding to not treat the EKM as a secret.) Such an attacker A could craft a
header with A's key pair over C's EKM. If the attacker could now Sec-Token-Binding header with A's key pair over C's EKM. If the
trick C to send such a header to S, it would appear to S as if C attacker could now trick C to send such a header to S, it would
controls a certain key pair when in fact it doesn't (the attacker A appear to S as if C controls a certain key pair when in fact it
controls the key pair). doesn't (the attacker A controls the key pair).
If A has a pre-existing relationship with S (perhaps has an account If A has a pre-existing relationship with S (perhaps has an account
on S), it now appears to the server S as if A is connecting to it, on S), it now appears to the server S as if A is connecting to it,
even though it is really C. (If the server S doesn't simply use even though it is really C. (If the server S doesn't simply use
Token Binding keys to identify clients, but also uses bound Token Binding keys to identify clients, but also uses bound
authentication cookies, then A would also have to trick C into authentication cookies, then A would also have to trick C into
sending one of A's cookies to S, which it can do through a variety of sending one of A's cookies to S, which it can do through a variety of
means - inserting cookies through Javascript APIs, setting cookies means - inserting cookies through Javascript APIs, setting cookies
through related-domain attacks, etc.) In other words, A tricked C through related-domain attacks, etc.) In other words, A tricked C
into logging into A's account on S. This could lead to a loss of into logging into A's account on S. This could lead to a loss of
privacy for C, since A presumably has some other way to also access privacy for C, since A presumably has some other way to also access
the account, and can thus indirectly observe A's behavior (for the account, and can thus indirectly observe A's behavior (for
example, if S has a feature that lets account holders see their example, if S has a feature that lets account holders see their
activity history on S). activity history on S).
Therefore, we need to protect the integrity of the Token-Binding Therefore, we need to protect the integrity of the Sec-Token-Binding
header. One origin should not be able to set the Token-Binding header. One origin should not be able to set the Sec-Token-Binding
header (through a DOM API or otherwise) that the User Agent uses with header (through a DOM API or otherwise) that the User Agent uses with
another origin. another origin.
4.5. Securing Federated Sign-On Protocols 4.4. Securing Federated Sign-On Protocols
As explained above, in a federated sign-in scenario a client will As explained above, in a federated sign-in scenario a client will
prove possession of two different key pairs to a Token Provider: One prove possession of two different key pairs to a Token Provider: One
key pair is the "provided" Token Binding key pair (which the client key pair is the "provided" Token Binding key pair (which the client
normally uses with the Token Provider), and the other is the normally uses with the Token Provider), and the other is the
"referred" Token Binding key pair (which the client normally uses "referred" Token Binding key pair (which the client normally uses
with the Token Consumer). The Token Provider is expected to issue a with the Token Consumer). The Token Provider is expected to issue a
token that is bound to the referred Token Binding key. token that is bound to the referred Token Binding key.
Both proofs (that of the provided Token Binding key and that of the Both proofs (that of the provided Token Binding key and that of the
skipping to change at page 10, line 12 skipping to change at page 12, line 34
First, consider a man-in-the-middle between the client and the Token First, consider a man-in-the-middle between the client and the Token
Provider. Recall that we assume that the client possesses a bound Provider. Recall that we assume that the client possesses a bound
authentication token (e.g., cookie) for the Token Provider. The man- authentication token (e.g., cookie) for the Token Provider. The man-
in-the-middle can intercept and modify any message sent by the client in-the-middle can intercept and modify any message sent by the client
to the Token Provider, and any message sent by the Token Provider to to the Token Provider, and any message sent by the Token Provider to
the client. (This means, among other things, that the man-in-the- the client. (This means, among other things, that the man-in-the-
middle controls the Javascript running at the client in the origin of middle controls the Javascript running at the client in the origin of
the Token Provider.) It is not, however, in possession of the the Token Provider.) It is not, however, in possession of the
client's Token Binding key. Therefore, it can either choose to client's Token Binding key. Therefore, it can either choose to
replace the Token Binding key in requests from the client to the replace the Token Binding key in requests from the client to the
Token Provider, and create a Token-Binding header that matches the Token Provider, and create a Sec-Token-Binding header that matches
TLS connection between the man-in-the-middle and the Token Provider; the TLS connection between the man-in-the-middle and the Token
or it can choose to leave the Token-Binding header unchanged. If it Provider; or it can choose to leave the Sec-Token-Binding header
chooses the latter, the signature in the Token Binding message unchanged. If it chooses the latter, the signature in the Token
(created by the original client on the exported keying material (EKM) Binding message (created by the original client on the exported
for the connection between client and man-in-the-middle) will not keying material (EKM) for the connection between client and man-in-
match the EKM between man-in-the-middle and the Token Provider. If the-middle) will not match the EKM between man-in-the-middle and the
it chooses the former (and creates its own signature, with its own Token Provider. If it chooses the former (and creates its own
Token Binding key, over the EKM for the connection between man-in- signature, with its own Token Binding key, over the EKM for the
the-middle and Token Provider), then the Token Binding message will connection between man-in-the-middle and Token Provider), then the
match the connection between man-in-the-middle and Token Provider, Token Binding message will match the connection between man-in-the-
but the Token Binding key in the message will not match the Token middle and Token Provider, but the Token Binding key in the message
Binding key that the client's authentication token is bound to. will not match the Token Binding key that the client's authentication
Either way, the man-in-the-middle is detected by the Token Provider, token is bound to. Either way, the man-in-the-middle is detected by
but only if the proof of key possession of the provided Token Binding the Token Provider, but only if the proof of key possession of the
key is required in the protocol (as we do above). provided Token Binding key is required in the protocol (as we do
above).
Next, consider the presence of a man-in-the-middle between client and Next, consider the presence of a man-in-the-middle between client and
Token Consumer. That man-in-the-middle can intercept and modify any Token Consumer. That man-in-the-middle can intercept and modify any
message sent by the client to the Token Consumer, and any message message sent by the client to the Token Consumer, and any message
sent by the Token Consumer to the client. The Token Consumer is the sent by the Token Consumer to the client. The Token Consumer is the
party that redirects the client to the Token Provider. In this case, party that redirects the client to the Token Provider. In this case,
the man-in-the-middle controls the redirect URL, and can tamper with the man-in-the-middle controls the redirect URL, and can tamper with
any redirect URL issued by the Token Consumer (as well as with any any redirect URL issued by the Token Consumer (as well as with any
Javascript running in the origin of the Token Consumer). The goal of Javascript running in the origin of the Token Consumer). The goal of
the man-in-the-middle is to trick the Token Issuer to issue a token the man-in-the-middle is to trick the Token Issuer to issue a token
bound to _its_ Token Binding key, not to the Token Binding key of the bound to _its_ Token Binding key, not to the Token Binding key of the
legitimate client. To thwart this goal of the man-in-the-middle, the legitimate client. To thwart this goal of the man-in-the-middle, the
client's referred Token Binding key must be communicated to the Token client's referred Token Binding key must be communicated to the Token
Producer in a manner that can not be affected by the man-in-the- Producer in a manner that can not be affected by the man-in-the-
middle (who, as we recall, can modify redirect URLs and Javascript at middle (who, as we recall, can modify redirect URLs and Javascript at
the client). Including the referred Token Binding message in the the client). Including the referred Token Binding message in the
Token-Binding header (as opposed to, say, including the referred Sec-Token-Binding header (as opposed to, say, including the referred
Token Binding key in an application-level message as part of the Token Binding key in an application-level message as part of the
redirect URL) is one way to assure that the man-in-the-middle between redirect URL) is one way to assure that the man-in-the-middle between
client and Token Consumer cannot affect the communication of the client and Token Consumer cannot affect the communication of the
referred Token Binding key to the Token Provider. referred Token Binding key to the Token Provider.
Therefore, the Token-Binding header in the federated sign-on use case Therefore, the Sec-Token-Binding header in the federated sign-on use
contains both, a proof of possession of the provided Token Binding case contains both, a proof of possession of the provided Token
key, as well as a proof of possession of the referred Token Binding Binding key, as well as a proof of possession of the referred Token
key. Binding key.
5. References 5. Privacy Considerations
5.1. Normative References 5.1. Scoping of Token Binding Keys
Clients must use different Token Binding keys for different servers,
so as to not allow Token Binding to become a tracking tool across
different servers. When Token Binding is used over HTTPS, this key
scoping should in particular happen at the granularity of "effective
top-level domain (public suffix) + 1", i.e., at the same granularity
at which cookies can be set.
The reason for this is that servers may use Token Binding to secure
their cookies. These cookies can be attached to any sub-domain of
public suffixes, and clients therefore should use the same Token
Binding key across such subdomains. This will ensure that any server
capable of receiving the cookie will see the same Token Binding ID
from the client, and thus be able to verify the token binding of the
cookie.
5.2. Life Time of Token Binding Keys
Token Binding keys don't have an expiration time. This means that
they can potentially be used by a server to track a user across an
extended period of time (similar to a long-lived cookie). HTTPS
clients such as web user agents should therefore provide a user
interface for discarding Token Binding keys (similar to the
affordances provided to delete cookies).
If a user agent provides modes such as private browsing mode in which
the user is promised that browsing state such as cookies are
discarded after the session is over, the user agent should also
discard Token Binding keys from such modes after the session is over.
Generally speaking, users should be given the same level of control
over life time of Token Binding keys as they have over cookies or
other potential tracking mechanisms.
6. References
6.1. Normative References
[I-D.ietf-httpbis-header-compression] [I-D.ietf-httpbis-header-compression]
Peon, R. and H. Ruellan, "HPACK - Header Compression for Peon, R. and H. Ruellan, "HPACK - Header Compression for
HTTP/2", draft-ietf-httpbis-header-compression-12 (work in HTTP/2", draft-ietf-httpbis-header-compression-12 (work in
progress), February 2015. progress), February 2015.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ Requirement Levels", BCP 14, RFC 2119,
RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>. <http://www.rfc-editor.org/info/rfc2119>.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, DOI 10.17487/ Transfer Protocol -- HTTP/1.1", RFC 2616,
RFC2616, June 1999, DOI 10.17487/RFC2616, June 1999,
<http://www.rfc-editor.org/info/rfc2616>. <http://www.rfc-editor.org/info/rfc2616>.
[RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B.
Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites
for Transport Layer Security (TLS)", RFC 4492, DOI
10.17487/RFC4492, May 2006,
<http://www.rfc-editor.org/info/rfc4492>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226,
DOI 10.17487/RFC5226, May 2008,
<http://www.rfc-editor.org/info/rfc5226>.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ (TLS) Protocol Version 1.2", RFC 5246,
RFC5246, August 2008, DOI 10.17487/RFC5246, August 2008,
<http://www.rfc-editor.org/info/rfc5246>. <http://www.rfc-editor.org/info/rfc5246>.
[RFC5705] Rescorla, E., "Keying Material Exporters for Transport [RFC5705] Rescorla, E., "Keying Material Exporters for Transport
Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705,
March 2010, <http://www.rfc-editor.org/info/rfc5705>. March 2010, <http://www.rfc-editor.org/info/rfc5705>.
[RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings
for TLS", RFC 5929, DOI 10.17487/RFC5929, July 2010,
<http://www.rfc-editor.org/info/rfc5929>.
[RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan,
"Transport Layer Security (TLS) Application-Layer Protocol
Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301,
July 2014, <http://www.rfc-editor.org/info/rfc7301>.
[TBPROTO] Popov, A., "The Token Binding Protocol Version 1.0", 2014. [TBPROTO] Popov, A., "The Token Binding Protocol Version 1.0", 2014.
5.2. Informative References 6.2. Informative References
[I-D.ietf-httpbis-http2] [I-D.ietf-httpbis-http2]
Belshe, M., Peon, R., and M. Thomson, "Hypertext Transfer Belshe, M., Peon, R., and M. Thomson, "Hypertext Transfer
Protocol version 2", draft-ietf-httpbis-http2-17 (work in Protocol version 2", draft-ietf-httpbis-http2-17 (work in
progress), February 2015. progress), February 2015.
[I-D.ietf-tls-session-hash] [I-D.ietf-tls-session-hash]
Bhargavan, K., Delignat-Lavaud, A., Pironti, A., Langley, Bhargavan, K., Delignat-Lavaud, A., Pironti, A., Langley,
A., and M. Ray, "Transport Layer Security (TLS) Session A., and M. Ray, "Transport Layer Security (TLS) Session
Hash and Extended Master Secret Extension", draft-ietf- Hash and Extended Master Secret Extension", draft-ietf-
skipping to change at page 13, line 4 skipping to change at page 15, line 43
Microsoft Corp. Microsoft Corp.
USA USA
Email: mnystrom@microsoft.com Email: mnystrom@microsoft.com
Dirk Balfanz (editor) Dirk Balfanz (editor)
Google Inc. Google Inc.
USA USA
Email: balfanz@google.com Email: balfanz@google.com
Adam Langley Adam Langley
Google Inc. Google Inc.
USA USA
Email: agl@google.com Email: agl@google.com
Jeff Hodges
Paypal
USA
Email: Jeff.Hodges@paypal.com
 End of changes. 37 change blocks. 
112 lines changed or deleted 242 lines changed or added

This html diff was produced by rfcdiff 1.44. The latest version is available from http://tools.ietf.org/tools/rfcdiff/