Re: [OAUTH-WG] oauth-meta: turi allows user to mislead app

"Manger, James" <James.H.Manger@team.telstra.com> Thu, 28 January 2016 06:16 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B44811B3AC1 for <oauth@ietfa.amsl.com>; Wed, 27 Jan 2016 22:16:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.301
X-Spam-Level:
X-Spam-Status: No, score=-0.301 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, HTML_MESSAGE=0.001, J_CHICKENPOX_35=0.6, RCVD_IN_DNSWL_LOW=-0.7, RELAY_IS_203=0.994] autolearn=no
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 oD2zFowpVGCZ for <oauth@ietfa.amsl.com>; Wed, 27 Jan 2016 22:16:47 -0800 (PST)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) by ietfa.amsl.com (Postfix) with ESMTP id 7E3681B3ABF for <oauth@ietf.org>; Wed, 27 Jan 2016 22:16:46 -0800 (PST)
X-IronPort-AV: E=Sophos; i="5.22,357,1449493200"; d="scan'208,217"; a="55320219"
Received: from unknown (HELO ipcavi.tcif.telstra.com.au) ([10.97.217.200]) by ipobvi.tcif.telstra.com.au with ESMTP; 28 Jan 2016 17:16:44 +1100
X-IronPort-AV: E=McAfee;i="5700,7163,8057"; a="69506049"
Received: from wsmsg3702.srv.dir.telstra.com ([172.49.40.170]) by ipcavi.tcif.telstra.com.au with ESMTP; 28 Jan 2016 17:16:43 +1100
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3702.srv.dir.telstra.com ([fe80::5c01:5192:426d:fe2f%16]) with mapi; Thu, 28 Jan 2016 17:16:43 +1100
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Nat Sakimura <n-sakimura@nri.co.jp>, "oauth@ietf.org" <oauth@ietf.org>
Date: Thu, 28 Jan 2016 17:16:42 +1100
Thread-Topic: [OAUTH-WG] oauth-meta: turi allows user to mislead app
Thread-Index: AQI8p81KlwM1SsaMd83m7w23juHIdp45pfZAgAAZIYA=
Message-ID: <255B9BB34FB7D647A506DC292726F6E13BB6E3BD12@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E13BB6E3B8E0@WSMSG3153V.srv.dir.telstra.com> <056601d15980$a996bfd0$fcc43f70$@nri.co.jp>
In-Reply-To: <056601d15980$a996bfd0$fcc43f70$@nri.co.jp>
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: multipart/alternative; boundary="_000_255B9BB34FB7D647A506DC292726F6E13BB6E3BD12WSMSG3153Vsrv_"
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/oauth/zAaY3ehk2PwnlBSkf-SawbAaF6U>
Subject: Re: [OAUTH-WG] oauth-meta: turi allows user to mislead app
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.15
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: <https://mailarchive.ietf.org/arch/browse/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: Thu, 28 Jan 2016 06:16:50 -0000

Even if theoretically secure, I don't think it is a good idea to send turi and require the client app to confirm it matches (or send duri and match issuer+well-known...). It will be too tempting to client apps to just use the turi/duri value.

draft-jones-oauth-mix-up-mitigation-01 is slightly better in sending an "iss" id to match, instead of a web address to follow. However, "iss" is actually a URI and is defined as the basis for discovery. If an app did discovery based on "iss" from the redirect it would be insecure. So I think apps using different redirect URIs for different ASs is a better idea (which happens to be the fix suggested in the paper on the "IdP Mix-Up" attack).

If we have to send something that another party should match, but not otherwise use, it might be better to send a hash instead of the actual value. That feel much harder for apps or servers to accidentally misuse insecurely.

--
James Manger


From: Nat Sakimura [mailto:n-sakimura@nri.co.jp]
Sent: Thursday, 28 January 2016 3:02 PM
To: Manger, James <James.H.Manger@team.telstra.com>; oauth@ietf.org
Subject: RE: [OAUTH-WG] oauth-meta: turi allows user to mislead app

Hi James,

Right. I thought of the man-in-the-browser case and was originally thinking of sending them in signed JWT(state,c_hash,a_hash,turi,ruri,duri,...) or sending HMAC(sha256, state+code+turi+ruri, client_secret) together but subsequently dropped the idea as anything is broken in the man-in-the-browser case. The bad user case did not occur to me then. I should not have dropped the idea. Incidentally, this probably fixes the cut-n-paste attack as well. For OpenID Connect, it amounts to returning these parameters in ID Token in the front channel. As you can expect, this is my preferred way.

If we do not want any crypto, then there has to be additional checks.
In case of duri, mandating the client to check that the duri = issuer + .well-known/openid-configuration.
For turi, it has to match one of the entry listed in the discovery document or or pre-set configuration. The same applies for ruri.
We probably want to have a cut-n-paste attack control in place as well.

For the token endpoint response that does not go through user browser, it should be ok to accept it as true.

--
PLEASE READ :This e-mail is confidential and intended for the
named recipient only. If you are not an intended recipient,
please notify the sender  and delete this e-mail.

From: OAuth [mailto:oauth-bounces@ietf.org] On Behalf Of Manger, James
Sent: Thursday, January 28, 2016 11:38 AM
To: oauth@ietf.org<mailto:oauth@ietf.org>
Subject: [OAUTH-WG] oauth-meta: turi allows user to mislead app

The OAuth-Meta draft <draft-sakimura-oauth-meta-05> returns the token endpoint (in a "turi" query parameter) when redirecting a user from the authorization endpoint back to an app. The app presumably then POSTs the "code" (also in the redirect) to "turi" to get an access token. However, apps typically send their client_secret to the token endpoint to authenticate. Sending a client_secret to a URI that came from a user is insecure.

A RESTful OAuth would be a great improvement, but it doesn't look like providing the token endpoint (nor discovery endpoint) in a redirect is the right approach.

--
James Manger