Re: [websec] Indicating origin of OAuth credentials to combat login CSRF

"Manger, James H" <James.H.Manger@team.telstra.com> Mon, 28 February 2011 02:18 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: websec@core3.amsl.com
Delivered-To: websec@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 736473A6961 for <websec@core3.amsl.com>; Sun, 27 Feb 2011 18:18:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.251
X-Spam-Level:
X-Spam-Status: No, score=-0.251 tagged_above=-999 required=5 tests=[AWL=0.650, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EpjSvQwC+SVW for <websec@core3.amsl.com>; Sun, 27 Feb 2011 18:18:29 -0800 (PST)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) by core3.amsl.com (Postfix) with ESMTP id 6AC023A6A57 for <websec@ietf.org>; Sun, 27 Feb 2011 18:18:29 -0800 (PST)
X-IronPort-AV: E=Sophos;i="4.62,237,1296997200"; d="scan'208";a="26405353"
Received: from unknown (HELO ipcdvi.tcif.telstra.com.au) ([10.97.217.212]) by ipobvi.tcif.telstra.com.au with ESMTP; 28 Feb 2011 13:19:27 +1100
X-IronPort-AV: E=McAfee;i="5400,1158,6270"; a="20146369"
Received: from wsmsg3706.srv.dir.telstra.com ([172.49.40.80]) by ipcdvi.tcif.telstra.com.au with ESMTP; 28 Feb 2011 13:19:27 +1100
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3706.srv.dir.telstra.com ([172.49.40.80]) with mapi; Mon, 28 Feb 2011 13:19:26 +1100
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Adam Barth <ietf@adambarth.com>, "websec@ietf.org" <websec@ietf.org>
Date: Mon, 28 Feb 2011 13:19:25 +1100
Thread-Topic: [websec] Indicating origin of OAuth credentials to combat login CSRF
Thread-Index: AcvVhDZuebDVjch7TmW/2L7IGMnuwgBXSkeA
Message-ID: <255B9BB34FB7D647A506DC292726F6E1127ECCD305@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E1127DCD2142@WSMSG3153V.srv.dir.telstra.com> <AANLkTina+=5uV4V7DRfX6RsZUDU1j_Ag+Ruf2C9dPOW_@mail.gmail.com>
In-Reply-To: <AANLkTina+=5uV4V7DRfX6RsZUDU1j_Ag+Ruf2C9dPOW_@mail.gmail.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [websec] Indicating origin of OAuth credentials to combat login CSRF
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Web Application Security Minus Authentication and Transport <websec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/websec>
List-Post: <mailto:websec@ietf.org>
List-Help: <mailto:websec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 28 Feb 2011 02:18:30 -0000

>On Thu, Feb 24, 2011 at 4:08 PM, Manger, James H
><James.H.Manger@team.telstra.com> wrote:
>> Q. Should an OAuth client app list the authorization server in the Origin
>> header of requests to resource servers?

Adam Barth replied:
> They are allowed to, but are not required to, by the Origin header
> specification.  Whether they should or not is a question for the OAuth
> working group to decide.

That is true, Adam, but I was hoping for a bit more advice from the group knowing most about "Origin" and cross-site requests about the need to indicate the server that dynamically provided an opaque value that the client is putting in the Authorization header of subsequent cross-origin requests.


Once specific question for websec is:
What semantics are associated with the *order* of origins in an "Origin" HTTP request header value?

The Origin spec implies (but doesn't explain) that there is some meaning to the order: a duplicate origin is omitted if it would be next to the same value (but included if there are intervening origins); and a site returning a redirect is appended to existing origins.

CORS seems to ignore the order of origins for non-preflight requests [http://www.w3.org/TR/cors/#resource-requests section 5.1 step 2].
CORS seems to imply a preflight request can only have a single origin in its "Origin" header [section 5.2 step 2]. That might not work well if OAuth says the authorization server shall be indicated in the "Origin" header as well.


Perhaps it would be better for the Origin header to be specified as a *set* of origins, not a list. That is, state that order doesn't matter (and no duplicates are allowed). Would that hinder any uses of Origin?


I suspect open redirectors are the problem. After a redirect, the origin of the original request no longer has any influence over the subsequent request so, theoretically, they should be dropped from the Origin header. In practise, that is only secure if trusted sites do not have open redirectors -- that might be too much to hope for.
It seems to me that the Origin spec is keeping the pre-redirect origins to cope with open redirectors, and implicitly hoping the order of origins can be used to ignore all but the last origin when necessary. Such an unstated hope interacts badly if OAuth adds an origin that isn't from a redirect.

--
James Manger