Re: [OAUTH-WG] FW: MAC: Cookie name or value as MAC key id

Adam Barth <ietf@adambarth.com> Tue, 14 June 2011 17:06 UTC

Return-Path: <ietf@adambarth.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9CBF211E8078 for <oauth@ietfa.amsl.com>; Tue, 14 Jun 2011 10:06:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.366
X-Spam-Level:
X-Spam-Status: No, score=-3.366 tagged_above=-999 required=5 tests=[AWL=-0.389, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 62UpUXHdM9LQ for <oauth@ietfa.amsl.com>; Tue, 14 Jun 2011 10:06:06 -0700 (PDT)
Received: from mail-yw0-f44.google.com (mail-yw0-f44.google.com [209.85.213.44]) by ietfa.amsl.com (Postfix) with ESMTP id 8C9EC11E808A for <oauth@ietf.org>; Tue, 14 Jun 2011 10:06:03 -0700 (PDT)
Received: by ywp31 with SMTP id 31so3803944ywp.31 for <oauth@ietf.org>; Tue, 14 Jun 2011 10:06:03 -0700 (PDT)
Received: by 10.150.255.36 with SMTP id c36mr8471496ybi.56.1308071161915; Tue, 14 Jun 2011 10:06:01 -0700 (PDT)
Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by mx.google.com with ESMTPS id u21sm952396ybm.17.2011.06.14.10.06.00 (version=SSLv3 cipher=OTHER); Tue, 14 Jun 2011 10:06:00 -0700 (PDT)
Received: by yxt33 with SMTP id 33so1745068yxt.31 for <oauth@ietf.org>; Tue, 14 Jun 2011 10:05:59 -0700 (PDT)
Received: by 10.91.207.11 with SMTP id j11mr8014337agq.17.1308071159646; Tue, 14 Jun 2011 10:05:59 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.90.36.10 with HTTP; Tue, 14 Jun 2011 10:05:25 -0700 (PDT)
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E112868E56E3@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E112868E56E3@WSMSG3153V.srv.dir.telstra.com>
From: Adam Barth <ietf@adambarth.com>
Date: Tue, 14 Jun 2011 10:05:25 -0700
Message-ID: <BANLkTikWXZSi0cVfAt0b-hM8B0k7ij5c2g@mail.gmail.com>
To: "Manger, James H" <James.H.Manger@team.telstra.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: oauth <oauth@ietf.org>
Subject: Re: [OAUTH-WG] FW: MAC: Cookie name or value as MAC key id
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/oauth>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Jun 2011 17:06:07 -0000

On Tue, Jun 14, 2011 at 7:25 AM, Manger, James H
<James.H.Manger@team.telstra.com> wrote:
>>> There have been suggestions that the MAC calculation could/should cover
>>> the key id. In that situation it is even more crucial that the id field isn't just a
>>> name referring to the real value elsewhere - as then the security changes
>>> based on the syntax used to issue the credentials.
>
>>What suggestions? We could not come up with any reason to include the key identifier in the >normalized string.
>
> Adam Barth said "one possibility is to include the value of the Cookie header in the MAC". That was in response to Robert Sayre's suggestion of a server-provided nonce ("opaque" parameter) that would be covered by the MAC, which Adam said could go into the key id. Adam did go on to say he hadn't seen much demand for this feature from site operators he has talked to. [http://www.ietf.org/mail-archive/web/oauth/current/msg06631.html]
>
> So not a complete suggestion with proposed text for the spec -- just a hint that it was a possible design. HTTP Digest signs the username, for instance. I don't have a specific reason to sign the key id. I don't think it would be harmful. Perhaps it could help where the key id is actually a combination of complicated assertions (eg SAML) by giving a bit more protection against attacks that modify the Authorization header. Various PKI specs include a cert id in the data they sign, purportedly for security/legal reasons.
>
> The point was that an id field that is sometimes the key id, but at other times just a pointer to the key id (with no indication of which mode is in use), does not feel like a good design -- at least not until I understand the compelling reason for keeping the Cookie header when using MAC with Cookie-issued credentials.

Oh, we'd put that in the ext field because it's specific to the Cookie
instantiating of the protocol.  If you're using a SAML or whatever
other instantiation of the protocol, you'll want to put that stuff in
the ext field rather than cluttering up the base protocol.

> Adam provides an ok argument for why tacking MAC-... attributes on to an existing cookie will be the simplest implementation choice. (Thanks)
>
>>Most folks who run web sites use cookies to generate sessions.  These
>>folks will layer the MAC protections on top of their existing systems
>>by adding a couple cookie attributes and verifying an HMAC.  If we
>>removed the MAC cookie from the Cookie header, the Cookie header would
>>be different in supporting and legacy user agents, causing pain and
>>misery.
>>
>>It might be instructive to try using MAC in a real deployment.  You'll
>>see immediately why this behavior is preferable.
>
> Perhaps omitting the id parameter from the Authorization header would be an even better approach than using the cookie name. It avoids that minor repetition, and is an unambiguous signal that the key id comes from elsewhere (ie from a cookie value).

Yeah, I've often wondered whether we should remove the id parameter
from the Authorization header.  My understanding is that it plays some
important role in the OAuth instantiation of the protocol.  There's
also the question about what to do when you have multiple cookies with
MAC attributes.  In that case, having the id to disambiguate seems
useful.

Adam