Re: [Unbearable] Sec-Token-Binding header and Vary

Martin Thomson <> Wed, 04 April 2018 06:47 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E6CA612708C for <>; Tue, 3 Apr 2018 23:47:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id hjJV7P5Z2ZSJ for <>; Tue, 3 Apr 2018 23:47:52 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4003:c0f::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8D1B4124B17 for <>; Tue, 3 Apr 2018 23:47:52 -0700 (PDT)
Received: by with SMTP id a14-v6so4018395otf.6 for <>; Tue, 03 Apr 2018 23:47:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pZclXENlc0ARDifgRTEnoFqg1jjZ3XnjEf0EARXB03k=; b=XnaU1LdblXCe/lTOMGuM/TUx6M3dtZs9WM5LPpQnNSqP65d3FoR7/wxbODLo0HE78Z UXvUPavP79KHTur5QqWWNaoUAjbiGM7lZ/aHtBYupK7DGbVLkTa+5iwN+GHOd6C3rBjb RPcRb52fpfjnJrKWZj/OnyKEDOi8gD101Hn5eX0Gr43BIgVtASFCr18rJRaK42Pelstk W6zR1M05BVQFGrRWKHlM5GBijTiP9U1OgJAGrB4bAryUK7QffAouMXEKR5lWxFCoyx6y usfSmaPt3NSU9aiOf2eqJTloWJhs+TLbVU0OjPEeJ9NS59J9LF5tHYp/Bw3KgIcz3P8M KkTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pZclXENlc0ARDifgRTEnoFqg1jjZ3XnjEf0EARXB03k=; b=XssNjZpJ8fgt9b3F0IJ8nZohub/rbKzcqzDh2U7/Qim5SEWfw/DTUKY2zBU0R56SD3 iC6fAU7yOGmV8iO134sO12g8eQt+Nv8uHkZl7h6ntPkp2uiS106XWeb7jSdKB+MnWFSD VVpr2tGEA5JTeyVJts1FOlbAavboNyHeAv0A6ivxXTy7XI9g03j40YRFk5cCpHiQDcNA EStkmibAMmLi36YIkZyzeObjdfcDoj7QxNhFt00p/J6YpugeX94Kkarjnb726RvRgVm7 pSd3ZegcaUiz4WAfrdPd/3ID3HRDhx3dD37wNEC7ZKgz6v12XwoBP4z2iIbVWBNvjvE3 0Vqw==
X-Gm-Message-State: ALQs6tCHaX+Sp8KhkLC35qJ7KYDmyZifzeDm8mke9UCEc7CwfLoYIOSY Jy31pnuhRdO8W9iys/TdSpzw4q6jPZbZcsj5GSg=
X-Google-Smtp-Source: AIpwx4/du+rUBdG/QJdsD4evotXEnFVFgyKHD1rz8nRgU6JzCwwSfAulgRoZuQAIewS9+jOGjYW4ECDPyasTG6OpkrI=
X-Received: by 2002:a9d:29ea:: with SMTP id g39-v6mr10441284otd.241.1522824471762; Tue, 03 Apr 2018 23:47:51 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a9d:ac7:0:0:0:0:0 with HTTP; Tue, 3 Apr 2018 23:47:51 -0700 (PDT)
In-Reply-To: <>
References: <> <> <>
From: Martin Thomson <>
Date: Wed, 04 Apr 2018 16:47:51 +1000
Message-ID: <>
To: Nick Harper <>
Cc: IETF Tokbind WG <>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <>
Subject: Re: [Unbearable] Sec-Token-Binding header and Vary
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.\"" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 04 Apr 2018 06:47:55 -0000

That doesn't require any more text than what is already in RFC 7234 though :)

On Wed, Apr 4, 2018 at 4:04 AM, Nick Harper <> wrote:
> Sure, I think it's reasonable to assume that most resources depending
> on token bindings (or in response to a request with Sec-Token-Binding)
> would be marked Cache-Control: private, or at least not have Vary:
> Sec-Token-Binding, but even if that's the common case, spec-compliant
> implementations still need to handle Vary: Sec-Token-Binding (rare as
> it is) if that's something the spec allows.
> On Mon, Apr 2, 2018 at 11:19 PM, Martin Thomson
> <> wrote:
>> ...or say nothing.
>> ...or observe that most resources that depend on token bindings will
>> be marked Cache-Control: private.
>> On Fri, Mar 30, 2018 at 8:20 AM, Nick Harper <> wrote:
>>> The Vary HTTP header specifies a list of headers whose values must
>>> match for a resource to be served from the cache. HTTPSTB specifies
>>> that a server MAY list Sec-Token-Binding in a Vary response header. I
>>> think this behavior is silly, and we should disallow Sec-Token-Binding
>>> in Vary.
>>> The reason why this is silly is that the Sec-Token-Binding header's
>>> value is dependent on the underlying connection, and it will be
>>> different for requests on different connections.
>>> Consider a request to for resource foo, sent with the
>>> Sec-Token-Binding header, that gets a response with "Vary:
>>> Sec-Token-Binding", and a browser caches this response. The browser
>>> then visits some page that includes resource foo, so it goes to see if
>>> it can use it from cache. (Assume arguendo that all other caching
>>> properties are such that if there weren't this Vary header the
>>> response would be served from cache.) There are two options now:
>>> 1) The browser has no connection open to Any attempted
>>> request for resource foo would have a different Sec-Token-Binding
>>> header (because it cannot possibly match the header of the request
>>> sent on a different connection), so the resource cannot be loaded from
>>> cache because the Sec-token-Binding header can't match.
>>> 2) The browser does have a connection open to Now, the
>>> browser needs to check that if it were to make a request to
>>> for foo, whether the Sec-Token-Binding header it would
>>> generate matches - if so it can serve the response from cache; if not,
>>> it needs to continue sending the request on the network.
>>> A main reason for caching responses is so that they can be served
>>> without ever going to the network. This now requires binding a request
>>> to a particular network connection before evaluating whether it can be
>>> served from the cache, which seems backwards and somewhere between
>>> annoying and impossible to implement.
>>> I suggest changing the "MAY" to "MUST NOT": Under "Additionally, the
>>> Sec-Token-Binding header field:" where it says "MAY be listed by a
>>> server in a Vary response header field", change this to a "MUST NOT".
>>> _______________________________________________
>>> Unbearable mailing list