Re: [OAUTH-WG] draft-parecki-oauth-browser-based-apps-00

Torsten Lodderstedt <torsten@lodderstedt.net> Sat, 17 November 2018 11:27 UTC

Return-Path: <torsten@lodderstedt.net>
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 EE708130DC7 for <oauth@ietfa.amsl.com>; Sat, 17 Nov 2018 03:27:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=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 aCE42z7gbNu1 for <oauth@ietfa.amsl.com>; Sat, 17 Nov 2018 03:27:00 -0800 (PST)
Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.18.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CBF87129C6A for <oauth@ietf.org>; Sat, 17 Nov 2018 03:26:59 -0800 (PST)
Received: from [91.13.153.47] (helo=[192.168.71.123]) by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <torsten@lodderstedt.net>) id 1gNyka-00054y-Vg; Sat, 17 Nov 2018 12:26:57 +0100
From: Torsten Lodderstedt <torsten@lodderstedt.net>
Message-Id: <A96E37F1-B09D-41C9-9F5F-DA7C133B00E2@lodderstedt.net>
Content-Type: multipart/signed; boundary="Apple-Mail=_D31A4D72-DAF5-41D3-BE46-D4D0C33CD1FB"; protocol="application/pkcs7-signature"; micalg="sha-256"
Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\))
Date: Sat, 17 Nov 2018 12:26:56 +0100
In-Reply-To: <915498670.1574190.1542373190714@mail.yahoo.com>
Cc: Brock Allen <brockallen@gmail.com>, oauth@ietf.org
To: Tomek Stojecki <tstojecki@yahoo.com>
References: <VI1PR0801MB211299BED6B61582DC33B873FACB0@VI1PR0801MB2112.eurprd08.prod.outlook.com> <CAGBSGjqHKVveZor-oKUWzsQ0Rg5Fk_d2dns_eQFqfvXJynyQaQ@mail.gmail.com> <9347fff8-f3b9-4ee9-84d3-5eebc8dd13f4@getmailbird.com> <309DAA7D-E9B9-4A89-B30E-5BE37DC6CC85@lodderstedt.net> <27627bee-aaab-44fd-9821-b58f7b33bc13@getmailbird.com> <7A852312-B129-4A0F-9914-8DC7E63FD12C@lodderstedt.net> <64a7f649-d2d8-4983-a564-5193adb4314a@getmailbird.com> <915498670.1574190.1542373190714@mail.yahoo.com>
X-Mailer: Apple Mail (2.3445.101.1)
X-Df-Sender: dG9yc3RlbkBsb2RkZXJzdGVkdC5uZXQ=
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/XHnDgfZv_lEbqqVUCSOOU8OyUd4>
Subject: Re: [OAUTH-WG] draft-parecki-oauth-browser-based-apps-00
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: Sat, 17 Nov 2018 11:27:02 -0000

Hi Tomek,

> Am 16.11.2018 um 13:59 schrieb Tomek Stojecki <tstojecki@yahoo.com>:
> 
> >> The AS can bind the lifetime of the refresh tokens to the session lifetime, i.e. automatically revoke it on logout. 
> 
> > Yea, I saw your other email asking about refresh token revocation relating to session management. Obviously for certain clients, this won't make sense, but for implicit/browser-based ones it's a nice feature to have.
> 
> I agree that this can be useful, however with where we are today, is this supported by auth servers such that it can distinguish offline from renewable-online clients and only revoke the latter when logging out? 

See other thread on refresh token revocation on logout. There seems to be some implementations. Basically, I don’t think the clients needs to now because it always needs to be prepared to handle invalid (invalidated) refresh tokens (see https://tools.ietf.org/html/rfc6749#section-5.2) 

> 
> > The alternative, as you mentioned, is to not issue refresh tokens and do token renewal the "same old way" via iframe with prompt=none, while still using code flow.
> 
> Going from Implicit to Code deals with the problem of sending RT in the URL, which I agree is a plus.

Have you taken a look at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-09#section-2.1.2? It gives all the justification. 

> Is there anything else in a way of an improvement? I still am not comfortable enough with the idea of releasing RTs to the browser clients where it can't be encrypted, prone to xss, etc… 

As already stated. The AS is not required to issue refresh tokens.

If the AS decides to issue refresh tokens, there are ways to protect the refresh token from replay even for public clients. 

To start with, the AS may use refresh token rotation in combination with automatic revocation in case of detected replay attempts. 

How does it work? The AS issues a new refresh token with every refresh and invalidate the old one. This restricts the lifetime of a refresh token. If someone (might be the legit client or an attacker) submits one of the older, invalidated refresh token, the AS might interpret this as a signal indicating token leakage and revoke the valid refresh token as well. We used this technique at Deutsche Telekom since our first OAuth 2.0 implementation back in 2012.

An emerging alternative is to use Token Binding (in browser) or Mutual TLS (other clients) to bind the refresh token to the client’s key key pair.

kind regards,
Torsten. 

> 
> 
> -Tomek
> 
> On Thursday, November 15, 2018, 11:01:37 PM GMT+1, Brock Allen <brockallen@gmail.com> wrote:
> 
> 
> > It still lacks the ability to issue sender constraint access tokens.
> 
> So you mean at the resource server ensuring the token was really issued to the client? Isn't that an inherent limitation of all bearer tokens (modulo HTTP token binding, which is still some time off)? Resource servers don't know the flow the clients might use, especially if/when they have many clients.
> 
> > The AS can bind the lifetime of the refresh tokens to the session lifetime, i.e. automatically revoke it on logout. 
> 
> Yea, I saw your other email asking about refresh token revocation relating to session management. Obviously for certain clients, this won't make sense, but for implicit/browser-based ones it's a nice feature to have.
> 
> The alternative, as you mentioned, is to not issue refresh tokens and do token renewal the "same old way" via iframe with prompt=none, while still using code flow.
> 
> > The only potential „baby step“ I would see is to move towards „token id_token“. Since this requires signature/at_hash checks etc. I doubt this is really easier than moving to code and exchange the code for an access token. What’s your opinion?
> 
> Even since OIDC arrived, this is the only flow I use for JS/browser-based clients (anything less has always seemed so obviously inferior). So for me and my customers, all browser-based clients I am involved in are already there. Perhaps this is the reason for all of my questions/comments about the recent BCP doc. Given "id_token token", CSP, and using the browser history API to wipe the access token from browser history, we already have a decent set of tools to mitigate attacks. As I already conceded, the only remaining issue (IMO) is the short window of time the access token is in the URL.
> 
> Given that it seems to me that OIDC and OAuth2 are typically used together (at least when a user is involved with authentication), I always wonder why the OAuth and OIDC WGs are separate. Given that so much effort of the two sets of specs overlap, it seems odd to keep adding onto the OAuth specs and ignoring the added features that OIDC provides. I don't mean to derail this thread, or step on any political toes, so apologies in advance.
> 
> 
> -Brock
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth