Re: [OAUTH-WG] Refresh tokens

Leo Tohill <leotohill@gmail.com> Sat, 20 July 2019 19:45 UTC

Return-Path: <leotohill@gmail.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 6B39A120048 for <oauth@ietfa.amsl.com>; Sat, 20 Jul 2019 12:45:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 (2048-bit key) header.d=gmail.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 w23VFZFvivaC for <oauth@ietfa.amsl.com>; Sat, 20 Jul 2019 12:45:30 -0700 (PDT)
Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 C305A12001E for <oauth@ietf.org>; Sat, 20 Jul 2019 12:45:30 -0700 (PDT)
Received: by mail-pg1-x531.google.com with SMTP id f5so7034198pgu.5 for <oauth@ietf.org>; Sat, 20 Jul 2019 12:45:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7k+/r+7rFXE4OynhmRGp3ur4YeHSC6DgXR02LXMknHo=; b=NwdS7a1LFco+ScAicNZcwhi94a0NGXGN47/fX4p1iUFLmTs5KzZErG9f/xkgj007Mb ooW9T9wK5VZOQ/f9uk0Pf1P/pncH7fIyn/Gk9ACMQaZN15iSIzN1AmVW7bZMFR8S9mJr PUwCo8tJbT5E1Bg93tYwfSWJOSiV8kLdvjNSM2BuOnXPecUP+kvFijKcGmB9T2/N19v6 hE4nCTqvZHeQxh9ZsnuhkRuuudfMOyEnBjOv+fSNdU966noV0DgYZ+ZOettjR+csM24O 93i0pK8GWQ7ZSxl1lFdihBhXNL0WlV6tiEndBoQUsEJDdv6bhWHFZRcwplQgS5kYn7LP W3zQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7k+/r+7rFXE4OynhmRGp3ur4YeHSC6DgXR02LXMknHo=; b=W2FGCeVZSIFgXP/7Tm3uZYSuWjbLpp4PgY2bNRf5yUEtMZ/eCpV92ep2iLzwDJk9qK g/WKHwUh/DvyktquGdbZWLwxfCStJ9mMmqty9KmHEJ8ZwBWbJsdsD27gnAJGLCVXfHmR iLkfD7YqLgJh+wNUYY7mk3B1xOpvV2hw6P5kk4KwaT7SiPSdFq0psouGbm4QC3H+cZhA mNNP8SvPp1eRZ4NLTVo4+GBWZPQPU7mRS8rJooiOiCxdofK2zl1p+yDxyzykNsBLlhUm xgsZw5Lk/i0DVOOKzoWa1ohPuIxX5z+jAc60qdn0MMhHh1m3TVJ9pUooROIrZ8xn7GVE fbPA==
X-Gm-Message-State: APjAAAVp7UQQ1WgwA37ha1biMpFfF3R+IWt0aj4tKsvsUO2oaYFisL68 2FqVQZqZWqJzHFPIXPdwNVQBkV1k09AkF59O7+4=
X-Google-Smtp-Source: APXvYqwVrGrVhLPGNnqXImjQdOBh3i7VWrUbtfADcVxE3eSLrBuj9C1/JB0FHCw9/inpocU51CaD9/ddGUkPwd/Ehlk=
X-Received: by 2002:a17:90a:a116:: with SMTP id s22mr65485977pjp.47.1563651929904; Sat, 20 Jul 2019 12:45:29 -0700 (PDT)
MIME-Version: 1.0
References: <CABw+FcsH3CHmFphz5DD6aDeEqKLxbQhY14kdrXCVY0WXQN6PuQ@mail.gmail.com> <AEC7268A-D22D-41DA-8609-E7D2DD3B290C@alkaline-solutions.com> <624da319-b19c-053b-4fd0-048c0e2b8fb9@aol.com> <CAGBSGjp8m+V+i-sNnrLmu7DR_Bo1uv0iGkW2o7hiqUWw8Sc7qg@mail.gmail.com> <138cbde0-11b7-8f23-1028-3af0846b5a01@aol.com> <CAGBSGjq=SFG5nfOA6nwRsEQY576dsJDAHaL9UH4Yh7AAtOMu5Q@mail.gmail.com> <D676DDDE-20FE-4004-8E3F-124A560A1C20@mit.edu> <0A6F7761-9376-43EE-9B9C-0554812E13B7@forgerock.com> <CABw+Fcus9e5Et5aU_70tJwoX5BVfWaFbiJ+f4UgKe2zr46UPvQ@mail.gmail.com> <20C9E1B6-E497-41C9-9590-F68DD747E401@alkaline-solutions.com>
In-Reply-To: <20C9E1B6-E497-41C9-9590-F68DD747E401@alkaline-solutions.com>
From: Leo Tohill <leotohill@gmail.com>
Date: Sat, 20 Jul 2019 15:45:20 -0400
Message-ID: <CABw+FcspWmjRGRuNcudCivuj=GmbWR0sA_s5oNZJFc8Jc6nToQ@mail.gmail.com>
To: David Waite <david@alkaline-solutions.com>
Cc: Neil Madden <neil.madden@forgerock.com>, OAuth WG <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000d59b04058e221533"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/3sBkjkV2ZsSb57-chPOB2DyiJ_4>
Subject: Re: [OAUTH-WG] Refresh tokens
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, 20 Jul 2019 19:45:34 -0000

I did some looking around regarding the lifetime of refresh tokens in
various OP services.

Auth0 <https://auth0.com/docs/tokens/refresh-token/current>,and google
<https://developers.google.com/identity/protocols/OpenIDConnect#refresh-tokens>
do not appear to support a limited lifetime on refresh tokens.
AWS
<https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html>supports
a lifetime, but with day granularity (minimum 1 day).  It does not issue a
new refresh token when one is redeemed.
IdentityServer
<http://docs.identityserver.io/en/latest/topics/refresh_tokens.html>allows
a choice of behavior on refresh token expiration time.  It can have a
absolute expiration time, or use a sliding window.

I couldn't find anything in oauth or openid specs regarding refresh token
lifetime.

I'm thinking that our language might say that "if the OP supports refresh
token (absolute) lifetime, refresh tokens may be used (in the browser), but
should (must?) specify a expiration time."





On Sat, Jul 20, 2019 at 2:54 PM David Waite <david@alkaline-solutions.com>
wrote:

>
>
> > On Jul 20, 2019, at 12:38 PM, Leo Tohill <leotohill@gmail.com> wrote:
> >
> > Access tokens and refresh tokens, stored browser-side, are equally
> vulnerable to theft, because the storage options are identical.
> >
> > We are more concerned about the theft of the refresh token, because it
> (commonly) has a longer usable lifetime than the access token.
> >
> > Still , its a matter of degree. Since we accept the risk of access token
> theft,  why can't we accept the risk of refresh token theft?  We ameliorate
> the access token risk by using short lifetimes, but there is no standard
> for that value: it is situational.  Why doesn't the same reasoning apply to
> refresh tokens?
> >
> > This reasoning assumes that refresh tokens also have a limited
> lifetime.  I am unsure that this is always the case.  When one uses a
> refresh token to acquire a new access token, AND that operation issues a
> new refresh token, does the new refresh token get a new lifetime?  If so,
> then a refresh token can be used to retain access infinitely (or until it
> is revoked server-side).  In this scenario, the risks associated with
> browser-side storage of refresh token are much higher.
> >
> > In summary, I'd say that IF the lifetime of a refresh token can be
> limited, then refresh tokens pose identical risk as access tokens, and so
> the same considerations apply.
>
> Agreed
>
> I think there is an unwritten framework for evaluating the security of all
> tokens, regardless of type. For example: access tokens are shared with
> resources, so their security protections in the Security BCP including
> limiting replay against other resources, and optionally against new
> requests against the same resource.
>
> Because it is complex and unwritten, it is hard to do a true evaluation.
> My impression was always that refresh tokens were more ‘risky’ for public
> clients because “offline” refresh tokens may be good for an indeterminate
> period of time, and because lack of credentials means theft of the token is
> sufficient.
>
> In addition, a public client which does not use its refresh token in an
> “offline” manner may have theft go unnoticed for a considerable period of
> time, and the operational model of public clients usually puts detection of
> local token theft in the hand of the end user and client software, not an
> administrator or organizational security staff.
>
> But those concerns are mostly mitigated if the OP can set policy to
> control refresh token usage in concert with the authentication session.
>
> -DW