Re: draft-west-leave-secure-cookies-alone

Willy Tarreau <> Thu, 22 October 2015 05:48 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 3774D1B2AA1 for <>; Wed, 21 Oct 2015 22:48:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -6.912
X-Spam-Status: No, score=-6.912 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id zCd-ZoNlHj5w for <>; Wed, 21 Oct 2015 22:48:20 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 53E1C1A875D for <>; Wed, 21 Oct 2015 22:48:19 -0700 (PDT)
Received: from lists by with local (Exim 4.80) (envelope-from <>) id 1Zp8g2-0005RY-KI for; Thu, 22 Oct 2015 05:44:38 +0000
Resent-Date: Thu, 22 Oct 2015 05:44:38 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1Zp8fy-0005Qr-GB for; Thu, 22 Oct 2015 05:44:34 +0000
Received: from ([] by with esmtp (Exim 4.80) (envelope-from <>) id 1Zp8fv-0004hN-Rd for; Thu, 22 Oct 2015 05:44:33 +0000
Received: (from willy@localhost) by pcw.home.local (8.14.3/8.14.3/Submit) id t9M5i6SE004418; Thu, 22 Oct 2015 07:44:06 +0200
Date: Thu, 22 Oct 2015 07:44:06 +0200
From: Willy Tarreau <>
To: Martin Thomson <>
Cc: HTTP Working Group <>, Mike West <>
Message-ID: <>
References: <>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <>
User-Agent: Mutt/
Received-SPF: pass client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-7.3
X-W3C-Hub-Spam-Report: AWL=1.276, BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: 1Zp8fv-0004hN-Rd 5117cd7af5ee1fafd89cd8c5d7d3b778
Subject: Re: draft-west-leave-secure-cookies-alone
Archived-At: <>
X-Mailing-List: <> archive/latest/30391
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

Hi Martin,

On Wed, Oct 21, 2015 at 03:05:31PM -0700, Martin Thomson wrote:
> The authors of the paper recommended that non-secure cookies be simply
> given less precedence, so that they could not override cookies set by
> their secure brethren.  That seems far less likely to cause
> compatibility issues.  But I do prefer the change in the draft, if it
> can be made to stick.

I do think as well that there are little risks. The corner case I'm
thinking about is when cookies are used for load balancing. I know
a number of places where the cookie is relied on to maintain the
stickiness between the HTTP and HTTPS sites. So the first cookie is
assigned when you visit the HTTP site, which quickly drives you to the
HTTPS site on the same server. The issue I'm seeing is that when the
server dies, the user must be brought to another server and here we
want to be sure that it is possible to change the server from the
HTTP site after it's been used for HTTPS. The good thing is that I
don't see a reason why a load balancer would pass the "secure" flag
on a stickiness cookie, so I think this should mostly be safe.

However in my opinion this proposal will not protect at all against
cookie injection before the first visit of the site. This is often
done by bringing the visitor to an unrelated site and injecting a
cookie that will be delivered to the target site after the visitor
goes there (through a link, redirect or JS url change).

I think in fact that what we're missing is the ability for the
browser to tell the server how it considers the cookie (secure or
not). The servers could then decide to ignore non-secure cookies
in this case and that would protect much better, including against
cookie injection. That would require updating the cookie syntax and
spec though since we can't pass attributes with cookies :-/