Re: [OAUTH-WG] Feedback on OAuth for browser-based Apps

David Waite <david@alkaline-solutions.com> Thu, 25 July 2019 08:04 UTC

Return-Path: <david@alkaline-solutions.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 D0885120332 for <oauth@ietfa.amsl.com>; Thu, 25 Jul 2019 01:04:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=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 ou0YZ72vATV3 for <oauth@ietfa.amsl.com>; Thu, 25 Jul 2019 01:04:57 -0700 (PDT)
Received: from alkaline-solutions.com (lithium5.alkaline-solutions.com [173.255.196.46]) by ietfa.amsl.com (Postfix) with ESMTP id D704F1202DF for <oauth@ietf.org>; Thu, 25 Jul 2019 01:04:57 -0700 (PDT)
Received: from [IPv6:2601:282:202:b210:ec9d:ea62:7def:e5ff] (unknown [IPv6:2601:282:202:b210:ec9d:ea62:7def:e5ff]) by alkaline-solutions.com (Postfix) with ESMTPSA id AECE231625; Thu, 25 Jul 2019 08:04:56 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3566.0.1\))
From: David Waite <david@alkaline-solutions.com>
In-Reply-To: <CAGBSGjoexpLjzOcBV+wjH6+CtRROB1ZbPre+7DgfipsO1RgVOQ@mail.gmail.com>
Date: Thu, 25 Jul 2019 02:04:56 -0600
Cc: Dominick Baier <dbaier@leastprivilege.com>, OAuth WG <oauth@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <F6536A63-6950-4A05-A35C-B8215BB04277@alkaline-solutions.com>
References: <CAO7Ng+tyHaKQgJ4PcrcEpMcteqvdH2PE1CQP5j+5DqKJWuKPoQ@mail.gmail.com> <CAGBSGjoexpLjzOcBV+wjH6+CtRROB1ZbPre+7DgfipsO1RgVOQ@mail.gmail.com>
To: Aaron Parecki <aaron@parecki.com>
X-Mailer: Apple Mail (2.3566.0.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/wtckD-inXBxAj2XGJmhmJSsU3Uw>
Subject: Re: [OAUTH-WG] Feedback on OAuth for browser-based Apps
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: Thu, 25 Jul 2019 08:05:00 -0000



> On Jul 24, 2019, at 3:03 PM, Aaron Parecki <aaron@parecki.com> wrote:
> 
> On Mon, Jul 22, 2019 at 2:14 AM Dominick Baier
> <dbaier@leastprivilege.com> wrote:
> 
<snip>

>> I would rather say that ANY JS app should use CSP to lock down the browser features to a minimal attack surface. In addition, if refresh or access tokens are involved - further settings like disabling inline scripting (unsafe inline) and eval should be disabled.
> 
> I'm not sure what to do with this suggestion. It feels like a blanket
> recommendation of enabling CSP will likely be ignored since it's too
> broad, and recommending disabling inline scripts is overreaching
> unless backed up by a specific threat it's protecting against. Did you
> have a particular threat in mind?

I would say that browser applications should take measures to harden their applications again code injection and arbitrary code execution. Examples include eliminating inline script (and limiting embeddable objects as much as possible) via CSP, and versioning third party resources via techniques like subresource integrity.  Mechanisms such as augmenting the codebase to make sure all appropriate user input, data storage, and output properly sanitize data may be used - although they may be more expensive to implement and audit.

The AS should likewise take into account an application’s overall security posture when deciding appropriate policies around delegated authorization scopes and token lifetimes.

Best current practices include turning the screws tightly around CSP. But it is (theoretically) possible to accomplish the same with brute-force sanitization, which has been made simpler with framework support. It is still ultimately the AS job to decide which clients have which capabilities.

-DW