Re: Linking a cookie to an IP address is a very bad in 2015...

Michael Sweet <msweet@apple.com> Wed, 01 April 2015 14:57 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 (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9FE2F1AC3DB for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 1 Apr 2015 07:57:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.802
X-Spam-Level:
X-Spam-Status: No, score=-6.802 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_DKIM_INVALID=0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 xs3Bp3OGogXJ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 1 Apr 2015 07:57:25 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E3BD71ACCF4 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 1 Apr 2015 07:57:13 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1YdK15-00013i-AI for ietf-http-wg-dist@listhub.w3.org; Wed, 01 Apr 2015 14:53:15 +0000
Resent-Date: Wed, 01 Apr 2015 14:53:15 +0000
Resent-Message-Id: <E1YdK15-00013i-AI@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.80) (envelope-from <msweet@apple.com>) id 1YdK0x-00012w-Nj for ietf-http-wg@listhub.w3.org; Wed, 01 Apr 2015 14:53:07 +0000
Received: from mail-out4.apple.com ([17.151.62.26] helo=mail-in4.apple.com) by maggie.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <msweet@apple.com>) id 1YdK0t-0005Ud-Lj for ietf-http-wg@w3.org; Wed, 01 Apr 2015 14:53:07 +0000
DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1427899954; x=2291813554; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=v5g5wvuzL/Sr8CwdY7bm2VFdIBleFM6hay9KpIT7UaE=; b=ohvirf71CKUaAH6BeaTfTyvFS60p0m/PlMyLtX0WaDfNiOcRRkoNRjXc+aK5Boc8 1q9FVKknPaWq5za8lPLXWIX7R4El4IR5zd8fdWCaW8FFTGN8ABzUfRM9JdbTV4NP pmrj4OUnRMWPok53+pmweo6IbF2PDncxQIb6ORRhj2sMBV5ZTTt/4dqqr06KYpQL vS+xoAgoyC+TZTH33qQ4KHUUK8y/fZ6w6yslz2lOm5lPaR67r9YBy+eC0bnxLg4X v1fPKjiW5TDgbcV9dJ9DqMfgr97CHReVQRdBZoBt+LLxx2cYwhMEtctIplUY0c70 +fRNZZffD6LboPxZZAghlw==;
Received: from relay2.apple.com (relay2.apple.com [17.128.113.67]) by mail-in4.apple.com (Apple Secure Mail Relay) with SMTP id D7.58.31076.2360C155; Wed, 1 Apr 2015 07:52:34 -0700 (PDT)
X-AuditID: 11973e12-f79946d000007964-bc-551c06322ffa
Received: from marigold.apple.com (marigold.apple.com [17.128.115.132]) (using TLS with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by relay2.apple.com (Apple SCV relay) with SMTP id CB.D8.05232.4260C155; Wed, 1 Apr 2015 07:52:20 -0700 (PDT)
Received: from [17.153.22.176] by marigold.apple.com (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22 2013)) with ESMTPSA id <0NM400FLHUNK9Q50@marigold.apple.com> for ietf-http-wg@w3.org; Wed, 01 Apr 2015 07:52:34 -0700 (PDT)
MIME-version: 1.0 (Mac OS X Mail 8.2 \(2095\))
Content-type: text/plain; charset="us-ascii"
From: Michael Sweet <msweet@apple.com>
In-reply-to: <20150401114608.GA7832@1wt.eu>
Date: Wed, 01 Apr 2015 10:52:32 -0400
Cc: "Eric Vyncke (evyncke)" <evyncke@cisco.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-transfer-encoding: quoted-printable
Message-id: <04DD393C-711F-4C9E-B21C-B184B8972DFC@apple.com>
References: <D141A3E5.4146E%evyncke@cisco.com> <20150401114608.GA7832@1wt.eu>
To: Willy Tarreau <w@1wt.eu>
X-Mailer: Apple Mail (2.2095)
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrILMWRmVeSWpSXmKPExsUi2FDorGvEJhNq8KTb1OJwyywmB0aPo/P2 swYwRnHZpKTmZJalFunbJXBlLJ47i6lgLV/Fs8s7mRsYT3N3MXJySAiYSEzdO4cZwhaTuHBv PVsXIxeHkMBeRonb1+cwwhQdXXkdKjGJSaLpzHpmCOcvo8STLU9YQKqEBdwlfq+YCTaKV0BP 4lHLGbA4s4CWxPqdx5lAbDYBNYnfk/pYuxg5ODgFtCWu7eMCCbMIqEq8fraLHSTMLBAn8eqw LkSntsSTdxdYISbaSKz+fBFsipCAr0TfjmfsILaIgIxE09TpLBB3ykr0Hp8PdpqEwFtWiYY1 i9knMArPQnLRLC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.26; envelope-from=msweet@apple.com; helo=mail-in4.apple.com
X-W3C-Hub-Spam-Status: No, score=-6.7
X-W3C-Hub-Spam-Report: AWL=0.566, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, W3C_AA=-1, W3C_DB=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1YdK0t-0005Ud-Lj e7ac2fe6e6c9729621a8693f543be1a0
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Linking a cookie to an IP address is a very bad in 2015...
Archived-At: <http://www.w3.org/mid/04DD393C-711F-4C9E-B21C-B184B8972DFC@apple.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29179
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: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Willy,

> On Apr 1, 2015, at 7:46 AM, Willy Tarreau <w@1wt.eu> wrote:
> ...
> I'm amazed people still do that in 2015, I had the idea to do it in 1999
> until I realized it was stupid and never did it! So I'd have guessed that
> 16 years later everyone would have also figured this! If IP addresses
> were stable during a session, cookies would not be needed, the address
> would be used instead. So it's precisely because addresses are unreliable
> that cookies exist.

Um, no.  IP addresses, by themselves, have never been useful as unique client identifiers.  NAT, DHCP, proxies, roaming, etc. all contribute to their instability.

Typically the client address will be incorporated into the session cookie value which contains a hash of a timestamp, client address, client-supplied headers (like User-Agent), server-supplied nonce value, and user ID and password (for sites with user accounts).

The main reason for incorporating client values into the session cookie hash is to (imperfectly) tie the cookie to the identity of the client (vs. the user) and (imperfectly) protect against replay attacks, particularly for HTTP connections.

From an operational standpoint, I've used this method on dozens of web sites over the years and maybe had 10 reports of problems due to NAT/proxies, over millions of visitors.  There may be some "selection bias" in that number (all of my web sites have been tech-oriented) but I don't think this is something that affects a large number of users given its continued, widespread use.

(Note: I'm not claiming that this practice is perfect or that we shouldn't try to come up with something better...)

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair