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

Aaron Parecki <aaron@parecki.com> Wed, 24 July 2019 21:04 UTC

Return-Path: <aaron@parecki.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 1EB081205CD for <oauth@ietfa.amsl.com>; Wed, 24 Jul 2019 14:04:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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=parecki-com.20150623.gappssmtp.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 lyhWuL6a47b8 for <oauth@ietfa.amsl.com>; Wed, 24 Jul 2019 14:04:20 -0700 (PDT)
Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 81F84120285 for <oauth@ietf.org>; Wed, 24 Jul 2019 14:04:20 -0700 (PDT)
Received: by mail-io1-xd2f.google.com with SMTP id h6so6048819iom.7 for <oauth@ietf.org>; Wed, 24 Jul 2019 14:04:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=parecki-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DTr1PXo99HRzy1hmihvw98vMF/uKCL2Gi3zt7p8L2Jo=; b=dUVOcTXtgUSg2OLQCovlqF3DrRQyJ3EK8V9AH/YgVnvKp6+pmEzo+NC/e37QprAyNB 8yIAJv7x6A/eOtoozx0HY0OvG4lB3mvpdNCbyDRKoIspup8HgxJ34JIxvDh9nH+Tyg3j PFPMwm0erHJ9ro7rzygj1FXJWR+5xcjliZDSVniCnwl0RFulmynUG/GtYVsQ8UuhHINX W295wLVuQs/FNAfJy7ObsRUTlwlVpQWk0Dc7ZUtrWugEsk3CWfcDQtFO8BzXW0UV+7x+ OVCmV0uzC/t+BpcvZfhnbBD7sWGsE5RJgx9tDtlNVZhorgzC+2teg+ps/UwZJG9i9B0u HTfA==
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:content-transfer-encoding; bh=DTr1PXo99HRzy1hmihvw98vMF/uKCL2Gi3zt7p8L2Jo=; b=FfszP4oZuVQfpS0j273KBjrRzplDjUugXmGFGxQ0wyGjZIrHtDANFzjYpqy+VHtbM6 IrqCA+Pt9bOmex3f/XcD2+lO+NEgGLqhBSK/Mn5CQBtduuYTIADznBJ+uz4n5xL0WX2u yEk76FZRuh61a4LjyGEpMXUAEiJL26WF2nfdUUOQJ9nosMMzsFvDRGbr7ShOJ6j4a8cF 9zbvAHklMtmTIAvctT+jFgWvKqyhHOcQ2ajj1s7wdFBhaYvPCPe3wB3Q6Wg0hDwir7nb Tey1G0ODLvkV5qQH/4aWEG1H8/ORVapp0ehp/DEx5+/Ck3nQ9BRDzMtyBEo7YONrRyWC yi8Q==
X-Gm-Message-State: APjAAAVB9wd5vouKGBkos/+UCY44j9+LapXlHR3YmpM0OdepXl/02Q80 lf2gceoNvR6boQnGpH0ihJdnLaWjWa7X1A==
X-Google-Smtp-Source: APXvYqyj3y4fKrRbJ8sZvadhobXTN8Po6qFQfQIGz3B75EFyHtyl8tN8ogRndOYTtEdh9Bnsc4VuQg==
X-Received: by 2002:a5d:87da:: with SMTP id q26mr69567084ios.193.1564002259478; Wed, 24 Jul 2019 14:04:19 -0700 (PDT)
Received: from mail-io1-f54.google.com (mail-io1-f54.google.com. [209.85.166.54]) by smtp.gmail.com with ESMTPSA id c17sm35549004ioo.82.2019.07.24.14.04.18 for <oauth@ietf.org> (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 14:04:18 -0700 (PDT)
Received: by mail-io1-f54.google.com with SMTP id f4so92628767ioh.6 for <oauth@ietf.org>; Wed, 24 Jul 2019 14:04:18 -0700 (PDT)
X-Received: by 2002:a5d:80c3:: with SMTP id h3mr70651554ior.167.1564002258709; Wed, 24 Jul 2019 14:04:18 -0700 (PDT)
MIME-Version: 1.0
References: <CAO7Ng+tyHaKQgJ4PcrcEpMcteqvdH2PE1CQP5j+5DqKJWuKPoQ@mail.gmail.com>
In-Reply-To: <CAO7Ng+tyHaKQgJ4PcrcEpMcteqvdH2PE1CQP5j+5DqKJWuKPoQ@mail.gmail.com>
From: Aaron Parecki <aaron@parecki.com>
Date: Wed, 24 Jul 2019 17:03:14 -0400
X-Gmail-Original-Message-ID: <CAGBSGjoexpLjzOcBV+wjH6+CtRROB1ZbPre+7DgfipsO1RgVOQ@mail.gmail.com>
Message-ID: <CAGBSGjoexpLjzOcBV+wjH6+CtRROB1ZbPre+7DgfipsO1RgVOQ@mail.gmail.com>
To: Dominick Baier <dbaier@leastprivilege.com>
Cc: OAuth WG <oauth@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/T8IStray3EwvKPI5bnWDo-raeiY>
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: Wed, 24 Jul 2019 21:04:23 -0000

On Mon, Jul 22, 2019 at 2:14 AM Dominick Baier
<dbaier@leastprivilege.com> wrote:

> I think you are mixing authentication and API access here. Depending on application scenario it makes a lot of sense to use OIDC - but rely on the resulting session to control API access.
> Unless you want to dive into the details here, I suggest you remove the mention of OIDC because it is misleading.

I agree, I removed the mention of OIDC.

> 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?

----
Aaron Parecki
aaronparecki.com
@aaronpk



On Mon, Jul 22, 2019 at 2:14 AM Dominick Baier
<dbaier@leastprivilege.com> wrote:
>
> Hey,
>
> Just read the spec - good to see the progress. Some feedback:
>
> I am yet undecided if I like the categorisation of the “Application Architecture Patterns”. I definitely want to distinguish between applications only accessing same-site back-end services and “others”. Not sure if “dynamic application server" and “static application server” should be handled differently - they are deployment details and should not decide on the application security architecture. Also not sure how realistic it is to deploy a typical applications solely from e.g. a CDN. But I don’t have the right answer wrt to categories right now.
>
> 6.1.  Apps Served from a Common Domain as the Resource Server
>
> > OAuth and OpenID Connect provide very little benefit in this
>    deployment scenario, so it is recommended to reconsider whether you
>    need OAuth or OpenID Connect at all in this case.
>
> I think you are mixing authentication and API access here. Depending on application scenario it makes a lot of sense to use OIDC - but rely on the resulting session to control API access.
> Unless you want to dive into the details here, I suggest you remove the mention of OIDC because it is misleading.
>
>
> 6.2.  Apps Served from a Dynamic Application Server
>
> I have a .NET sample for that
>
> https://github.com/leastprivilege/AspNetCoreSecuritySamples/tree/aspnetcore21/BFF
> And a blog post
> https://leastprivilege.com/2019/01/18/an-alternative-way-to-secure-spas-with-asp-net-core-openid-connect-oauth-2-0-and-proxykit/
>
> 9.7.  Content-Security Policy
>
>    A browser-based application that wishes to use either long-lived
>    refresh tokens or privileged scopes SHOULD restrict its JavaScript
>    execution to a set of statically hosted scripts via a Content
>    Security Policy ([CSP2]) or similar mechanism.
>
>
>
> 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.
>
> Thanks for doing this work!
>
> ———
> Dominick
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth