Re: Migrating some high-entropy HTTP headers to Client Hints.

Ronan Cremin <rcremin@afilias.info> Wed, 17 April 2019 16:46 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 31644120370 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 17 Apr 2019 09:46:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.898
X-Spam-Level:
X-Spam-Status: No, score=-2.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 eaesE5gdB80A for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 17 Apr 2019 09:46:01 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 29FDA12019C for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 17 Apr 2019 09:46:00 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1hGneI-0002JR-TK for ietf-http-wg-dist@listhub.w3.org; Wed, 17 Apr 2019 16:43:02 +0000
Resent-Date: Wed, 17 Apr 2019 16:43:02 +0000
Resent-Message-Id: <E1hGneI-0002JR-TK@frink.w3.org>
Received: from titan.w3.org ([2603:400a:ffff:804:801e:34:0:4c]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <rcremin@afilias.info>) id 1hGneH-0002Ik-2X for ietf-http-wg@listhub.w3.org; Wed, 17 Apr 2019 16:43:01 +0000
Received: from outbound.afilias.info ([66.199.183.4]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <rcremin@afilias.info>) id 1hGneC-0001T1-MI for ietf-http-wg@w3.org; Wed, 17 Apr 2019 16:43:00 +0000
Received: from ms5.on1.afilias-ops.info ([10.109.8.9] helo=smtp.afilias.info) by outbound.afilias.info with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88) (envelope-from <rcremin@afilias.info>) id 1hGndp-000GcX-5u for ietf-http-wg@w3.org; Wed, 17 Apr 2019 16:42:33 +0000
Received: from mail-ed1-f69.google.com ([209.85.208.69]:55730) by smtp.afilias.info with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from <rcremin@afilias.info>) id 1hGndp-00007c-5J for ietf-http-wg@w3.org; Wed, 17 Apr 2019 16:42:33 +0000
Received: by mail-ed1-f69.google.com with SMTP id h10so5043289edn.22 for <ietf-http-wg@w3.org>; Wed, 17 Apr 2019 09:42:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=ssk0RIjEqnTBwR727/3rkQ/WBh3VP2MviPLgSTYeJhI=; b=b6EP1f6dmPsw0S4MtcfnQWzJ7Ek3Sc2n5XonvqYBJCRJoRXOdhPIU04CDZPdTnuItr GVgxt9Vqmhc3BiPlXBPyAQeCqcvmyceHZUB/YuwYLKarWG00SOU/rxNo1QVCtGsZjxbw BAtiXBIgD1xBA0drTMI/hWvksZTrI88KfL71US9SkzbCb2j9viSerp3HRvN4u+Rb1C5d 81/wKoJszp0fEoEauaRAC6HqmcMzIsr/t1VXfJu78MsMGqocDdc5WwG1NDVgLrIAYhZb 2c3TQlizMyE03egYxzWs49G+Ks47/dZOtWUY5Eh7nhiBeFM9G9t5lNJNsHv7lQXONnTx YNEw==
X-Gm-Message-State: APjAAAXXf4Cnk5AL905KLlUAuU4b0pN9dYoSUiIl+KdoN2F2D5KN90NY JcI3KqG4yF8b1ChaeAl/PNzavjD0cX5eI3vvLQ0fZamC9n9Hd07HCjFu+vNUFm0Pt1OixeXLIkP CTEaR/vebttypgQ==
X-Received: by 2002:a17:906:364f:: with SMTP id r15mr48936582ejb.215.1555519346392; Wed, 17 Apr 2019 09:42:26 -0700 (PDT)
X-Google-Smtp-Source: APXvYqyLOErHj1LMU7qwgkHcZ6wN9tJgi1NIJ9axZhZ6pafZVvzqtTXJEfdhzRKXoIuYgWKJ0MjVmQ==
X-Received: by 2002:a17:906:364f:: with SMTP id r15mr48936544ejb.215.1555519345886; Wed, 17 Apr 2019 09:42:25 -0700 (PDT)
Received: from rcremin.mtld.mobi ([89.101.149.145]) by smtp.gmail.com with ESMTPSA id w6sm10350574ejq.73.2019.04.17.09.42.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 09:42:24 -0700 (PDT)
To: Yoav Weiss <yoav@yoav.ws>
Cc: Thomas Peterson <hidinginthebbc@gmail.com>, Mike West <mkwst@google.com>, HTTP Working Group <ietf-http-wg@w3.org>
References: <CAKXHy=eHiMtXi8vkDYtADHdU0tnUfd3p+Wfy7vSkLgT7cA1W0w@mail.gmail.com> <f042d223-85ee-fd16-74fa-7d6d993f817f@gmail.com> <4d321ba1-f6f1-05c3-5b76-24f6a9b89525@afilias.info> <CACj=BEiNPVgd7SvhBCqaTyp7c0Jg8QcjXnQt5Fk7Te367hB_pQ@mail.gmail.com>
From: Ronan Cremin <rcremin@afilias.info>
Message-ID: <5b492ae2-ea0b-c10b-f012-637413ef304a@afilias.info>
Date: Wed, 17 Apr 2019 17:42:24 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <CACj=BEiNPVgd7SvhBCqaTyp7c0Jg8QcjXnQt5Fk7Te367hB_pQ@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------499DC74FE4E454D7185C8B13"
Content-Language: en-US
Received-SPF: pass client-ip=66.199.183.4; envelope-from=rcremin@afilias.info; helo=outbound.afilias.info
X-W3C-Hub-Spam-Status: No, score=-8.2
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1hGneC-0001T1-MI 66926bdcbf4a49a582f69ad3e5a3fd05
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Migrating some high-entropy HTTP headers to Client Hints.
Archived-At: <https://www.w3.org/mid/5b492ae2-ea0b-c10b-f012-637413ef304a@afilias.info>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/36540
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Yoav,

Thanks for the reply, comments below.

Regards,
Ronan

On 11/04/2019 22:47, Yoav Weiss wrote:
> Hey Ronan,
>
>
> On Thu, Apr 11, 2019 at 8:11 AM Ronan Cremin <rcremin@afilias.info 
> <mailto:rcremin@afilias.info>> wrote:
>
>     Hi,
>
>     My name is Ronan Cremin, I help to build a device recognition product
>     widely-used in the web analytics, publishing and advertising
>     industries.
>     Full disclosure: my employer profits from analysis of UA strings,
>     though
>     moving the same information to client hints is not expected to impact
>     this materially.
>
>     One concern over moving UA string information to Client Hints is that
>     the information required to publish device-specific responses arrives
>     only in the second request from the client. This imposes a
>     performance
>     penalty on publishers that serve a device-tailored HTML document. As
>     Mike mentioned, RWD notwithstanding, many publishers employ
>     device-specific responses as envisaged in RFC1945, usually to
>     tailor the
>     experience to a class of device e.g. smartphone, tablet, desktop
>     and so
>     on. 
>
>
> The viewport Client Hint can provide such distinction, but it exposes 
> more bits that are actually needed, so not a great option to expose by 
> default, without an opt-in.
> From your description, maybe exposing another tri-state hint by 
> default will be enough to cover the use-case and maybe it not expose 
> too much bits about the user in the process.
> Can you open an issue on 
> https://github.com/WICG/ua-client-hints describing your use-case?
Sure, I'll create an issue.

For the record, I'm not sure if a tri-state will do it. In my statement 
above I perhaps over-simplified the description. Many publishers use 
content adaptation to a device-specific level, not just the broader 
device class.
>
> If we were to conclude that something like that is privacy-safe, I 
> guess the main problem would be to define where is the line drawn 
> between a phone and a tablet, and between a tablet and a laptop.
> I suspect a standard definition of those borders is likely to become 
> stale fairly quickly...
True, any boundary definition along these lines would not last long 
enough to be useful—it's already a continuum; the ‘phablet’ term 
represents the problem here and folding screens will further blur the lines.
>
>     Publishers endeavour to fit everything required for the first screen
>     of content into this first response, so a delay to this impacts
>     performance. The last time I checked more than 80% of the top 100
>     websites used this technique.
>
>
> When was that? Do you have data you can point us to?
It was a several years ago so I ran another quick analysis. My test does 
a GET on the main site entry point with a few different user-agent 
strings. I'm not fetching any additional linked resources, nor storing 
cookies or any other state. Public data for Alexa rankings is now 
limited to the top 50 sites, so that's what I used.

In summary, greater than 80% of the top 50 Alexa sites are using device 
adaptation at some level, with the majority offering more than two 
adaptations.

I'm using the byte size of the first HTML response as an indicator of 
device adaptation. I believe that this is crude, but workable. Some 
sites were blocked by my corporate firewall but in checking them 
afterwards via a VPN the percentage using UA adaptation only increases.

https://docs.google.com/spreadsheets/d/1ZPmpwsowowgLugVCEZuKaIeJUKw17jTjLN3iDzfK1AA/
>
>
>     Web analytics might also be impacted. Most web analytics solutions
>     support a JavaScript-free integration approach based on linking a
>     single
>     pixel image hosted by the analytics platform. The ability to do
>     this is
>     impacted for the same reason—the information required for analytics
>     becomes available only on the second request from the client.
>
>
> I'm not sure that's a winning argument, as it sounds like those 
> analytics vendors exploit the current UA string to extract bits of 
> information from passive requests.
> The current proposal will enable them to do the same (with the same 
> number of RTTs), but only after an explicit opt-in to receive that 
> data from the browser. An opt-in that can be monitored by the browser, 
> extensions and privacy researchers.
Exploit is possibly a loaded word here. Sending a UA string is a SHOULD 
requirement in the HTTP RFCs, not a MUST. User agents /voluntarily/ send 
a UA string, they are not obliged to, just like they wouldn't be obliged 
to send Hints per the proposal. Further, the contents of the UA string 
are entirely up to the browser and thus they are already empowered to 
decide how many bits of information to include in them. The Safari team 
have already elected to reduce the meaningful bits.
>
>
>     Has thought been given to the performance impact of the proposal?
>
>
> Yes.
>
>     Yoav
>     mentions this issue in his Client Hints infrastructure document
>     (https://github.com/yoavweiss/client-hints-infrastructure) but I
>     haven't
>     seen any attempt to quantify the impact.
>
>
> As indicated in the document you linked to, we currently don't have a 
> great way to make fingerprinting-bits-exposing Client Hints an opt-in 
> while keeping sending those on the very first request.
> That's unfortunate and we hope to improve on that in the future.
> At the same time, the User-Agent string is exposing many bits of 
> entropy, so it is a privacy hole we're interested in blocking.
Improving privacy is a laudable goal, I can't imagine that anyone would 
take issue with this.

But it's worth asking the question if the cost of attaining the goal is 
worthwhile. For the particular case of moving the user-agent string to 
Hints (rather than Hints in general), there are 20+ years of 
infrastructure based around RFC1945 and its successors. There are known 
performance penalties in moving the UA string to Hints. Add to this the 
fact that there isn't yet a consensus whether this move would improve or 
disimprove privacy and I think it's fair to say that there is a debate 
to be had around the overall merits of the proposal.
>
>
>     Regards,
>     Ronan
>
>     On 29/11/2018 12:08, Thomas Peterson wrote:
>     > I would propose that all Accept* headers are included in Client
>     Hints
>     > as all can be used for some level of fingerprinting, e.g. Accept
>     can
>     > used to distinguish between desktop browsers (which typically have
>     > html/xml MIME types) and cURL/wget which by default have '*/*'.
>     Many
>     > user agents also do their own guess work on response bodies anyway
>     > (such as looking at the magic number) to determine content type or
>     > encoding, so the impact of a "failed negotiation" of content can be
>     > limited.
>     >
>     > Also, Is there a particular reason why Sec-CH-Lang omits Quality
>     Values?
>     >
>     >
>     > Regards
>     >
>     >
>     > On 29/11/2018 10:22, Mike West wrote:
>     >> Hey folks,
>     >>
>     >> Section 9.7 of RFC7231
>     >> <https://tools.ietf.org/html/rfc7231#section-9.7> rightly notes
>     that
>     >> some of the content negotiation headers user agents deliver in
>     HTTP
>     >> requests create substantial fingerprinting surface. I think it
>     would
>     >> be beneficial if we took steps to reduce their prevalence on the
>     >> wire, and Client Hints looks like a reasonable infrastructure
>     on top
>     >> of which to build.
>     >>
>     >> `User-Agent` and `Accept-Language` seem like particularly tasty
>     and
>     >> low-hanging fruit, and I've sketched out two proposals as
>     proofs of
>     >> concept:
>     >>
>     >> *   `User-Agent` could be represented as ~four distinct hints:
>     `UA`,
>     >> `Model`, `Platform`, and `Arch`:
>     >> https://github.com/mikewest/ua-client-hints is a high-level
>     >> explainer, and
>     https://tools.ietf.org/html/draft-west-ua-client-hints
>     >> a sketchy ID for the new headers.
>     >>
>     >> *   `Accept-Language` could be represented as a `Lang` hint:
>     >> https://github.com/mikewest/lang-client-hint is a high-level
>     >> explainer,
>     https://tools.ietf.org/html/draft-west-lang-client-hint an
>     >> equally sketchy ID for the new header.
>     >>
>     >> I'd appreciate y'all's feedback. Thanks!
>     >>
>     >> -mike
>     >
>
>
>