draft-ietf-httpbis-client-hints-12.txt   draft-ietf-httpbis-client-hints-13.txt 
HTTP Working Group I. Grigorik HTTP Working Group I. Grigorik
Internet-Draft Y. Weiss Internet-Draft Y. Weiss
Intended status: Experimental Google Intended status: Experimental Google
Expires: September 12, 2020 March 11, 2020 Expires: October 26, 2020 April 24, 2020
HTTP Client Hints HTTP Client Hints
draft-ietf-httpbis-client-hints-12 draft-ietf-httpbis-client-hints-13
Abstract Abstract
HTTP defines proactive content negotiation to allow servers to select HTTP defines proactive content negotiation to allow servers to select
the appropriate response for a given request, based upon the user the appropriate response for a given request, based upon the user
agent's characteristics, as expressed in request headers. In agent's characteristics, as expressed in request headers. In
practice, clients are often unwilling to send those request headers, practice, clients are often unwilling to send those request headers,
because it is not clear whether they will be used, and sending them because it is not clear whether they will be used, and sending them
impacts both performance and privacy. impacts both performance and privacy.
skipping to change at page 2, line 4 skipping to change at page 2, line 4
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 September 12, 2020. This Internet-Draft will expire on October 26, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 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
(https://trustee.ietf.org/license-info) in effect on the date of (https://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
skipping to change at page 2, line 35 skipping to change at page 2, line 35
2. Client Hint Request Header Fields . . . . . . . . . . . . . . 4 2. Client Hint Request Header Fields . . . . . . . . . . . . . . 4
2.1. Sending Client Hints . . . . . . . . . . . . . . . . . . 4 2.1. Sending Client Hints . . . . . . . . . . . . . . . . . . 4
2.2. Server Processing of Client Hints . . . . . . . . . . . . 5 2.2. Server Processing of Client Hints . . . . . . . . . . . . 5
3. Advertising Server Support . . . . . . . . . . . . . . . . . 5 3. Advertising Server Support . . . . . . . . . . . . . . . . . 5
3.1. The Accept-CH Response Header Field . . . . . . . . . . . 5 3.1. The Accept-CH Response Header Field . . . . . . . . . . . 5
3.2. Interaction with Caches . . . . . . . . . . . . . . . . . 6 3.2. Interaction with Caches . . . . . . . . . . . . . . . . . 6
4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6
4.1. Information Exposure . . . . . . . . . . . . . . . . . . 6 4.1. Information Exposure . . . . . . . . . . . . . . . . . . 6
4.2. Deployment and Security Risks . . . . . . . . . . . . . . 8 4.2. Deployment and Security Risks . . . . . . . . . . . . . . 8
4.3. Abuse Detection . . . . . . . . . . . . . . . . . . . . . 8 4.3. Abuse Detection . . . . . . . . . . . . . . . . . . . . . 8
5. Cost of Sending Hints . . . . . . . . . . . . . . . . . . . . 8 5. Cost of Sending Hints . . . . . . . . . . . . . . . . . . . . 9
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
6.1. Accept-CH . . . . . . . . . . . . . . . . . . . . . . . . 9 6.1. Accept-CH . . . . . . . . . . . . . . . . . . . . . . . . 9
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 9
7.1. Normative References . . . . . . . . . . . . . . . . . . 9 7.1. Normative References . . . . . . . . . . . . . . . . . . 9
7.2. Informative References . . . . . . . . . . . . . . . . . 10 7.2. Informative References . . . . . . . . . . . . . . . . . 10
7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 10 7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Appendix A. Changes . . . . . . . . . . . . . . . . . . . . . . 10 Appendix A. Changes . . . . . . . . . . . . . . . . . . . . . . 10
A.1. Since -00 . . . . . . . . . . . . . . . . . . . . . . . . 10 A.1. Since -00 . . . . . . . . . . . . . . . . . . . . . . . . 10
A.2. Since -01 . . . . . . . . . . . . . . . . . . . . . . . . 10 A.2. Since -01 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.3. Since -02 . . . . . . . . . . . . . . . . . . . . . . . . 10 A.3. Since -02 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.4. Since -03 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.4. Since -03 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.5. Since -04 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.5. Since -04 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.6. Since -05 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.6. Since -05 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.7. Since -06 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.7. Since -06 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.8. Since -07 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.8. Since -07 . . . . . . . . . . . . . . . . . . . . . . . . 11
A.9. Since -08 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.9. Since -08 . . . . . . . . . . . . . . . . . . . . . . . . 12
A.10. Since -09 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.10. Since -09 . . . . . . . . . . . . . . . . . . . . . . . . 12
A.11. Since -10 . . . . . . . . . . . . . . . . . . . . . . . . 11 A.11. Since -10 . . . . . . . . . . . . . . . . . . . . . . . . 12
A.12. Since -11 . . . . . . . . . . . . . . . . . . . . . . . . 12 A.12. Since -11 . . . . . . . . . . . . . . . . . . . . . . . . 12
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 12 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 12
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12
1. Introduction 1. Introduction
There are thousands of different devices accessing the web, each with There are thousands of different devices accessing the web, each with
different device capabilities and preference information. These different device capabilities and preference information. These
device capabilities include hardware and software characteristics, as device capabilities include hardware and software characteristics, as
well as dynamic user and client preferences. Historically, well as dynamic user and client preferences. Historically,
applications that wanted to allow the server to optimize content applications that wanted to allow the server to optimize content
delivery and user experience based on such capabilities had to rely delivery and user experience based on such capabilities had to rely
on passive identification (e.g., by matching User-Agent on passive identification (e.g., by matching the User-Agent header
(Section 5.5.3 of [RFC7231]) header field against an established field (Section 5.5.3 of [RFC7231]) against an established database of
database of client signatures), used HTTP cookies [RFC6265] and URL client signatures), use HTTP cookies [RFC6265] and URL parameters, or
parameters, or use some combination of these and similar mechanisms use some combination of these and similar mechanisms to enable ad hoc
to enable ad hoc content negotiation. content negotiation.
Such techniques are expensive to setup and maintain, and are not Such techniques are expensive to setup and maintain, and are not
portable across both applications and servers. They also make it portable across both applications and servers. They also make it
hard for both client and server to reason about which data is hard for both client and server to understand which data is required
required and is in use during the negotiation: and is in use during the negotiation:
o User agent detection cannot reliably identify all static o User agent detection cannot reliably identify all static
variables, cannot infer dynamic client preferences, requires variables, cannot infer dynamic client preferences, requires
external device database, is not cache friendly, and is reliant on external device database, is not cache friendly, and is reliant on
a passive fingerprinting surface. a passive fingerprinting surface.
o Cookie based approaches are not portable across applications and o Cookie-based approaches are not portable across applications and
servers, impose additional client-side latency by requiring servers, impose additional client-side latency by requiring
JavaScript execution, and are not cache friendly. JavaScript execution, and are not cache friendly.
o URL parameters, similar to cookie based approaches, suffer from o URL parameters, similar to cookie-based approaches, suffer from
lack of portability, and are hard to deploy due to a requirement lack of portability, and are hard to deploy due to a requirement
to encode content negotiation data inside of the URL of each to encode content negotiation data inside of the URL of each
resource. resource.
Proactive content negotiation (Section 3.4.1 of [RFC7231]) offers an Proactive content negotiation (Section 3.4.1 of [RFC7231]) offers an
alternative approach; user agents use specified, well-defined request alternative approach; user agents use specified, well-defined request
headers to advertise their capabilities and characteristics, so that headers to advertise their capabilities and characteristics, so that
servers can select (or formulate) an appropriate response. servers can select (or formulate) an appropriate response.
However, traditional proactive content negotiation techniques often However, traditional proactive content negotiation techniques often
skipping to change at page 5, line 45 skipping to change at page 5, line 45
Its value MUST be an sh-list (Section 3.1 of Its value MUST be an sh-list (Section 3.1 of
[I-D.ietf-httpbis-header-structure]) whose members are tokens [I-D.ietf-httpbis-header-structure]) whose members are tokens
(Section 3.3.4 of [I-D.ietf-httpbis-header-structure]). Its ABNF is: (Section 3.3.4 of [I-D.ietf-httpbis-header-structure]). Its ABNF is:
Accept-CH = sh-list Accept-CH = sh-list
For example: For example:
Accept-CH: Sec-CH-Example, Sec-CH-Example-2 Accept-CH: Sec-CH-Example, Sec-CH-Example-2
When a client receives an HTTP response containing "Accept-CH", it When a client receives an HTTP response containing "Accept-CH", that
indicates that the origin opts-in to receive the indicated request indicates that the origin opts-in to receive the indicated request
header fields for subsequent same-origin requests. The opt-in MUST header fields for subsequent same-origin requests. The opt-in MUST
be ignored if delivered over non-secure transport or for an origin be ignored if delivered over non-secure transport (using a scheme
with a scheme different from HTTPS. It SHOULD be persisted and bound different from HTTPS). It SHOULD be persisted and bound to the
to the origin to enable delivery of Client Hints on subsequent origin to enable delivery of Client Hints on subsequent requests to
requests to the server's origin. the server's origin.
For example:
Accept-CH: Sec-CH-Example, Sec-CH-Example-2
Accept-CH: Sec-CH-Example-3
Based on the Accept-CH example above, which is received in response Based on the Accept-CH example above, which is received in response
to a user agent navigating to "https://example.com", and delivered to a user agent navigating to "https://example.com", and delivered
over a secure transport: a user agent will have to persist an Accept- over a secure transport, a user agent will have to persist an Accept-
CH preference bound to "https://example.com" and use it for user CH preference bound to "https://example.com". It will then use it
agent navigations to "https://example.com" and any same-origin for user agent navigations to e.g. "https://example.com/foobar.html",
resource requests initiated by the page constructed from the but not to e.g. "https://foobar.example.com/". It will similarly use
navigation's response. This preference will not extend to resource the preference for any same-origin resource requests (e.g. to
requests initiated to "https://example.com" from other origins. "https://example.com/image.jpg") initiated by the page constructed
from the navigation's response, but not to cross-origin resource
requests (e.g. "https://thirdparty.com/resource.js"). This
preference will not extend to resource requests initiated to
"https://example.com" from other origins (e.g. from navigations to
"https://other-example.com/").
3.2. Interaction with Caches 3.2. Interaction with Caches
When selecting a response based on one or more Client Hints, and if When selecting a response based on one or more Client Hints, and if
the resource is cacheable, the server needs to generate a Vary the resource is cacheable, the server needs to generate a Vary
response header field ([RFC7234]) to indicate which hints can affect response header field ([RFC7234]) to indicate which hints can affect
the selected response and whether the selected response is the selected response and whether the selected response is
appropriate for a later request. appropriate for a later request.
Vary: Sec-CH-Example Vary: Sec-CH-Example
skipping to change at page 6, line 48 skipping to change at page 6, line 48
4.1. Information Exposure 4.1. Information Exposure
Request header fields used in features relying on this document Request header fields used in features relying on this document
expose information about the user's environment to enable proactive expose information about the user's environment to enable proactive
content negotiation. Such information might reveal new information content negotiation. Such information might reveal new information
about the user and implementers ought to consider the following about the user and implementers ought to consider the following
considerations, recommendations, and best practices. considerations, recommendations, and best practices.
The underlying assumption is that exposing information about the user The underlying assumption is that exposing information about the user
as a request header is equivalent to the capability of that request's as a request header is equivalent (from a security perspective) to
origin to access that information by other means and transmit it to exposing this information by other means. (for example, if the
itself. request's origin can access that information using JavsScript APIs,
and transmit it to its servers)
Because Client Hints is an explicit opt-in mechanism, that means that
servers that want access to information about the user's environment
need to actively ask for it, enabling user agents and privacy
researchers to keep track of which origins collect that data, and
potentially act upon it. The header-based opt-in means that we can
remove passive fingerprinting vectors, such as the User-Agent string
(enabling active access to that information through User-Agent Client
Hints [4]), or otherwise expose information already available through
script (e.g. the Save-Data Client Hint [5]), without increasing the
passive fingerprinting surface.
Therefore, features relying on this document to define Client Hint Therefore, features relying on this document to define Client Hint
headers MUST NOT provide new information that is otherwise not headers MUST NOT provide new information that is otherwise not
available to the application via other means, such as existing available to the application via other means, such as existing
request headers, HTML, CSS, or JavaScript. request headers, HTML, CSS, or JavaScript.
Such features SHOULD take into account the following aspects of the Such features SHOULD take into account the following aspects of the
information exposed: information exposed:
o Entropy - Exposing highly granular data can be used to help o Entropy - Exposing highly granular data can be used to help
identify users across multiple requests to different origins. identify users across multiple requests to different origins.
Reducing the set of header field values that can be expressed, or Reducing the set of header field values that can be expressed, or
restricting them to an enumerated range where the advertised value restricting them to an enumerated range where the advertised value
is close but is not an exact representation of the current value, is close but is not an exact representation of the current value,
can improve privacy and reduce risk of linkability by ensuring can improve privacy and reduce risk of linkability by ensuring
that the same value is sent by multiple users. that the same value is sent by multiple users.
o Sensitivity - The feature SHOULD NOT expose user sensitive o Sensitivity - The feature SHOULD NOT expose user-sensitive
information. To that end, information available to the information. To that end, information available to the
application, but gated behind specific user actions (e.g. a application, but gated behind specific user actions (e.g. a
permission prompt or user activation) SHOULD NOT be exposed as a permission prompt or user activation) SHOULD NOT be exposed as a
Client Hint. Client Hint.
o Change over time - The feature SHOULD NOT expose user information o Change over time - The feature SHOULD NOT expose user information
that changes over time, unless the state change itself is also that changes over time, unless the state change itself is also
exposed (e.g. through JavaScript callbacks). exposed (e.g. through JavaScript callbacks).
Different features will be positioned in different points in the Different features will be positioned in different points in the
space between low-entropy, non-sensitive and static information (e.g. space between low-entropy, non-sensitive and static information (e.g.
user agent information), and high-entropy, sensitive and dynamic user agent information), and high-entropy, sensitive and dynamic
information (e.g. geolocation). User agents SHOULD consider the information (e.g. geolocation). User agents SHOULD consider the
value provided by a particular feature vs these considerations, and value provided by a particular feature vs these considerations, and
MAY have different policies regarding that tradeoff on a per-feature MAY have different policies regarding that tradeoff on a per-feature
basis. basis.
Implementers ought to consider both user and server controlled Implementers ought to consider both user- and server- controlled
mechanisms and policies to control which Client Hints header fields mechanisms and policies to control which Client Hints header fields
are advertised: are advertised:
o Implementers SHOULD restrict delivery of some or all Client Hints o Implementers SHOULD restrict delivery of some or all Client Hints
header fields to the opt-in origin only, unless the opt-in origin header fields to the opt-in origin only, unless the opt-in origin
has explicitly delegated permission to another origin to request has explicitly delegated permission to another origin to request
Client Hints header fields. Client Hints header fields.
o Implementers MAY provide user choice mechanisms so that users can o Implementers considering providing user choice mechanisms that
balance privacy concerns with bandwidth limitations. However, allow users to balance privacy concerns against bandwidth
implementers SHOULD also be aware that explaining the privacy limitations need to also consider that explaining to users the
implications of passive fingerprinting to users can be privacy implications involved, such as the risks of passive
challenging. fingerprinting, is challenging and likely impractical.
o Implementations specific to certain use cases or threat models MAY o Implementations specific to certain use cases or threat models MAY
avoid transmitting some or all of Client Hints header fields. For avoid transmitting some or all of Client Hints header fields. For
example, avoid transmission of header fields that can carry higher example, avoid transmission of header fields that can carry higher
risks of linkability. risks of linkability.
Implementers SHOULD support Client Hints opt-in mechanisms and MUST Implementers SHOULD support Client Hints opt-in mechanisms and MUST
clear persisted opt-in preferences when any one of site data, clear persisted opt-in preferences when any one of site data,
browsing history, browsing cache, cookies, or similar, are cleared. browsing history, browsing cache, cookies, or similar, are cleared.
4.2. Deployment and Security Risks 4.2. Deployment and Security Risks
skipping to change at page 9, line 33 skipping to change at page 9, line 43
7. References 7. References
7.1. Normative References 7.1. Normative References
[FETCH] van Kesteren, A., "Fetch", n.d., [FETCH] van Kesteren, A., "Fetch", n.d.,
<https://fetch.spec.whatwg.org/>. <https://fetch.spec.whatwg.org/>.
[I-D.ietf-httpbis-header-structure] [I-D.ietf-httpbis-header-structure]
Nottingham, M. and P. Kamp, "Structured Field Values for Nottingham, M. and P. Kamp, "Structured Field Values for
HTTP", draft-ietf-httpbis-header-structure-16 (work in HTTP", draft-ietf-httpbis-header-structure-18 (work in
progress), March 2020. progress), April 2020.
[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, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234, Specifications: ABNF", STD 68, RFC 5234,
DOI 10.17487/RFC5234, January 2008, DOI 10.17487/RFC5234, January 2008,
<https://www.rfc-editor.org/info/rfc5234>. <https://www.rfc-editor.org/info/rfc5234>.
skipping to change at page 10, line 31 skipping to change at page 10, line 41
<https://wicg.github.io/ua-client-hints/>. <https://wicg.github.io/ua-client-hints/>.
7.3. URIs 7.3. URIs
[1] https://lists.w3.org/Archives/Public/ietf-http-wg/ [1] https://lists.w3.org/Archives/Public/ietf-http-wg/
[2] http://httpwg.github.io/ [2] http://httpwg.github.io/
[3] https://github.com/httpwg/http-extensions/labels/client-hints [3] https://github.com/httpwg/http-extensions/labels/client-hints
[4] https://wicg.github.io/ua-client-hints/#http-ua-hints
[5] https://wicg.github.io/savedata/#save-data-request-header-field
Appendix A. Changes Appendix A. Changes
A.1. Since -00 A.1. Since -00
o Issue 168 (make Save-Data extensible) updated ABNF. o Issue 168 (make Save-Data extensible) updated ABNF.
o Issue 163 (CH review feedback) editorial feedback from httpwg o Issue 163 (CH review feedback) editorial feedback from httpwg
list. list.
o Issue 153 (NetInfo API citation) added normative reference. o Issue 153 (NetInfo API citation) added normative reference.
A.2. Since -01 A.2. Since -01
 End of changes. 19 change blocks. 
46 lines changed or deleted 61 lines changed or added

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