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

Nick Harper <> Tue, 03 April 2018 18:04 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 7EA0412D7F9 for <>; Tue, 3 Apr 2018 11:04:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.71
X-Spam-Status: No, score=-2.71 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=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 iJ0xIo96VKTV for <>; Tue, 3 Apr 2018 11:04:51 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 463AF120713 for <>; Tue, 3 Apr 2018 11:04:51 -0700 (PDT)
Received: by with SMTP id w6so19601984qkb.4 for <>; Tue, 03 Apr 2018 11:04:51 -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=n1KhkAMz+GFhI7o/eP001fd8OBfD4ldceZm51P2ptLU=; b=OjdYyaTCTzNCd9fDw/74LWziWOdQSY9GS7iKYHVl/jNjcZ8ZzvC2g8SnSEZR31WKQt wFSNgUwajnqPlAJGQCZeGFlG6ARyFns6Zo+hqgJ2uVsHv+sBWzYpmrboR6hJ8VkxQ722 g08PRCEALsR6kxeykZMtgDF3f1mmx/tpKfb/zVbM6S5oiguc2y3m4K7GegtMCP6hGUhZ zXncv2c8teK4CvaoTZlEFJe+lEuCCu6pnkTqW4s1q27iMsEpppdbKKwum5doVw0/FgcX LwhtOZqjK/lQ/AX3U7COVGAUhFJRlpwmUy2Y0vNNyvzdQzOnTaV7tqRvY/a+/V50kVl3 674g==
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=n1KhkAMz+GFhI7o/eP001fd8OBfD4ldceZm51P2ptLU=; b=KbLKqvbtX4n7xounv05s8n7jtWVLmy7MngYiDSno7YPNfiPjFbzmQYMftEUtZp5z5A QIY7NGfMnce3KwQRDVu3zAXA4NW7saviweJKD75EKpzCsMY70SsEHjbzqrBFcgmNzNZI b3LyQjPeQBPwHB4OZ0+RlNSH23tRrMfpcXKkB85e4GK4FKnXqDfeKxr5ISzmdwQvdGLL t7m2NMzYWBx6psorhDr1N4Pz/hkvyYjQKP3ZKOPUmYPWs+Lw+aFYbQWET61IIC3PvPyH Bi4wYDRslmg9ATQylyEWdYuAfySQ7rA/nK6mlyN4LtlJqieSotq7jtjukg+QqME7RZLL 6/Cw==
X-Gm-Message-State: ALQs6tDKvtrD6t4v5wr738Z4YBAnEXwVczF7zUySXUdMeLl76XGBMSin gnYlMSCiISz9/WwCHwbhsbegT/AG9g8FDoKpo7yb3w==
X-Google-Smtp-Source: AIpwx4/j/N+Y7a/Nj3FHdSjieN8Hbyi0YqqVQgp9nOsbR/8jVfRrXwNdt3OX0ShYD7jmUu8Nv8fRVEu3yEF/U2EYUuA=
X-Received: by with SMTP id y70mr20194482qkb.293.1522778689659; Tue, 03 Apr 2018 11:04:49 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Tue, 3 Apr 2018 11:04:29 -0700 (PDT)
In-Reply-To: <>
References: <> <>
From: Nick Harper <>
Date: Tue, 03 Apr 2018 11:04:29 -0700
Message-ID: <>
To: Martin Thomson <>
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: Tue, 03 Apr 2018 18:04:53 -0000

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