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

Filip Skokan <panva.ip@gmail.com> Tue, 23 July 2019 08:08 UTC

Return-Path: <panva.ip@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 D9E24120133 for <oauth@ietfa.amsl.com>; Tue, 23 Jul 2019 01:08:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.996
X-Spam-Level:
X-Spam-Status: No, score=-1.996 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, MIME_QP_LONG_LINE=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 HmhofRy4UqFH for <oauth@ietfa.amsl.com>; Tue, 23 Jul 2019 01:08:45 -0700 (PDT)
Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 63FB6120132 for <oauth@ietf.org>; Tue, 23 Jul 2019 01:08:45 -0700 (PDT)
Received: by mail-wr1-x429.google.com with SMTP id x4so42059848wrt.6 for <oauth@ietf.org>; Tue, 23 Jul 2019 01:08:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZV0T3QMP0wk50SBtySMkG54EPdmaUWO2fRfFDQ1Oyfg=; b=rtDBUfAEbQiqvC+iQ3RP5Nl/haazo/KCRkgOzzto8VxU1raX2stPnSTM1hXwUgovAn VIHmHRsfb3C2E0DOdf7FWJXaxhV4UCRq6KiTalM6YyhwV9D+92L4d6U0O+lBEDVuHABh KcCbc0IDIKz14gC4cpZfSclpFYbpQZAOanTQ5dYTE3rbAwE+zG8VIkEa5Xl5s2bbtf6s uTtJtXZcmRlXvjfuSQlgxFmFNrSMMByMrVyPCbObp9HZqHjIsSBlYq4YBDk5qoUu81t+ SIw68Rtp6xl8tByRQwmky1rMAxS/n+4qQI5GaI4b/mcF3iCZnyfg3LAFnhAwctgKMRnw LlPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZV0T3QMP0wk50SBtySMkG54EPdmaUWO2fRfFDQ1Oyfg=; b=kYhEK9qQb7cfTPKLx7TK+YynWX/cYhwGPAaF8291MH4B5Kt4zbPvny6RCBbb6qcwa4 bXT7GzjaM897Yu3/fK30rNICo44P/Xd+rZIci3qxkoNrktCKz67riHW0t7dJSF5hzrq2 B0cXCUCBHyuJiW2hxm3yrHqHMBTmimYtmUawmBWfoUoZsPmqRtyKguypsoOzj5GeLPSd 0pYtgL21RPg4C7NXAF6UWarAUwT+wJQvF+p/v7tfJGqi90joa4YNcyrTjM9En6uvYTzE 3cd0wO98f1u0veV/IJZV7slsDaWMrYbpROg7l6o0RBXllGOgxXvJuHrBqzgclh2uiwxF z7kQ==
X-Gm-Message-State: APjAAAWjjcHs6tAyccXyKcKACD3G4f5WCO6i2QE/xpsfsMottG4sQrii GwmDrypGh9EXui4leBsuF31mp5NfyA==
X-Google-Smtp-Source: APXvYqyJDZNFuGNhIs8mvmz4Imp0WaEa2SJcS7k1KczEGiRrB8+HpWg8/h9f5JftrZKUJdBjRCg18w==
X-Received: by 2002:a5d:438e:: with SMTP id i14mr76205340wrq.122.1563869323437; Tue, 23 Jul 2019 01:08:43 -0700 (PDT)
Received: from [192.168.1.110] (ip-37-188-255-15.eurotel.cz. [37.188.255.15]) by smtp.gmail.com with ESMTPSA id y16sm85721299wrg.85.2019.07.23.01.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2019 01:08:42 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail-7E1B1DE9-7E2B-4A4F-B9D8-2F34F92A0B92"
Mime-Version: 1.0 (1.0)
From: Filip Skokan <panva.ip@gmail.com>
X-Mailer: iPhone Mail (16F203)
In-Reply-To: <DB41BFE8-2123-43B4-9BFB-D548CD96FB72@forgerock.com>
Date: Tue, 23 Jul 2019 10:08:41 +0200
Cc: Dominick Baier <dbaier@leastprivilege.com>, OAuth WG <oauth@ietf.org>
Content-Transfer-Encoding: 7bit
Message-Id: <7AB72379-075B-411D-B149-3759F16B001A@gmail.com>
References: <CAO7Ng+tyHaKQgJ4PcrcEpMcteqvdH2PE1CQP5j+5DqKJWuKPoQ@mail.gmail.com> <CAO7Ng+sLuLczQYjYX7yHSfVJd7bx5y0RnDofRh_Mb2Se+vA0=A@mail.gmail.com> <DB41BFE8-2123-43B4-9BFB-D548CD96FB72@forgerock.com>
To: Neil Madden <neil.madden@forgerock.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/mo7NefQD1T3jvDii8tn0aj8UbM8>
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: Tue, 23 Jul 2019 08:08:49 -0000

Wouldn’t that contradict the security topics BCP?

Odesláno z iPhonu

23. 7. 2019 v 9:44, Neil Madden <neil.madden@forgerock.com>:

> Technically it could be optional, but it means that a CSRF attempt will only be detected by the AS not by the client. If we consider the possibility of a malicious AS, then this could allow Login CSRF attacks against the client. The client would also have to be sure that the AS actually implements PKCE. So I think it’s safer to leave the recommendation as-is. 
> 
>> On 23 Jul 2019, at 08:28, Dominick Baier <dbaier@leastprivilege.com> wrote:
>> 
>> Forgot one more thing
>> 
>> In 7.1
>> 
>> Browser-based apps MUST use the OAuth 2.0 "state" parameter to
>>    protect themselves against Cross-Site Request Forgery and
>>    authorization code swap attacks and MUST use a unique value for each
>>    authorization request, and MUST verify the returned state in the
>>    authorization response matches the original state the app created.
>> 
>> Isn’t state optional when PKCE is used?
>> 
>> thanks
>> ———
>> Dominick
>> 
>>> On 22. July 2019 at 08:14:33, 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
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth