Re: [OAUTH-WG] User-agent flow and pre-registered redirect_uri

Marius Scurtescu <mscurtescu@google.com> Fri, 11 June 2010 19:16 UTC

Return-Path: <mscurtescu@google.com>
X-Original-To: oauth@core3.amsl.com
Delivered-To: oauth@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 2ED1B28C13B for <oauth@core3.amsl.com>; Fri, 11 Jun 2010 12:16:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -100.305
X-Spam-Level:
X-Spam-Status: No, score=-100.305 tagged_above=-999 required=5 tests=[AWL=-0.742, BAYES_40=-0.185, FM_FORGED_GMAIL=0.622, USER_IN_WHITELIST=-100]
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 yQT-kcPOdtnU for <oauth@core3.amsl.com>; Fri, 11 Jun 2010 12:16:02 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.35]) by core3.amsl.com (Postfix) with ESMTP id 93B3628C143 for <oauth@ietf.org>; Fri, 11 Jun 2010 12:15:54 -0700 (PDT)
Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id o5BJFs5M015883 for <oauth@ietf.org>; Fri, 11 Jun 2010 12:15:54 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1276283755; bh=9TSGnfXEg12onHrDORzacLcmHiM=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding; b=riyGYxYfsQ2V3wnga6KEprMvUDJvuAnzEMNlsvQgsaxqwy4eGzB9VYXDs2I5HTYNb gSC7uRs3DqEQg+wh5lMJQ==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:from:date:message-id: subject:to:cc:content-type:content-transfer-encoding; b=Dg/YrFF3BpUrjn7IvMxAczoTfNjiOjZSk7LkUFGGZOyefflUrO0BTbABJ2vtbdVSM F1tg80w91TeC++IAT4QYg==
Received: from pwi9 (pwi9.prod.google.com [10.241.219.9]) by wpaz37.hot.corp.google.com with ESMTP id o5BJFqtC026789 for <oauth@ietf.org>; Fri, 11 Jun 2010 12:15:53 -0700
Received: by pwi9 with SMTP id 9so766289pwi.30 for <oauth@ietf.org>; Fri, 11 Jun 2010 12:15:52 -0700 (PDT)
Received: by 10.141.91.19 with SMTP id t19mr1743134rvl.104.1276283752090; Fri, 11 Jun 2010 12:15:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.141.124.13 with HTTP; Fri, 11 Jun 2010 12:15:32 -0700 (PDT)
In-Reply-To: <4C12848E.8090105@aol.com>
References: <AANLkTingSGlJNZ5e_stPd1qU5I4gfbh3rQhqYUmqXvdB@mail.gmail.com> <C833CEB4.6B81%cmortimore@salesforce.com> <AANLkTinVQEPBVzmiHEGgHhzaILL0nRSvZpjIlrVEJwTw@mail.gmail.com> <AANLkTil1j7vl8PU2tgCzlWY0U6KiWPmRKiVOxvsctB00@mail.gmail.com> <AANLkTimCL-O7RIsUlt_zGDfkEEYb9w4_sPh6zxCMBsf0@mail.gmail.com> <AANLkTin7B9pPgSu3cNlJGkp_gCed-5aPGRZalzXd2Wg8@mail.gmail.com> <4C124A70.2000002@aol.com> <1276268753.31840.50.camel@localhost.localdomain> <4C1257B5.9080706@comlounge.net> <AANLkTilcpAw7hZuQK43_ybS-wy3bQnPqMfRXOdqY4iYa@mail.gmail.com> <AANLkTimGnTj1HseMsPBaRXjBThM3uktqq0R6P30jsjaZ@mail.gmail.com> <AANLkTimyvpXmlOXRKSA4Oe0s3rqoiLQgtgvbRlvniEJ6@mail.gmail.com> <4C126367.40403@aol.com> <AANLkTimKEFRu-PboKcpXFlFN7Q_675ZjICBnK9IliUzs@mail.gmail.com> <4C126D63.9090903@aol.com> <AANLkTinryo8AMgqgQoPgn0cAxuYNXhHtBS--rx5A52Zb@mail.gmail.com> <4C12848E.8090105@aol.com>
From: Marius Scurtescu <mscurtescu@google.com>
Date: Fri, 11 Jun 2010 12:15:32 -0700
Message-ID: <AANLkTimIkVSldwpWtKgRjZushfH9_JzzzoJ7PIsp97ET@mail.gmail.com>
To: George Fletcher <gffletch@aol.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: oauth@ietf.org
Subject: Re: [OAUTH-WG] User-agent flow and pre-registered redirect_uri
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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: Fri, 11 Jun 2010 19:16:04 -0000

On Fri, Jun 11, 2010 at 11:46 AM, George Fletcher <gffletch@aol.com> wrote:
> On 6/11/10 2:09 PM, Marius Scurtescu wrote:
>>
>> On Fri, Jun 11, 2010 at 10:07 AM, George Fletcher<gffletch@aol.com>
>>  wrote:
>>
>>>
>>> On 6/11/10 12:34 PM, Marius Scurtescu wrote:
>>>
>>>>
>>>> On Fri, Jun 11, 2010 at 9:25 AM, George Fletcher<gffletch@aol.com>
>>>>  wrote:
>>>>
>>>>
>>>>>
>>>>> On 6/11/10 12:07 PM, Marius Scurtescu wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> On Fri, Jun 11, 2010 at 8:59 AM, David Recordon<recordond@gmail.com>
>>>>>>  wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> That sounds like a security consideration to me! :)
>>>>>>>
>>>>>>> I imagine that authorization servers will verify ownership in
>>>>>>> different manners depending on their tolerance of risk.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Instead of POSTing a JSON with all the details, dynamic binding could
>>>>>> send only a host name. The authz server would then do discovery on
>>>>>> this host and get a pointer to this JSON from host-meta.
>>>>>>
>>>>>> Marius
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> I think most all of this could be described in the host-meta XRD
>>>>> directly
>>>>> to
>>>>> save yet another round trip. And I believe there are some security
>>>>> advantages to using this approach, but it does require the "client" to
>>>>> be
>>>>> a
>>>>> web-server. This might not always be the case (rich desktop app). For
>>>>> native/desktop apps, it seems that posting some set of parameters
>>>>> (equivalent security-wise to a browser user-agent) makes sense and
>>>>> keeps
>>>>> the
>>>>> protocol simple.
>>>>>
>>>>>
>>>>
>>>> Yes, but in this case (desktop app) the "url" and "icon" parameters
>>>> don't work and what is left is "name" and "description". I think that
>>>> the suggested "client_name" parameter does exactly the same thing,
>>>> much simpler. Is there any value in this case in a client_secret?
>>>>
>>>> Marius
>>>>
>>>>
>>>
>>> Well... given this is a POST and structured data... it would be possible
>>> for
>>> the desktop app to post the raw icon data (though I suppose it could also
>>> POST a URL to the web server of the company the produces the app). In
>>> which
>>> case your previous suggestion would work (parameters discovered via the
>>> URL).
>>>
>>> I do believe the client_secret is valuable in this case because the AS is
>>> returning both the client_id and the client_secret. This then becomes a
>>> way
>>> for provisioning a unique client_id and client_secret to every instance
>>> of
>>> the app. A lot more for the AS to keep track of, but also makes it more
>>> difficult for an attacker to compromise a client. The attacker could
>>> impersonate the POST'd client description data (just like user-agent
>>> strings
>>> can be impersonated), but then the attacker just has a client_id and
>>> client_secret for it's instance.
>>>
>>> This should force the attacker to get explicit user consent from the user
>>> to
>>> authorize that unique client_id. I wouldn't recommend for the AS to track
>>> authorization against the POST'd client description but rather the
>>> client_id.
>>>
>>
>> An attacker can also dynamically register a very similar client
>> name/description and trick the user.
>>
>
> True... but the user will see another consent form. This might be a minor
> hurdle but at least it's not totally seamless. I think that is an advantage.

Why would the user see another consent form? Were you thinking
auto-approvals? For desktop apps auto-approvals don't make much sense
and authz servers should probably never do that.


>> The authz server is issuing a unique refresh token for each client,
>> and I still don't see how an extra client_secret helps in this case.
>>
>
> Good point. With SSL and bearer tokens the client_secret doesn't do much
> good. Now if we signed the requests with the unique client_secret from the
> desktop app... :)

Yes, but let's see how the signature specs work out.


>> For a web client the client secret helps if the refresh token is
>> compromised. The web client most likely will store many refresh
>> tokens, one for each user, in the database, with SQL injection all of
>> these can be compromised, but the client secret (if it was not in the
>> same database) makes them useless. This could be a reason why dynamic
>> registration for web clients is a bad idea, the client secret will end
>> up in the database, instead of a config file.
>>
>
> The web site could store client_secrets in a different database that is not
> exposed to the same SQL Injection attacks. Where the data is stored doesn't
> seem like it affects it's ability to be compromised or protected. If the web
> server is not well protected, getting the config file with the client_secret
> might be easier than getting data out of the database. I think the security
> of where the web app stores the data is orthogonal to the security of the
> protocol.

Maybe, not sure. If web clients are encouraged to put the secret in
the database then it will end up next to the refresh token, for sure.


> I suppose this also depends on which flow the desktop app is following. If
> using the web-user flow (by launching the default browser, then the
> client_secret (v2-06) is required. If following the device flow... then it's
> not (though it seems this flow is still being defined).

client_secret is required only if one was issued, "REQUIRED if the
client identifier has a matching secret." So the Web Server flow
should work just fine for unregistered or unsecure (registered but no
secret was issued) clients.


> So maybe the solution is that if the authorization server doesn't think the
> client_secret is useful, it doesn't return it. Or it always returns it and
> the client can throw it away as it knows it won't use it. However, it seems
> like the rest of the registration flow still holds.

Without client_secret I still don't see the point. Registration then
boils down to self asserted name, which can also be achieved with the
client_name paramter, no?

Marius