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

"Eric Vyncke (evyncke)" <evyncke@cisco.com> Sat, 04 April 2015 21:50 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 41AC31A037B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 4 Apr 2015 14:50:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.511
X-Spam-Level:
X-Spam-Status: No, score=-14.511 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_DKIM_WL=-7.5] 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 oNQ2WAF2vxp5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 4 Apr 2015 14:50:48 -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 ACA2A1A036D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 4 Apr 2015 14:50:48 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1YeVuY-0006En-3p for ietf-http-wg-dist@listhub.w3.org; Sat, 04 Apr 2015 21:47:26 +0000
Resent-Date: Sat, 04 Apr 2015 21:47:26 +0000
Resent-Message-Id: <E1YeVuY-0006En-3p@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.80) (envelope-from <evyncke@cisco.com>) id 1YeVuP-0006CV-Vo for ietf-http-wg@listhub.w3.org; Sat, 04 Apr 2015 21:47:18 +0000
Received: from rcdn-iport-1.cisco.com ([173.37.86.72]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from <evyncke@cisco.com>) id 1YeVuL-0005aY-Cy for ietf-http-wg@w3.org; Sat, 04 Apr 2015 21:47:15 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=17406; q=dns/txt; s=iport; t=1428184033; x=1429393633; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=YJqAvNRGSKpkc+vJ6NcG4U+016Z07sbQRICB1ylJQFc=; b=katayWjdGadNSc/Khr32YSX/9aEj1jKUwopckH4Br8IC7r1cqh98IrWo o+L/bMxwdllpvl6H6Rm7KMql27AUm19otmIVX2rdvxCE56NY+eDhGx+6C 5kObBe+HS+GbIf/k2YyKQh4zAjDzuMREm3M/4eoVGmZbz6yVhtsZblNpB E=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AcBQC8WiBV/5JdJa1GEwOCRUNSXAWDEMhcAhx/TAEBAQEBAX6EHgEBAQQjVg4CAgEIEQMBAgwLARADAgICGQYRFAkIAgQOBRyHfwMRtCGDF45PDYVMAQEBAQEBAQEBAQEBAQEBAQEBAQEBFwSCD4kWgkeBSB8wCgEQBxEBAYJVgUUFkGuGHIFZDDSBTYEdEYwmT4Jpg0giggIBHIFQb4EEBxcifwEBAQ
X-IronPort-AV: E=Sophos;i="5.11,524,1422921600"; d="scan'208,217";a="406090826"
Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by rcdn-iport-1.cisco.com with ESMTP; 04 Apr 2015 21:46:46 +0000
Received: from xhc-rcd-x06.cisco.com (xhc-rcd-x06.cisco.com [173.37.183.80]) by rcdn-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id t34LkkMU007654 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sat, 4 Apr 2015 21:46:46 GMT
Received: from xmb-aln-x02.cisco.com ([169.254.5.130]) by xhc-rcd-x06.cisco.com ([173.37.183.80]) with mapi id 14.03.0195.001; Sat, 4 Apr 2015 16:46:46 -0500
From: "Eric Vyncke (evyncke)" <evyncke@cisco.com>
To: Jim Manico <jim@manico.net>
CC: "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Thread-Topic: Linking a cookie to an IP address is a very bad in 2015...
Thread-Index: AQHQbryil9W4nlcIVkGcZNdWVbT8WZ09CE3UgABdPoCAAAIlgIAAcd4A
Date: Sat, 04 Apr 2015 21:46:13 +0000
Message-ID: <D14627BF.41AEC%evyncke@cisco.com>
References: <D141A3E5.4146E%evyncke@cisco.com> <20150401114608.GA7832@1wt.eu> <04DD393C-711F-4C9E-B21C-B184B8972DFC@apple.com> <20150401150716.GA7871@1wt.eu> <25C792A9-56D0-452D-A46C-561A44E4F229@manico.net> <20150401151634.GB7871@1wt.eu> <CABb0SYQ5=5BHSH-JQ5XsCi_bQ8h5FN=WNPvAYkzy94Bm=yTVwg@mail.gmail.com> <551E3D00.5090501@mathemainzel.info> <CABb0SYQAOXRWL5TvD5H5g_4VDwLxF=6kzhmVgCSK8Pv7pq8Apw@mail.gmail.com> <551FB3A5.503@mathemainzel.info> <CABb0SYRUvtTdZQGZkvNVTaA_yW79Q6Pd0Uh8exjE8zErzQNbsA@mail.gmail.com> <4B01B6DC-9EE3-4501-8CE1-CEBA3F19D9D3@manico.net> <55201693.70609@mathemainzel.info> <920932BC-302C-41B4-A112-D3CB7461878C@manico.net>
In-Reply-To: <920932BC-302C-41B4-A112-D3CB7461878C@manico.net>
Accept-Language: fr-FR, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.4.6.141106
x-originating-ip: [10.55.185.71]
Content-Type: multipart/alternative; boundary="_000_D14627BF41AECevynckeciscocom_"
MIME-Version: 1.0
Received-SPF: pass client-ip=173.37.86.72; envelope-from=evyncke@cisco.com; helo=rcdn-iport-1.cisco.com
X-W3C-Hub-Spam-Status: No, score=-14.6
X-W3C-Hub-Spam-Report: DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_DKIM_WL=-7.5, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1YeVuL-0005aY-Cy 3b385f225827481bb6b1542a86d0880d
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/D14627BF.41AEC%25evyncke@cisco.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29259
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>

On the Thalys, we usually change of country (hence also of mobile operator) every 45 minutes :-)

Else, mobile operators are heavily relying on NAT and some NAT are not RFC 6888 compatible (i.e. They keep changing your public IP address even if your phone RFC 1918 address stays the same).

In short, NEVER link a session cookie/state to an IP address ;-)

-éric

PS: and as a Belgian citizen, I hope that you have enjoyed Belgian beers/chocolate/people (albeit weather was awful probably) :-)

From: Jim Manico <jim@manico.net<mailto:jim@manico.net>>
Date: samedi 4 avril 2015 18:59
To: "Walter H." <Walter.H@mathemainzel.info<mailto:Walter.H@mathemainzel.info>>
Cc: Max Bruce <max.bruce12@gmail.com<mailto:max.bruce12@gmail.com>>, "ietf-http-wg@w3.org<mailto:ietf-http-wg@w3.org>" <ietf-http-wg@w3.org<mailto:ietf-http-wg@w3.org>>
Subject: Re: Linking a cookie to an IP address is a very bad in 2015...
Resent-From: <ietf-http-wg@w3.org<mailto:ietf-http-wg@w3.org>>
Resent-Date: samedi 4 avril 2015 18:59

I was just on the Thayls training around Europe. Wireless on the train was not usable so I used my phone data plan instead and watched IP addresses change every 45 min or so. It may happen rarely, but it happens.

It all depends on your user base.

And again, if you pin a user to the user agent, it will change during browser update and kick that user out early.

edge-cases? For sure but they are real...
--
Jim Manico
@Manicode
(808) 652-3805

On Apr 4, 2015, at 9:51 AM, Walter H. <Walter.H@mathemainzel.info<mailto:Walter.H@mathemainzel.info>> wrote:

user-agent: the change of user-agent should be noticeable after its restart;
when it changes without a restart you have a serious security problem,
e.g. some badware is setting "general.agent.override" in Firefox;

IP-address: with mobile devices you have to distinguish something;
as long as your device only changes the location in small distances, so that it stays inside the same mobile network operator,
the IP-address remains the same, because this is handled some layer below;

when the mobile network operator or just the ISP cuts the connection after a specified time, e.g. every 8 hours,
then this would be the same as a reboot of a normal computer and there it is not a good idea to be
able to go further inside the session, that was active before shutting down the computer ...
(think of an electronic banking session, which is a little bit more sensitive than just
looking around anywhere e.g. youtube)

think of what can happen, so that you bring the "login-page" instead of going further in the session;
I'd bring the login-page when one of the following changes:

source-ip:source-port
user-agent

but not, when you notice a change of the following:

screen resolution
client-time, except there is a defined timeout of e.g. 15 minutes


On 04.04.2015 18:12, Jim Manico wrote:
In the world of auto-updating browsers and therefor auto-updating user-agents, tying authentication to a user agent could have unintended negative consequences.

Tying authN to an IP address also has negative unintended consequences, like being on a mobile network while traveling, or being behind certain gateways - your IP address may change in short timespans.

On Apr 4, 2015, at 3:18 AM, Max Bruce <max.bruce12@gmail.com<mailto:max.bruce12@gmail.com>> wrote:

The session ID is a cookie, so in the headers. And yes, because it also checks that cookie, which is randomly generated. It just enforces a user-agent server-side. It DID enforce an IP, but I removed this for other reasons discussed earlier.

On Sat, Apr 4, 2015 at 2:49 AM, Walter H. <Walter.H@mathemainzel.info<mailto:Walter.H@mathemainzel.info>> wrote:
let me ask it different:  where is the Session ID, is it part of a http-header, part of a html-header, a session-cookie, or is it part of the URL itself that is requested?

the second: two ident configured hosts behind NAT do not differ neither in the user agent nor in the IP address; they only differ in the source TCP-port ...

On 03.04.2015 09:13, Max Bruce wrote:
When you say transmitting from host to server, what do you mean?
And yes, if I understand what your asking. It effectively compiled a random hash, and then enforced an IP & user agent. I have recently removed the IP enforecement though.

On Fri, Apr 3, 2015 at 12:10 AM, Walter H. <Walter.H@mathemainzel.info<mailto:Walter.H@mathemainzel.info>> wrote:
On 01.04.2015 21:48, Max Bruce wrote:
What about linking to several? I wrote a session system for my Web Server that will only allow access to the original Session ID if the IP & User-Agent has remained unchanged, in order to protect against session hijacking. I've found it's highly effective, unless you IP Spoof.
what kind of mechanism do you use for transmitting the Session ID from host to server?
does it prevent access from an ident configured but different host behind a NAT?