Re: [OAUTH-WG] A few comments on draft-ietf-oauth-rar-01

Neil Madden <neil.madden@forgerock.com> Wed, 08 July 2020 18:39 UTC

Return-Path: <neil.madden@forgerock.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 757433A078A for <oauth@ietfa.amsl.com>; Wed, 8 Jul 2020 11:39:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=forgerock.com
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 83UG09qxznjT for <oauth@ietfa.amsl.com>; Wed, 8 Jul 2020 11:39:07 -0700 (PDT)
Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6BA3E3A0789 for <oauth@ietf.org>; Wed, 8 Jul 2020 11:39:07 -0700 (PDT)
Received: by mail-wr1-x42f.google.com with SMTP id j4so47617770wrp.10 for <oauth@ietf.org>; Wed, 08 Jul 2020 11:39:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=forgerock.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8JogT+g46j714+3f/TlXYik9pyWhviYJL9hcRHYt6XY=; b=FhT9GMgKCXOeotqYg4UbTqDCoFLOspz3ifldiUyyLTphzK1Nse77t9/d6W9+vvaXdT 272Ln5DjRePysLN3a5ZYYDVCvG+/QfbdVL3hwe82NZU9Hfx+Q31CA3Xq08XCMpi11PGP +XWxcCwTAu4FZAEjrUT9o5AqoRO5bJtRlgIB8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8JogT+g46j714+3f/TlXYik9pyWhviYJL9hcRHYt6XY=; b=rIJqhnaLRO+yRJRoS8MV95ubNyMFSV7b0V96v6GYdry65MVuiqa9KWefDL2UpbHBUp ok6yIlLiMq2Y/hO3Lhwl5m+OQjfYSRAXZDsJnL58/DyNhpSsGhJuALu5la/l3u32miFZ fyBMKc4Y45yJEI9mD5/hcejk26XhpgTVjzZHUXjL5nxmTHahfPexeuW4Y0R0KMNEbXUq SMCD0iizHTM35X1LFQ/glxd/wsl+QV2tplEwmV2QQaSoJOsAv1PL1diDV1IUIhu2qQ2u AHS7KLR+yUjnGxzjW1Zv6sY1uHekndINndVUWGxILAI9dxbIJX3/D83YmsiKPb2rfZjm 60pA==
X-Gm-Message-State: AOAM5309LBRO0bviQHL6RxE5kRSWwH7ayiODKHJCJJwclKlkP6FCCjbd O9bnE1UvMW6wgW+s58dPq0CJOA==
X-Google-Smtp-Source: ABdhPJxVmICD0XutM1yQ7mKMvUu7y4jpGqrDw01Rz8eSHv4Mg6OEc6QXnVadIo5nfPM8Xq5rDC0tnA==
X-Received: by 2002:a5d:4d0b:: with SMTP id z11mr29920245wrt.24.1594233545401; Wed, 08 Jul 2020 11:39:05 -0700 (PDT)
Received: from [10.0.0.2] (128.211.93.209.dyn.plus.net. [209.93.211.128]) by smtp.gmail.com with ESMTPSA id l18sm1246547wrm.52.2020.07.08.11.39.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2020 11:39:04 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
From: Neil Madden <neil.madden@forgerock.com>
In-Reply-To: <0982ACB0-CDE4-4B26-AF80-63C650263445@lodderstedt.net>
Date: Wed, 08 Jul 2020 19:39:04 +0100
Cc: oauth <oauth@ietf.org>, Justin Richer <jricher@mit.edu>
Content-Transfer-Encoding: quoted-printable
Message-Id: <083119F4-AAC4-4F04-BB3F-DD34B49E21B1@forgerock.com>
References: <0982ACB0-CDE4-4B26-AF80-63C650263445@lodderstedt.net>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/W6KULS2GiBnYZwzGblE1LMCEBLc>
Subject: Re: [OAUTH-WG] A few comments on draft-ietf-oauth-rar-01
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 08 Jul 2020 18:39:11 -0000

Hi Torsten,

> On 8 Jul 2020, at 17:20, Torsten Lodderstedt <torsten@lodderstedt.net> wrote:
> 
> Hi Neil, 
> 
>> On 8. Jul 2020, at 16:40, Justin Richer <jricher@mit.edu> wrote:
>> 
>> The two-phase approach is exactly what OBUK does, where you get one access token using client credentials before getting a more specific one in context of the user’s consent. This ends up being awkward to implement at best, since OAuth involves the user too early in the process to allow for this kind of thing. PAR might help address this dichotomy, but RAR can provide places for this to fill in.
>> 
>> With XYZ, I tried to design for that kind of multi-stage transaction pattern more explicitly, with the idea that you could continue your request in context and vary it over time, or even start a new request in the context of an existing one. This is something that I intend to continue with the soon-to-be-formed GNAP working group, if you want to bring this use case there.
>> 
>> — Justin
>> 
>>>> On Jul 6, 2020, at 12:32 PM, Neil Madden <neil.madden@forgerock.com> wrote:
>>> 
>>> I’m reading draft-ietf-oauth-rar-01 in a bit more detail now I have some time, and I have a few comments.
>>> 
>>> An assumption in the draft appears to be that the client knows ahead of time what it wants to gain access to and can describe it in detail. For example, the last example in section 2.1 is a client requesting access to particular files, which assumes that the client already knows the paths of the files it wants to access. This in turn seems to imply that the client already has some level of access to be able to determine this, e.g. to list directories, which may not be desirable. In many cases like this I think it’s more natural for the client to not know exactly what it is asking for but instead to want access to *some* file, chosen by the user. An example of this is the Dropbox Chooser [1] and Saver [2] APIs, which notably are not built on top of OAuth. In these cases it would be more natural for the client to send a more generic request and for the details to be filled in by the user as part of the consent process.
> 
> That’s a very good point.
> 
> There are scenarios where the client knows the resources it wants to interact with in advance, potentially from another transaction (e.g. first access to account list, payment initiation afterwards). 
> 
> The scenario you are describing is viable as well. In such a case, the request would be fairly generic but the AS (or the RS) would need to make transparent to the client what resources it just obtained access for. Interestingly, this might also happen if the client wants to access accounts. It could just request access to accounts and the user, in the consent, selects the accounts to disclose to the client. In our design at yes, we reflect this in an augmented authorization_details object in the token response (an addition for the spec I have on my list). 

Ok, it sounds like this can be incorporated into the draft. 

>>> Another issue is that as far as I can see in the current draft, any client can initiate a rich authorization request at any time without any kind of prior approval. This seems problematic for the main example in the draft, i.e. payment initiation. As an attacker, if I can get a consent screen up on a user’s device requesting to move money around then it seems like half my job is already done - some fraction of users will probably approve such a transaction without properly checking it. It feels like the ability to ask for transaction approval should already be a privileged operation that should require consent and approval.
> 
> I think RAR will almost always be used in conjunction with PAR. This means the client is authenticated before the user interaction starts preventing the attack you mentioned. I think we should at least recommend this in the draft. 

See other discussion. Client authentication is not the issue here, it’s about user consent. The underlying assumption appears to be that all legitimate clients registered with a bank are trustworthy because of vetting, reputation etc. Even putting aside that issue, as a user, if an app or service acts in a way that I don’t like then I should be able to stop using that app regardless of whether the app has violated any rules. 

In normal OAuth I can always go and revoke a grant to indicate that I no longer use that app/service. In RAR I don’t have that option because every transaction starts from scratch. I’m not arguing that every use of RAR will require this kind of two-phase user authorization approach, but that the current description of RAR seems to preclude using the normal OAuth mechanisms to manage this relationship in the transactional case. If PAR can bridge that gap, it would be good to explicitly call that out.

>>> A related issue is that each approval is in effect a completely isolated incident. In a normal OAuth2 interaction I would grant an app some longish-term access to data and it would get an access token and optionally a refresh token. At some later point I can go to the AS and see that I have granted this access and revoke it if I choose. With RAR there is no representation of a long-term relationship between the RO and the client and each transaction starts from fresh. Again, this seems potentially problematic and not quite in keeping with how OAuth currently operates. Each grant of access is ephemeral. (Do refresh tokens make sense in the context of RAR?)
> 
> Some of the use cases initially causing the development of RAR are transactional (as pointed out by Vladimir) others are not. RAR is about a richer vocabulary for describing the scope of access.
> 
> In the beforementioned account information scenario, the client would, for example, ask for read access to several accounts. Access to balance for one and access to balance & transaction history for another account. This could easily be expressed using RAR and would be a long term grant. If the client for the same user asks for access to another account (and the user approves), the AS should add this to the same underlying grant. This effectively means, the client could use the same token (refresh and access token) to access all accounts. 

I am generally against proposals that encourage accumulating authority in a single token, so I’m not convinced this is a good idea. But for the sake of argument, I’ll assume that there are good non-transactional applications of RAR. 

>>> I think a better approach would be a two-phase authorization process:
>>> 
>>> 1. In step 1 an app gets a normal long-lived access and/or refresh token that grants it permissions to ask to initial transactions (RARs) - e.g. with scope initiate_payments
> 
> I agree. This is PAR. PAR + RAR is in the end a generalised version of the UK OB consent pattern. 

PAR currently only allows client credentials to authorize requests to the pushed auth endpoint. But what I’m describing would instead use an access token (authorized by the user). This seems closer to what OB currently does, but using a user-approved access token rather than a client_credentials granted one.

There are other approaches, for example based on macaroon 3rd-party caveats. I’ll try to knock up a decent description or demo of the approach because it has some appealing properties. But whatever the implementation, the important thing is that there is some consideration of these issues. 

— Neil