[OAUTH-WG] Refresh tokens

Leo Tohill <leotohill@gmail.com> Tue, 09 July 2019 02:10 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 2F6B8120390 for <oauth@ietfa.amsl.com>; Mon, 8 Jul 2019 19:10:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.703
X-Spam-Level:
X-Spam-Status: No, score=-0.703 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, PDS_NO_HELO_DNS=1.295, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no 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 S91WUgMH0YBg for <oauth@ietfa.amsl.com>; Mon, 8 Jul 2019 19:10:29 -0700 (PDT)
Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 0677E120365 for <oauth@ietf.org>; Mon, 8 Jul 2019 19:10:28 -0700 (PDT)
Received: by mail-pg1-x52f.google.com with SMTP id i8so8581592pgm.13 for <oauth@ietf.org>; Mon, 08 Jul 2019 19:10:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=UD04SfxctXv+GdutYCoixD4T/4L/snz6eYVNjpVVygY=; b=BboNM51/oOPF+Ix8ybAJzf5RyGLF+VT/IaYrfbyeXIpRvEgh7GTA602K4rq/NlbkAT yCTV59D7h5EGwG1fzYoaRLeW5wYgK+3bLrBgm9siKBtMsBVu+JHQpfxF8t4ZnquxWjz4 qTEAXfNmLXdN/ZZGK9v59lPglGw/835PX+lYZOSKUuTofseHpUV7YUaiuMjes0/ZgTaH 4pfgZgzsW1Lbckrd+mHDsdZPrzFL6fSuX/bJtEZIF9gpFSSs6Y1AzibewuBW4ero/0oQ 2f01e0M/i8TBVDLguFKf4tF9GbWN8MaMJcapLMD93iowOGI6hgpt/mFKk06sNDRZrr0L BmlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UD04SfxctXv+GdutYCoixD4T/4L/snz6eYVNjpVVygY=; b=m/Oz0h6r9WBWi6SEr4mVlECB4wGkHqqkX0WCljayDNh7UvaNZNExDp44qW8FDnCu9D w/35LoA9/2peAg6Fwha5C7UJwVUn/8ho2E6d0CgdR5weHW+cV8bnCVoby3qjH7PHu+4q UbANOXstNtoRPdp9RXYvPpFdSbWaQ1CRpyVhhtQcnVDYqmHT5WK5ppD3EFvdc7ocDwPC yl8IqxNcinOX+lAR5gRfVfKEMuny/Eeq2LGM/OzzWv7UnbtXEQg9EuYq/AxRlTlkUmwd zKhrOinUfn88j1urM3fBShf87OK7YOWtFIQ5UTorOYHlplGdDXfud2Xrder85mC8j0VH HCQg==
X-Gm-Message-State: APjAAAVsFM2BpKLzj/4ueT+nQyoV5EcoSCAImU28KaEXvE2SsDVIZyqE +DU/SuU31+wUJIFMkIkrakjLXTnTqsB1V0exe2qxJE0hb4Y=
X-Google-Smtp-Source: APXvYqw46VGsvxL213KvyRhC/jwKkWqNWtGnpV+ZwwPGdap+oeNafvnRlUuWjddh4zI/kkAo54K5XfOYCOIgnw9JsvE=
X-Received: by 2002:a63:fe15:: with SMTP id p21mr7185781pgh.149.1562638227120; Mon, 08 Jul 2019 19:10:27 -0700 (PDT)
MIME-Version: 1.0
From: Leo Tohill <leotohill@gmail.com>
Date: Mon, 08 Jul 2019 22:10:15 -0400
Message-ID: <CABw+FcsH3CHmFphz5DD6aDeEqKLxbQhY14kdrXCVY0WXQN6PuQ@mail.gmail.com>
To: OAuth WG <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000070a401058d36109e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/dTOjS8pr4Nuhrly5mWm2dzeBD3o>
Subject: [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: Tue, 09 Jul 2019 02:10:41 -0000

Ok, I'm creating a new posting for this feedback. :)

Here's where I probably just need some enlightenment, so please help me
out.

Re 8. Refresh Tokens

   "For public clients, the risk of a leaked refresh token is much
   greater than leaked access tokens, since an attacker can potentially
   continue using the stolen refresh token to obtain new access without
   being detectable by the authorization server.  "

(first, note the typo "stoken".)

Is it always "higher risk"?  I could even argue that leakage of a refresh
token is lower risk. As a bearer document, a leaked access token allows
access to resources until it expires.  A leaked refresh token, to be
useful,  requires an exchange with the AS, and the AS would have the
opportunity to check whether the refresh token is still valid (has not been
revoked).  (of course revocation might NOT have happened, but then again,
it might have.)

Furthermore, since the access token is transmitted to other servers, the
risk of exposure is greater, due to possible vulnerabilities in those
called systems (e.g., logs).  Isn't this the reason that we have refresh
tokens? Don't refresh tokens exist because access tokens should have short
TTL, because they are widely distributed?

"Additionally, browser-based applications provide many attack vectors by
which a refresh token can be leaked."

The risks of leaking a refresh token from the browser are identical to the
risks of leaking an access token, right?  This sentence could be changed to
"... by which *a token* can be leaked."

A refresh token is "higher risk" because its TTL is usually greater than
the access token's TTL.  But if our advice here leads to people using
longer-lived access tokens (because of the problems with getting a new
access token without involving the user), then the advice will be counter
productive.   The longer life gives more time for the usefulness of a
browser-side theft, and more time for the usefulness of a server-side
theft.

Which scenario is safer?

A) using an access token with a 10 minute TTL, accompanied by a refresh
token with a 1 hour TTL
B) using an access token with a 1 hour TTL, and no refresh token.

I'd say that A is safer. (Unless, when the refresh token is used, a new
refresh token is issued, the NEW refresh token gets another 1 hour.  If
this is the case, one could maintain refresh tokens infinitely. Is this
point addressed somewhere?)