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

Michael Sweet <msweet@apple.com> Wed, 01 April 2015 20:34 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 B47B51A908A for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 1 Apr 2015 13:34:35 -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 qm62WBM82FQ2 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 1 Apr 2015 13:34:34 -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 DB3D41A8853 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 1 Apr 2015 13:34:33 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1YdPHn-0006Km-Hf for ietf-http-wg-dist@listhub.w3.org; Wed, 01 Apr 2015 20:30:51 +0000
Resent-Date: Wed, 01 Apr 2015 20:30:51 +0000
Resent-Message-Id: <E1YdPHn-0006Km-Hf@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 1YdPHj-0006K5-Tw for ietf-http-wg@listhub.w3.org; Wed, 01 Apr 2015 20:30:47 +0000
Received: from mail-out6.apple.com ([17.151.62.28] helo=mail-in6.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 1YdPHi-0000jp-Ua for ietf-http-wg@w3.org; Wed, 01 Apr 2015 20:30:47 +0000
DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1427920220; x=2291833820; 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=eSzIHEGhPhxk/c3iIvIkw2McXf7g3UFKwU4H5oVE56M=; b=4OwPCP1P13Z0CA8HzSVoqxBQ6VnKkXZKO58iioxIiyDMMrrFxdzVKwvu+6bvIMsW I0WOaDBhYP+sS5KswmJ/MOrTs7hTi+GZFs3ShCelj3qh0YCYnIdFOVidG5qej3nz MHngKdw6Uq+I7PWtrDoJrjbVhjul5VnZNFKzbHNr4wOzrcEOPiedQFyznx7Wbc85 xOkQumucO3e4mqtG8+qfOyjzV/uQWAcC8OLYuD2+jrX9AO0fLYzx9D7naGY3OpCP Xxo0cibFOl2m2iqYP+cc1eZRDowe514JEnDp0nJ2pYL/sItxfFUR+vt1DVi4f4Xn LCUNmn8c/gOHL/1w99u2/Q==;
Received: from relay7.apple.com (relay7.apple.com [17.128.113.101]) by mail-in6.apple.com (Apple Secure Mail Relay) with SMTP id 40.33.09025.C555C155; Wed, 1 Apr 2015 13:30:20 -0700 (PDT)
X-AuditID: 11973e15-f79fd6d000002341-03-551c555cc079
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 relay7.apple.com (Apple SCV relay) with SMTP id CA.DF.24525.E255C155; Wed, 1 Apr 2015 13:29:34 -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 <0NM5001HAAAGYK50@marigold.apple.com> for ietf-http-wg@w3.org; Wed, 01 Apr 2015 13:30:20 -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: <20150401200935.GA8035@1wt.eu>
Date: Wed, 01 Apr 2015 16:30:15 -0400
Cc: Max Bruce <max.bruce12@gmail.com>, Jim Manico <jim@manico.net>, "Eric Vyncke (evyncke)" <evyncke@cisco.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-transfer-encoding: quoted-printable
Message-id: <4F7C5C07-9A6B-4424-BD7A-89790A34651A@apple.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> <20150401195439.GC8021@1wt.eu> <CABb0SYTpk+rOB_1m5x5ahH1jDv30Ypx7Bu-k86wStg5mmO0R3w@mail.gmail.com> <20150401200935.GA8035@1wt.eu>
To: Willy Tarreau <w@1wt.eu>
X-Mailer: Apple Mail (2.2095)
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMLMWRmVeSWpSXmKPExsUi2FCYqhsTKhNq0NsnbnG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wSorIhArxpiRW VqUW5ccXleakFh9ilOZgURLntZIDqhZITyxJzU5NLUgtgskycXBKNTBOm3RMZRIvd9+uw6sn zDmS+rlFvWRN7pIYH47jBburG7aZpDz6nOrM4zJR2GXRiWoO3xe3PvFvcF7xjE9TQjU2+2nY nEfsH3gXFBxgrd+SnvV7VUNIemz/Eh3pawtf9jloJxVsPrzlrNzC5X8/zztXseaagWn6nLXZ TySCDfZfCBXxF34UUxyvxFKckWioxVxUnAgAzDfOQDkCAAA=
Received-SPF: pass client-ip=17.151.62.28; envelope-from=msweet@apple.com; helo=mail-in6.apple.com
X-W3C-Hub-Spam-Status: No, score=-6.8
X-W3C-Hub-Spam-Report: AWL=0.560, 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 1YdPHi-0000jp-Ua 6aafbabe157f9acc94de94f95c86cda0
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/4F7C5C07-9A6B-4424-BD7A-89790A34651A@apple.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29200
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 4:09 PM, Willy Tarreau <w@1wt.eu> wrote:
> 
> On Wed, Apr 01, 2015 at 12:57:56PM -0700, Max Bruce wrote:
>> That's a great point. What about User-Agent checking?
> 
> Yes, that's what Michael mentionned as well. I *believe* that some
> UAs send different values when a plugin performs a request, but I'm
> not 100% certain. That's clearly something to check for those who
> want to do this though.
> 
> I find it fun to see people scared about cookie stealing at an era
> where some others are pushing hard for TLS everywhere. Either one
> is a problem of the past, or the other is ineffective against info
> leak :-)

MiTM attacks/proxies can cause cookies "protected" by TLS to be exposed, but at that point the client IP validation is probably also defeated.  Javascript-based attacks are also possible, assuming you haven't set HttpOnly on the session cookie, but again those will come from the same IP so the validation is ineffective.

Probably the "right" answer is to always use TLS, never use the client IP or other request headers when constructing or validating the session ID, limit the amount of time a session ID is valid, and make sure your session IDs cannot be easily guessed.  (Which is pretty much what the OWASP cheat sheet says, minus the IP validation stuff...)

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair